-
Notifications
You must be signed in to change notification settings - Fork 6
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
Port to use bzlmod and hermetic Python #76
Conversation
+@zachfang and +@SeanCurtis-TRI for review, please. \CC @rpoyner-tri FYI |
Respell WORKSPACE.bazel into MODULE.bazel + WORKSPACE.bzlmod. For now, this means that our skylark external dependencies (like rules_python) are not upgraded by tools/upgrade.sh -- there's a TODO instead. Switch from the Ubuntu Python interpreter to a Bazel one (downloaded as an external). Since any given version of Blender only works with one specific version of CPython, this will make it easier to stay in sync long-term. This also lets us drop the unittest_path_cleaner hack to avoid test pollution from Ubuntu libraries. Switch to using a pip() helper macro to specify the pip deps for our programs. The old long-hand spellings don't work with bzlmod. Switch to rules_python runfiles instead of bazel_tools runfiles. Add test/BUILD.bazel as a sub-package; writing out all of the test rules in the top-level BUILD.bazel was too much clutter.
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.
Reviewed 2 of 17 files at r1.
Reviewable status: LGTM missing from assignees SeanCurtis-TRI,zachfang (waiting on @SeanCurtis-TRI and @zachfang)
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.
Reviewed 17 of 17 files at r1.
Reviewable status: LGTM missing from assignee SeanCurtis-TRI (waiting on @SeanCurtis-TRI)
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.
The changes seem consistent with the documentation, but the bazel details go beyond my level of comprehension. So, take the stamp for what it's worth.
Reviewed 17 of 17 files at r1, all commit messages.
Reviewable status: complete! all discussions resolved, LGTM from assignees SeanCurtis-TRI,zachfang (waiting on @jwnimmer-tri)
The hope is that in a pinch, others besides me have enough familiarity with the build (by having read these PRs and checked them for clarity) to fix things that crop up. |
See https://bazel.build/external/module for docs about
bzlmod
. TheWORKSPACE
mechanism in Bazel will be deprecated around the end of this year, and removed about a year (or a little more) after that. Porting some of our smaller projects like this one tobzlmod
is good practice for working the same on Drake (RobotLocomotion/drake#20731).Closes #67.
Respell
WORKSPACE.bazel
intoMODULE.bazel
+WORKSPACE.bzlmod
. For now, this means that our skylark external dependencies (likerules_python
) are not upgraded bytools/upgrade.sh
-- there's a TODO instead. (My expectation is that after this PR lands, the@renovatebot
will automatically handle it for us.)Switch from the Ubuntu Python interpreter to a Bazel one (downloaded as an external). Since any given version of Blender only works with one specific version of CPython, this will make it easier to stay in sync long-term. This also lets us drop the
unittest_path_cleaner
hack to avoid test pollution from Ubuntu libraries.Switch to using a
pip()
helper macro to specify the pip deps for our programs. The old long-hand spellings don't work with bzlmod.Switch to
rules_python
runfiles instead ofbazel_tools
runfiles (ala RobotLocomotion/drake#21331).Add
test/BUILD.bazel
as a sub-package; writing out all of the test rules in the top-levelBUILD.bazel
was too much clutter.This change is