forked from bazelbuild/rules_rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
load_arbitrary_tool uses tool_suburl to look up sha256 (bazelbuild#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.
- Loading branch information
Showing
2 changed files
with
103 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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 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