commit | 8f08e77acbde5d5dc332d7324d2c615ee5284c50 | [log] [tgz] |
---|---|---|
author | ted-logan <113641289+ted-logan@users.noreply.github.com> | Mon Dec 12 16:28:30 2022 -0800 |
committer | GitHub <noreply@github.com> | Mon Dec 12 16:28:30 2022 -0800 |
tree | 86d4e9677a87eb2c3eadd1a6bb26073c2b81076a | |
parent | 8faec306093d54df42ff917c5a674321f90cf509 [diff] |
load_arbitrary_tool uses tool_suburl to look up sha256 (#1695) * load_arbitrary_tool uses tool_suburl to look up sha256 In load_arbitrary_tool, use the suburl (which contains the a subdirectory containing the date, if the version is beta or nightly) to look up the sha256 to to download a specific archive. This allows Bazel to cache the downloaded archive by hash, and supports the correct behavior for dated nightly builds, as provided in the FILE_KEY_TO_SHA dict in //rust:known_shas.bzl. The most recent nightly entry is given in FILE_KEY_TO_SHA as: ``` "2022-11-02/cargo-nightly-x86_64-unknown-linux-gnu.tar.gz": "d32e0a9f78ece567627b9b572912b000c53099c0dd9c9f5cea54848de02c6486", ``` This change fixes downloaded archive caching when using the nightly toolchains, including the default nightly toolchain. * Refactor load_arbitrary_tool() Move the sha256 code out of load_arbitrary_tool() into a new function, lookup_tool_sha256(). Implement a new unit test to confirm that the sha256 lookup code behaves as expected, and returns the expected sha256 hash from the static list of known tool hashes.
This repository provides rules for building Rust projects with Bazel.
General discussions and announcements take place in the GitHub Discussions, but there are additional places where community members gather to discuss rules_rust
.
Please refer to the full documentation.