Copy this template to create a Bazel ruleset.
Features:
Ready to get started? Copy this repo, then
pre-commit install to get lints (see CONTRIBUTING.md)Optional: if you write tools for your rules to call, you should avoid toolchain dependencies for those tools leaking to all users. For example, https://github.com/aspect-build/rules_py actions rely on a couple of binaries written in Rust, but we don't want users to be forced to fetch a working Rust toolchain. Instead we want to ship pre-built binaries on our GH releases, and the ruleset fetches these as toolchains. See https://blog.aspect.build/releasing-bazel-rulesets-rust for information on how to do this. Note that users who do want to build tools from source should still be able to do so, they just need to register a different toolchain earlier.
From the release you wish to use:
https://github.com/myorg/rules_mylang/releases
copy the Bzlmod snippet into your MODULE.bazel file.
To use a commit rather than a release, you can point at any SHA of the repo with an archive_override in MODULE.bazel.
For example to use commit abc123:
archive_override(
module_name = "com_myorg_rules_mylang",
url = "https://github.com/myorg/rules_mylang/archive/abc123.tar.gz",
strip_prefix = "rules_mylang-abc123",
# The easiest way to set this is to commout out this line, then Bazel will print
# a message with the correct value. Note that GitHub source archives don't have a strong
# guarantee on the sha256 stability, see <https://github.blog/2023-02-21-update-on-the-future-stability-of-source-code-archives-and-hashes/>
integrity = "...",
)
Starlark
97.2%
Dockerfile
2.8%
Copy this template to create a Bazel ruleset.
Features:
Ready to get started? Copy this repo, then
pre-commit install to get lints (see CONTRIBUTING.md)Optional: if you write tools for your rules to call, you should avoid toolchain dependencies for those tools leaking to all users. For example, https://github.com/aspect-build/rules_py actions rely on a couple of binaries written in Rust, but we don't want users to be forced to fetch a working Rust toolchain. Instead we want to ship pre-built binaries on our GH releases, and the ruleset fetches these as toolchains. See https://blog.aspect.build/releasing-bazel-rulesets-rust for information on how to do this. Note that users who do want to build tools from source should still be able to do so, they just need to register a different toolchain earlier.
From the release you wish to use:
https://github.com/myorg/rules_mylang/releases
copy the Bzlmod snippet into your MODULE.bazel file.
To use a commit rather than a release, you can point at any SHA of the repo with an archive_override in MODULE.bazel.
For example to use commit abc123:
archive_override(
module_name = "com_myorg_rules_mylang",
url = "https://github.com/myorg/rules_mylang/archive/abc123.tar.gz",
strip_prefix = "rules_mylang-abc123",
# The easiest way to set this is to commout out this line, then Bazel will print
# a message with the correct value. Note that GitHub source archives don't have a strong
# guarantee on the sha256 stability, see <https://github.blog/2023-02-21-update-on-the-future-stability-of-source-code-archives-and-hashes/>
integrity = "...",
)
Starlark
97.2%
Dockerfile
2.8%