Skip to content

Add bzlmod support (MODULE.bazel)#1329

Open
Konboi wants to merge 5 commits into
v1from
bzlmode-support-v1
Open

Add bzlmod support (MODULE.bazel)#1329
Konboi wants to merge 5 commits into
v1from
bzlmode-support-v1

Conversation

@Konboi

@Konboi Konboi commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add MODULE.bazel to support Bzlmod (Bazel's new dependency management system), replacing the legacy WORKSPACE-based setup
  • Add WORKSPACE.bzlmod (empty) to suppress WORKSPACE processing when bzlmod is active
  • Add BUILD at repo root (required for //:maven_install.json package reference)
  • Regenerate maven_install.json at root with bzlmod-compatible v2 format
  • Enable bzlmod via common --enable_bzlmod in .bazelrc
  • Use rules_jvm_external 6.7 (6.6's BCR entry uses an old bazelbuild URL that returns 504; 6.7 correctly uses bazel-contrib)

The WORKSPACE file is retained as-is for backward compatibility.

Test plan

  • REPIN=1 bazel run @unpinned_maven//:pin — completed successfully, maven_install.json regenerated
  • bazel build //src/main/java/com/launchableinc/ingest/commits/... — passes
  • bazel test //src/test/java/com/launchableinc/ingest/commits:AllTests — 1 test passes

🤖 Generated with Claude Code

Konboi and others added 5 commits June 8, 2026 16:38
- 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant