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

dev,generate-cgo: externalize cgo files gen into a seperate binary #103140

Closed
wants to merge 2 commits into from

Conversation

healthy-pod
Copy link
Contributor

@healthy-pod healthy-pod commented May 11, 2023

Previously, we only needed to gen cgo files using dev so that was were that logic lived. Now, we need to gen cgo files outside dev to fix an issue with gcassert [see #65485].

The first commit externalizes the code into a separate binary and let's dev gen cgo point to it. The second commit upgrades gcassert and generates cgo files before running gcassert.

Release note: None
Epic: None

Closes #65485

@healthy-pod healthy-pod requested a review from a team as a code owner May 11, 2023 20:04
@blathers-crl
Copy link

blathers-crl bot commented May 11, 2023

It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR?

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@healthy-pod healthy-pod force-pushed the fix-gcassert branch 2 times, most recently from fded78d to a1d4386 Compare May 11, 2023 21:37
Previously, we only needed to gen cgo files using `dev` so that
was were that logic lived. Now, we need to gen cgo files outside
dev to fix an issue with gcassert [see cockroachdb#65485].

This code change externalizes the code into a separate binary
and let's `dev gen cgo` point to it.

Release note: None
Epic: None

Informs cockroachdb#65485
@healthy-pod healthy-pod force-pushed the fix-gcassert branch 4 times, most recently from fec22ef to 4b5f433 Compare May 11, 2023 22:34
@@ -4,6 +4,9 @@ set -xeuo pipefail

bazel build @com_github_jordanlewis_gcassert//cmd/gcassert:gcassert --config=ci
bazel run //pkg/gen:code
WORKSPACE=$(bazel info workspace --color=no)
BAZEL_BIN=$(bazel info bazel-bin --color=no)
bazel run //pkg/cmd/generate-cgo:generate-cgo -- --workspace $WORKSPACE --bazel-bin $BAZEL_BIN
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: Can just use $PWD or pwd instead of bazel info workspace.


func init() {
flag.StringVar(&workspace, "workspace", "", "workspace path")
flag.StringVar(&bazelBin, "bazel-bin", "", "path to bazel/bin")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: Consider that generate-cgo can just call into bazel info bazel-bin itself, since it is the one doing the builds anyway, instead of requiring it to be passed in as an argument.

@healthy-pod
Copy link
Contributor Author

superseded by #104554

@healthy-pod healthy-pod closed this Jun 8, 2023
@healthy-pod healthy-pod deleted the fix-gcassert branch June 8, 2023 03:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bazel: TestLint/TestGCAssert fails when run under Bazel
3 participants