Skip to content

[bzlmod] Migrate to MODULE.bazel#29

Merged
adam-singer merged 5 commits intomainfrom
adamsinger/migrate-to-module-bazel
Dec 9, 2025
Merged

[bzlmod] Migrate to MODULE.bazel#29
adam-singer merged 5 commits intomainfrom
adamsinger/migrate-to-module-bazel

Conversation

@adam-singer
Copy link
Contributor

@adam-singer adam-singer commented Dec 9, 2025

Problem

The repository used WORKSPACE-based dependency management, which is legacy. Bazel is moving to Bzlmod (MODULE.bazel) as the modern standard for external dependencies.

Solution

Fully migrated to Bzlmod without WORKSPACE backwards compatibility:

  • Created MODULE.bazel (v0.1.0) with:

    • Core dependency: platforms@0.0.11
    • Test dependencies: rules_python@0.40.0 with pip integration
    • Module extensions for tooling and test container repos
  • Created minidock/remote_tools/extensions.bzl with two module extensions:

    • minidock_tools - Loads platform-specific binaries (merge, pusher, puller apps)
    • test_repos - Sets up external container repositories for testing
  • Removed WORKSPACE support entirely:

    • Deleted all WORKSPACE files (root and test directories)
    • Removed repositories.bzl (old WORKSPACE-style load_tools())
    • Updated repository references: @com_github_bazeltools_rules_minidock@rules_minidock
  • Restructured tests:

    • Tests now run from root directory via //tests/... instead of separate workspaces
    • Consolidated test dependencies into root MODULE.bazel
    • Added manual tags to stub test targets to exclude from wildcard builds
    • Updated scripts/ci_test.py to build from root
  • Updated tooling:

    • Modified update_remote_tools.sh to update extensions.bzl instead of repositories.bzl
    • Updated README with Bzlmod setup instructions

Testing

  • ✅ Core rules build: ./bazel build //minidock/...
  • ✅ Test targets build: ./bazel build //tests/simple_flow/...
  • ✅ CI passes: python3 scripts/ci_test.py
  • ✅ SHA256 reproducibility verified

Requirements: Bazel 6.0+ with Bzlmod (enabled by default in .bazelrc)

Copy link
Member

@jklukas jklukas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you!

@adam-singer adam-singer marked this pull request as ready for review December 9, 2025 18:44
@adam-singer adam-singer merged commit 59ea0bc into main Dec 9, 2025
1 check passed
@adam-singer adam-singer deleted the adamsinger/migrate-to-module-bazel branch December 12, 2025 00:27
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.

2 participants