Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make bazel lock file cross-platform (#2453)
Since the host tools are os and arch specific, previously bazel would cache the resolution of these in the lock file, causing the repo for the wrong OS or arch to be used when moving between machines. Since bazel 7.1.0, module extensions can be marked as reproducible to exclude these from the lock file. However, the `rust` module extension handles fetching of all the other toolchains as well as the host tools, and we don't really want to exclude those too. Therefore the host tools are moved to their own module extension. This means we can no longer match the host toolchain's version, edition, etc with the toolchain registered via `rust.toolchain` by default, and instead default to a fixed version. This can still be overridden separately in the root module. I think this is okay, because the host tools are only used for bootstrapping and I don't think there's much need to have them match. This is tested by now checking in the MODULE.bazel.lock file of the bzlmod example, and running the bzlmod examples on multiple platforms with `--lockfile_mode` set to `error`. Resolves #2452 Resolves #2549
- Loading branch information