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

bazel: inject git version information into version.cc #23303

Merged
merged 3 commits into from
Sep 12, 2024

Conversation

rockwotj
Copy link
Contributor

@rockwotj rockwotj commented Sep 12, 2024

  • bazel: use expand_template instead of genrule
  • bazel: support --config=stamp to stamp builds
  • bazel: inject version info with --config=stamp

Fixes: CORE-5568

Backports Required

  • none - not a bug fix
  • none - this is a backport
  • none - issue does not exist in previous branches
  • none - papercut/not impactful enough to backport
  • v24.2.x
  • v24.1.x
  • v23.3.x

Release Notes

  • none

.bazelrc Show resolved Hide resolved
Using --workspace_status_command embed the version information into the
binary. The output of that script becomes a file that we can input into
the build system using a custom rule that invokes a python script to
write out a C++ source file with those values. This is all controlled
via --config=stamp.

I tried to leave lots of breadcrumbs here, but for those new to writing
Bazel rules, there are two great resources, the reference docs for a
rule: https://bazel.build/rules/lib/builtins/ctx and the Bazel examples
found here: https://github.com/bazelbuild/examples/tree/main/rules
@rockwotj
Copy link
Contributor Author

Cancelling the standard CI pipeline, this only effects Bazel.

@rockwotj rockwotj merged commit ccfb198 into redpanda-data:dev Sep 12, 2024
12 of 16 checks passed
@rockwotj rockwotj deleted the bazel-version branch September 12, 2024 17:48
This pull request was closed.
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.

2 participants