-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
build: use bzlmod #4723
Draft
katyatitkova
wants to merge
64
commits into
master
Choose a base branch
from
bazel-modules
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
build: use bzlmod #4723
+10,131
−6,322
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Changes that were needed: * Pain: Python binaries are somehow handled a bit differently and cannot import from a path relative to themselves by default. Remedy: One must now add an explicit root path for imports in py_binary rules. * Pain: The prohibition on generate un-specified targets into a directory is now enforced. Gendocs is broken. Remedy: Replace the gendocs genrules with a fully specified rule that declare a directory output. * Pain: Bazel uses a new method of sanboxing by default: containers. Tests that have a dockerized component and mount a data directory end-up with an empty data directory. Probably, since docker is a server, it does not create a container nested in the caller's container, but just creates an un-nested container. As a result, whatever pathname we tell it to mount is relative to a different root. Remedy: Use an obscure set of magic arguments to restore the old sandboxing behaviour for tests.
Nowadays bazel generates external dependency directories named <something>~<orother>. Those are redundant, should not be processed, and are sometimes not part of a PR because of gitignore.
~/bazel-central-registry/tools/migrate_to_bzlmod.py -f -t //:all INFO: Executing command: bazel --version bazel 7.3.0 INFO: Generating ./resolved_deps.py file INFO: Executing command: bazel clean --expunge INFO: Executing command: bazel build --nobuild --experimental_repository_resolved_file=resolved_deps.py //:all INFO: Found 1111 external repositories in the ./resolved_deps.py file. INFO: Executing command: bazel build --nobuild --enable_bzlmod //:all INFO: Congratulations! All external repositories needed for building `//:all` are available with Bzlmod (and the WORKSPACE.bzlmod file)! INFO: Things you should do next: INFO: - Migrate remaining dependencies in the WORKSPACE.bzlmod file to Bzlmod. INFO: - Run the actual build with Bzlmod enabled (with --enable_bzlmod, but without --nobuild) and fix remaining build time issues.
…ails with make test
# Conflicts: # .bazelrc # MODULE.bazel # MODULE.bazel.lock # docker/tester.bzl # scion-pki/cmd/scion-pki/BUILD.bazel # scion/cmd/scion/BUILD.bazel
jiceatscion
reviewed
Mar 11, 2025
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.
Thank you for this considerable tech debt repayment.
Reviewed 104 of 105 files at r1, 5 of 5 files at r2, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @katyatitkova)
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.