-
Notifications
You must be signed in to change notification settings - Fork 3
[bzlmod] Migrate to MODULE.bazel #29
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,5 @@ | ||
| # Disable deprecated starlark host transitions | ||
| common --incompatible_disable_starlark_host_transitions | ||
|
|
||
| # Enable Bzlmod for Bazel module support | ||
| common --enable_bzlmod |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| bazel-* | ||
| .ijwb | ||
| .idea/ | ||
|
|
||
| .vscode/ |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| """Bazel module for rules_minidock - Minimal Docker/OCI container image rules.""" | ||
|
|
||
| module( | ||
| name = "rules_minidock", | ||
| version = "0.1.0", | ||
| compatibility_level = 1, | ||
| ) | ||
|
|
||
| # Required dependencies | ||
| bazel_dep(name = "platforms", version = "0.0.11") | ||
|
|
||
| # Test dependencies | ||
| bazel_dep(name = "rules_python", version = "0.40.0", dev_dependency = True) | ||
|
|
||
| python = use_extension("@rules_python//python/extensions:python.bzl", "python", dev_dependency = True) | ||
| python.toolchain(python_version = "3.10") | ||
| use_repo(python, "python_versions") | ||
|
|
||
| pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip", dev_dependency = True) | ||
| pip.parse( | ||
| hub_name = "pip", | ||
| python_version = "3.10", | ||
| requirements_lock = "//tests/simple_flow:requirements_lock_3_10.txt", | ||
| ) | ||
| use_repo(pip, "pip") | ||
|
|
||
| # Test container repositories | ||
| test_repos = use_extension("//minidock/remote_tools:extensions.bzl", "test_repos", dev_dependency = True) | ||
| use_repo(test_repos, "bazel_320") | ||
|
|
||
| # Register the toolchain extension | ||
| minidock_tools = use_extension("//minidock/remote_tools:extensions.bzl", "minidock_tools") | ||
| use_repo( | ||
| minidock_tools, | ||
| "rules_minidock__merge_app_linux_x86_64", | ||
| "rules_minidock__merge_app_macos_aarch64", | ||
| "rules_minidock__merge_app_macos_x86_64", | ||
| "rules_minidock__puller_app", | ||
| "rules_minidock__pusher_app_linux_x86_64", | ||
| "rules_minidock__pusher_app_macos_aarch64", | ||
| "rules_minidock__pusher_app_macos_x86_64", | ||
| ) |
Large diffs are not rendered by default.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
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
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| """Module extension for rules_minidock tooling.""" | ||
|
|
||
| load("//minidock/remote_tools:load_tool.bzl", "load_tool") | ||
| load("//minidock/remote_tools:repo_rule_load_tool.bzl", "repo_rule_load_tool") | ||
| load("//minidock:external_container_repo.bzl", "external_container_repo") | ||
|
|
||
| def _minidock_tools_impl(module_ctx): | ||
| """Implementation of the minidock_tools module extension. | ||
|
|
||
| This extension loads all the platform-specific tools needed by rules_minidock, | ||
| including the merge and pusher applications for various platforms. | ||
| """ | ||
|
|
||
| # RUST_BINARIES_AUTO_GEN_REPLACE_SECTION_START | ||
| load_tool( | ||
| name = "rules_minidock__merge_app_linux_x86_64", | ||
| sha256 = "ec36e90e1dfd4ab486647715acb20c404ed5e1427ec51fc6bcd0fa2d471fbf6c", | ||
| packaged = False, | ||
| binary_path = "merge-app-linux-x86_64", | ||
| urls = ["https://github.com/bazeltools/rules_minidock_tools/releases/download/v0.0.75/merge-app-linux-x86_64"], | ||
| ) | ||
|
|
||
| load_tool( | ||
| name = "rules_minidock__merge_app_macos_x86_64", | ||
| sha256 = "633065d4f5199c20fe0fc9a750fc41f2b5bf0b28d4f51d5d4dab9bc3f1a56c97", | ||
| packaged = False, | ||
| binary_path = "merge-app-macos-x86_64", | ||
| urls = ["https://github.com/bazeltools/rules_minidock_tools/releases/download/v0.0.75/merge-app-macos-x86_64"], | ||
| ) | ||
|
|
||
| load_tool( | ||
| name = "rules_minidock__merge_app_macos_aarch64", | ||
| sha256 = "110d44df10c495d972533cb4db134dd1a95db7c436180655b1258e1f17c9154b", | ||
| packaged = False, | ||
| binary_path = "merge-app-macos-aarch64", | ||
| urls = ["https://github.com/bazeltools/rules_minidock_tools/releases/download/v0.0.75/merge-app-macos-aarch64"], | ||
| ) | ||
|
|
||
| load_tool( | ||
| name = "rules_minidock__pusher_app_linux_x86_64", | ||
| sha256 = "6448bb16191cb4e0f8750003c43ab158df58ecc1cd0644179e60fbf0556638c7", | ||
| packaged = False, | ||
| binary_path = "pusher-app-linux-x86_64", | ||
| urls = ["https://github.com/bazeltools/rules_minidock_tools/releases/download/v0.0.75/pusher-app-linux-x86_64"], | ||
| ) | ||
|
|
||
| load_tool( | ||
| name = "rules_minidock__pusher_app_macos_x86_64", | ||
| sha256 = "da24d3a25d46c7561bcdb21fa21c938cac20862a26d62f774f46e8b38ed68a32", | ||
| packaged = False, | ||
| binary_path = "pusher-app-macos-x86_64", | ||
| urls = ["https://github.com/bazeltools/rules_minidock_tools/releases/download/v0.0.75/pusher-app-macos-x86_64"], | ||
| ) | ||
|
|
||
| load_tool( | ||
| name = "rules_minidock__pusher_app_macos_aarch64", | ||
| sha256 = "449fbbe83f680138143ace22f02d980197ddcd8c94dbf293f448833e403e37e1", | ||
| packaged = False, | ||
| binary_path = "pusher-app-macos-aarch64", | ||
| urls = ["https://github.com/bazeltools/rules_minidock_tools/releases/download/v0.0.75/pusher-app-macos-aarch64"], | ||
| ) | ||
|
|
||
| repo_rule_load_tool( | ||
| name = "rules_minidock__puller_app", | ||
| platform_to_sha_pairs = { | ||
| "linux__x86_64": ["9a28cd949268a397e57c4faf106a942f3053438c84b70077072452d83971060a", "https://github.com/bazeltools/rules_minidock_tools/releases/download/v0.0.75/puller-app-linux-x86_64"], | ||
| "macos__x86_64": ["70bc80d0f1e098a6d2f522a4f907011f54ce15e5a8bd300ee3442a777f75eafb", "https://github.com/bazeltools/rules_minidock_tools/releases/download/v0.0.75/puller-app-macos-x86_64"], | ||
| "macos__aarch64": ["950d2192cc23ff4dd44d7dc7b942b6ec02b425a03d648924136449ff0702002d", "https://github.com/bazeltools/rules_minidock_tools/releases/download/v0.0.75/puller-app-macos-aarch64"], | ||
| }, | ||
| ) | ||
| # RUST_BINARIES_AUTO_GEN_REPLACE_SECTION_END | ||
|
|
||
| minidock_tools = module_extension( | ||
| implementation = _minidock_tools_impl, | ||
| ) | ||
|
|
||
| def _test_repos_impl(module_ctx): | ||
| """Implementation of the test_repos module extension. | ||
|
|
||
| This extension sets up external container repositories for testing. | ||
| """ | ||
| # Set up the bazel_320 container for tests | ||
| external_container_repo( | ||
| name = "bazel_320", | ||
| digest = "sha256:08434856d8196632b936dd082b8e03bae0b41346299aedf60a0d481ab427a69f", | ||
| registry = "gcr.io", | ||
| repository = "bazel-public/bazel", | ||
| ) | ||
|
|
||
| test_repos = module_extension( | ||
| implementation = _test_repos_impl, | ||
| ) |
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
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
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.