### mise.lock TOML format example Source: https://github.com/amartani/rules_mise/blob/main/docs/architecture.md Example of the mise.lock file format, showing a tool entry with version, backend, and platform-specific URL and checksum. The file is @generated; bump versions in mise.toml instead of hand-editing. ```toml [[tools.ruff]] version = "0.16.7" backend = "aqua:astral-sh/ruff" [tools.ruff."platforms.linux-x64"] url = "https://github.com/astral-sh/ruff/releases/download/0.16.7/ruff-x86_64-unknown-linux-musl.tar.gz" checksum = "sha256:8d28939cf5cabe54a2f8f7cbfab52c643436d1bc70474198181db9e48f504411" ``` -------------------------------- ### Set up hk with mise for formatting Source: https://github.com/amartani/rules_mise/blob/main/CONTRIBUTING.md Install mise and set up hk to automate buildifier formatting for Starlark files. Run these commands in the repository root. ```shell mise install hk install --mise ``` -------------------------------- ### Tag and push a release candidate Source: https://github.com/amartani/rules_mise/blob/main/CONTRIBUTING.md Manually trigger a release by tagging and pushing a tag. The example uses v1.0.0-rc0 for a release candidate. ```sh % git fetch % git tag v1.0.0-rc0 origin/main % git push origin v1.0.0-rc0 ``` -------------------------------- ### Pin rules_mise to a specific commit with archive_override Source: https://github.com/amartani/rules_mise/blob/main/README.md Overrides the module to use a specific commit SHA from GitHub. The integrity value must be set; comment out the line and run Bazel to get the correct value. Note that GitHub source archives may not have stable hashes. ```starlark archive_override( module_name = "rules_mise", url = "https://github.com/rules_mise/rules_mise/archive/abc123.tar.gz", strip_prefix = "rules_mise-abc123", # The easiest way to set this is to comment 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 integrity = "...", ) ``` -------------------------------- ### Bazel build and test commands Source: https://github.com/amartani/rules_mise/blob/main/AGENTS.md Commands to build and test the root workspace and separate e2e workspaces. CI also runs with Bazel 8.x and 9.x via USE_BAZEL_VERSION. ```bash bazel build //... # root workspace bazel test //... # root workspace (CI also runs with Bazel 8.x and 9.x via USE_BAZEL_VERSION) # e2e/* are SEPARATE Bazel workspaces (excluded via .bazelignore) — cd in first: cd e2e/smoke && bazel test //... cd e2e/backends && bazel test //... cd e2e/conda && bazel test //... cd e2e/itest && bazel test //... bazel run //:gazelle # regenerate bzl_library deps after touching .bzl load stmts bazel mod tidy --lockfile_mode=refresh # only way to update MODULE.bazel.lock (.bazelrc sets --lockfile_mode=error) mise install && hk install --mise # one-time lint setup (CONTRIBUTING.md) mise exec -- hk check --all # what CI's hk job runs (buildifier, prettier, taplo, yamlfmt, typos) ``` -------------------------------- ### Use local rules_mise via local_path_override Source: https://github.com/amartani/rules_mise/blob/main/CONTRIBUTING.md Add this to your MODULE.bazel file to use the local rules_mise directory instead of a release artifact. Replace path/to/rules_mise with the actual path. ```starlark local_path_override( module_name = "rules_mise", path = "path/to/rules_mise", ) ``` -------------------------------- ### Module extension usage with mise.hub Source: https://github.com/amartani/rules_mise/blob/main/docs/architecture.md Shows how to use the rules_mise module extension in a MODULE.bazel file. It declares a hub with a mandatory lockfile label and registers the toolchains from the generated repository. ```python mise = use_extension("@rules_mise//mise:extensions.bzl", "mise") mise.hub(lockfile = "//:mise.lock") use_repo(mise, "mise") register_toolchains("@mise//toolchains:all") ``` -------------------------------- ### Run the itest e2e test with bazel Source: https://github.com/amartani/rules_mise/blob/main/e2e/itest/README.md Run the end-to-end test from the e2e/itest directory. This command executes the test target that brings up both services and runs the client test. ```bash cd e2e/itest && bazel test //:test_psql ``` -------------------------------- ### Depend on tools via toolchain-resolved targets Source: https://github.com/amartani/rules_mise/blob/main/README.md Lists the target patterns for accessing tools through the toolchain, including platform-specific, current-directory, workspace-root, and conda wrappers. Use these targets in BUILD files or command lines. ```text @mise//tools/ruff:tool -> ruff for the current platform @mise//tools/ruff:cwd -> wrapper running ruff from the current directory @mise//tools/ruff:workspace_root -> wrapper running ruff from $BUILD_WORKSPACE_DIRECTORY @mise//tools/conda_postgresql:tool -> conda wrapper dispatching to the prefix's bin/ via the first argument (e.g. `tool psql --version`) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.