-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Conversation
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. |
fded78d
to
a1d4386
Compare
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
fec22ef
to
4b5f433
Compare
@@ -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 |
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
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.
Release note: None Epic: none Closes cockroachdb#65485
superseded by #104554 |
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 upgradesgcassert
and generatescgo
files before runninggcassert
.Release note: None
Epic: None
Closes #65485