Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent breakage when merging OSS changes to ENT due to missing funcs #21564

Merged
merged 12 commits into from
Jul 6, 2023

Conversation

ncabatoff
Copy link
Collaborator

@ncabatoff ncabatoff commented Jul 4, 2023

…e stubs on oss, and also on ent if the real func hasn't yet been defined.
tools/stubmaker/main.go Fixed Show fixed Hide fixed
tools/stubmaker/main.go Outdated Show resolved Hide resolved
tools/stubmaker/main.go Show resolved Hide resolved
tools/stubmaker/main.go Outdated Show resolved Hide resolved
tools/stubmaker/main.go Outdated Show resolved Hide resolved
@ncabatoff ncabatoff marked this pull request as ready for review July 5, 2023 19:54
@ncabatoff ncabatoff changed the title Add a go:generate helper called stubmaker Prevent breakage when merging OSS changes to ENT due to missing funcs Jul 5, 2023
}

target := fmt.Sprintf("%s_ent.go", baseFilename)
os.Remove(target)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we want to remove the ent file, if it exists?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we do. It's possible that we created it in a previous run, but since then the real funcs were implemented, and now the presence of the file causes builds to fail due to multiple definitions of the funcs.

cfg := &packages.Config{
Mode: packages.NeedName | packages.NeedTypes | packages.NeedTypesInfo | packages.NeedSyntax,
Tests: false,
BuildFlags: []string{fmt.Sprintf("-tags=%s", strings.Join(tags, " "))},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to worry about any additional tags, like hsm or fips?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. Re HSM, I don't think so, we don't run tests using hsm AFAIK, I think it's mostly about how we build the binaries. Re fips, less certain, but looking at how much it's used now I'm inclined to not worry about. For one thing, how would we know which to use when running locally (i.e. not in CI), fips or not fips?

Copy link
Member

@banks banks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@ncabatoff ncabatoff merged commit afc8f7d into main Jul 6, 2023
@ncabatoff ncabatoff deleted the stubmaker branch July 6, 2023 16:35
@ncabatoff
Copy link
Collaborator Author

I'll defer backporting until I've done more testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants