Skip to content
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
wants to merge 64 commits into
base: master
Choose a base branch
from
Draft

build: use bzlmod #4723

wants to merge 64 commits into from

Conversation

katyatitkova
Copy link
Contributor

No description provided.

jiceatscion and others added 27 commits February 18, 2025 18:48
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.
# Conflicts:
#	.bazelrc
#	MODULE.bazel
#	MODULE.bazel.lock
#	docker/tester.bzl
#	scion-pki/cmd/scion-pki/BUILD.bazel
#	scion/cmd/scion/BUILD.bazel
@jiceatscion
Copy link
Contributor

This change is Reviewable

Copy link
Contributor

@jiceatscion jiceatscion left a 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: :shipit: complete! all files reviewed, all discussions resolved (waiting on @katyatitkova)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants