Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

feat(bazel): read binary version info from accompanying files in OCI images instead of stamping //internal/version#63977

Merged
Strum355 merged 3 commits into
mainfrom
nsc/internal-version-stamp-raise
Jul 30, 2024
Merged

feat(bazel): read binary version info from accompanying files in OCI images instead of stamping //internal/version#63977
Strum355 merged 3 commits into
mainfrom
nsc/internal-version-stamp-raise

Conversation

@Strum355

@Strum355 Strum355 commented Jul 22, 2024

Copy link
Copy Markdown
Contributor

https://linear.app/sourcegraph/issue/DINF-111/rework-how-we-inject-version-in-our-artifacts

Pros:

  • saves having to rebuild bazel query 'kind("go_library", rdeps(//..., //internal/version))' | wc -l == 523 Go packages when stamp variables cause a rebuild
  • Cutting out GoLink action time when stamp changes but code is cached

Cons:

  • Binaries themselves are no longer stamped, only knowing their version info within the context of the docker image
  • A tad extra complexity in internal/version/version.go to handle this new divergence

Before:

$ bazel aquery --output=summary --include_commandline=false --include_artifacts=false --include_aspects=false --stamp 'inputs(".*volatile-status\.txt", //...)'

  Action: 1
  Genrule: 2
  Rustc: 3
  ConvertStatusToJson: 88
  GoLink: 383

After:

$ bazel aquery --output=summary --include_commandline=false --include_artifacts=false --include_aspects=false --stamp 'inputs(".*volatile-status\.txt", //...)'

Mnemonics:
  Genrule: 2
  Action: 3
  Rustc: 3
  ConvertStatusToJson: 86

Test plan

Lots of building & rebuilding with stamp flags, comparing execution logs & times

Changelog

@Strum355 Strum355 requested a review from a team July 22, 2024 12:04
@cla-bot cla-bot Bot added the cla-signed label Jul 22, 2024

@burmudar burmudar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Minor comment

Comment thread internal/version/version.go
@Strum355 Strum355 force-pushed the nsc/internal-version-stamp-raise branch from 2a48369 to 8560e3a Compare July 22, 2024 13:13
@Strum355 Strum355 closed this Jul 25, 2024
@Strum355 Strum355 reopened this Jul 30, 2024
@Strum355 Strum355 force-pushed the nsc/internal-version-stamp-raise branch from 8560e3a to da7cf2d Compare July 30, 2024 13:49
@Strum355 Strum355 force-pushed the nsc/internal-version-stamp-raise branch from da7cf2d to 8777b2a Compare July 30, 2024 16:47
@Strum355 Strum355 force-pushed the nsc/internal-version-stamp-raise branch from d930d39 to 8ce453f Compare July 30, 2024 17:38
@Strum355 Strum355 enabled auto-merge (squash) July 30, 2024 17:40
@Strum355 Strum355 merged commit adef82f into main Jul 30, 2024
@Strum355 Strum355 deleted the nsc/internal-version-stamp-raise branch July 30, 2024 20:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants