Add bzlmod support (MODULE.bazel)#1329
Open
Konboi wants to merge 5 commits into
Open
Conversation
- Add MODULE.bazel with rules_jvm_external 6.6 via Bazel Central Registry - Add WORKSPACE.bzlmod (empty) to suppress WORKSPACE processing under bzlmod - Add maven_install.json (root) as the bzlmod lock file placeholder - Add MODULE.bazel.lock to pin the module graph - Enable bzlmod via `common --enable_bzlmod` in .bazelrc After cloning, run `REPIN=1 bazel run @unpinned_maven//:pin` to populate maven_install.json with resolved artifact checksums. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Bump rules_jvm_external to 6.7 (6.6 BCR entry uses old bazelbuild URL that returns 504) - Fix maven_install.json format: use "version": "2" (string) as required by v2_lock_file.bzl - Add root BUILD file required for //:maven_install.json package reference - Regenerate maven_install.json and MODULE.bazel.lock via REPIN=1 bazel run @unpinned_maven//:pin Verified: bazel build and bazel test //src/test/.../AllTests pass. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Under bzlmod, animal-sniffer jar moves from external/maven/org/jvnet/animal-sniffer/*/*.jar to external/rules_jvm_external~~maven~maven/org/jvnet/animal-sniffer/*/*.jar Use echo+glob expansion and filter unexpanded patterns to find the jar under either path, so the script works with both WORKSPACE and bzlmod builds. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
On Windows (case-insensitive FS), a file named BUILD collides with the build/ directory that pip creates when building wheels. This caused: error: could not create 'build\lib\launchable': Cannot create a file when that file already exists BUILD.bazel is equally recognized by Bazel and avoids the collision. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
WORKSPACE.bzlmod (empty) signals to Bazel that WORKSPACE processing should be suppressed. No need to keep the old file around. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in 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.
Summary
MODULE.bazelto support Bzlmod (Bazel's new dependency management system), replacing the legacyWORKSPACE-based setupWORKSPACE.bzlmod(empty) to suppress WORKSPACE processing when bzlmod is activeBUILDat repo root (required for//:maven_install.jsonpackage reference)maven_install.jsonat root with bzlmod-compatible v2 formatcommon --enable_bzlmodin.bazelrcrules_jvm_external6.7 (6.6's BCR entry uses an oldbazelbuildURL that returns 504; 6.7 correctly usesbazel-contrib)The
WORKSPACEfile is retained as-is for backward compatibility.Test plan
REPIN=1 bazel run @unpinned_maven//:pin— completed successfully,maven_install.jsonregeneratedbazel build //src/main/java/com/launchableinc/ingest/commits/...— passesbazel test //src/test/java/com/launchableinc/ingest/commits:AllTests— 1 test passes🤖 Generated with Claude Code