Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bazel] add shas for remaing deps for airgapped builds #12534

Merged

Conversation

timothytrippel
Copy link
Contributor

This add sha256 hashes for the only remaining dependencies in our bazel workspace without them to ensure: 1) hermetic builds, and 2) support caching external bazel repo dependencies in the repository cache, which in turn supports airgapped bazel builds.

These dependencies include the com_google_absl and safe-fdti rust crate external repositories.

This fixes #11792.

Note: this depends on #12526 and #12533. Only review the last commit.

third_party/rust/crates/crates.bzl Outdated Show resolved Hide resolved
third_party/rust/repos.bzl Show resolved Hide resolved
@timothytrippel timothytrippel force-pushed the add-remaining-bazel-shas branch 2 times, most recently from 30de62c to 146490e Compare May 9, 2022 17:23
Comment on lines +1144 to 1155
# TODO(lowRISC/opentitan:#12469): this was manually converted to an
# http_archive rule. Need to figure out how to update the Cargo.toml file so
# `cargo raze` will generate a (cacheable) http_archive rule to support
# air-gapped builds.
maybe(
new_git_repository,
http_archive,
name = "raze__safe_ftdi__0_3_0",
remote = "https://github.com/cr1901/safe-ftdi",
commit = "2e6ff2b77cee8c0d7c04dcdb0dea678edbd8d56f",
url = "https://github.com/cr1901/safe-ftdi/archive/2e6ff2b77cee8c0d7c04dcdb0dea678edbd8d56f.tar.gz",
sha256 = "bdc434ac8e1b379d434eec54f0aab7d272101630876bd760730f9dd0599e806c",
strip_prefix = "safe-ftdi-2e6ff2b77cee8c0d7c04dcdb0dea678edbd8d56f",
build_file = Label("//third_party/rust/crates/remote:BUILD.safe-ftdi-0.3.0.bazel"),
init_submodules = True,
)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cfrantz, this was done primarily because this Rust crate was listed using a git URL. Is there another way to reference this repository in the Cargo.toml file such that cargo raze will produce an http_archive rule instead of a git_repository rule? i.e., is there way to reference a URL to a tarball for a Rust crate dep?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mcy @jrvanwhy any thoughts on this?

This add sha256 hashes for the only remaining dependencies in our bazel
workspace without them to ensure: 1) hermetic builds, and 2) support
caching external bazel repo dependencies in the repository cache, which
in turn supports airgapped bazel builds.

These dependencies include the `com_google_absl` and `safe-fdti` rust
crate external repositories.

This fixes lowRISC#11792.

Signed-off-by: Timothy Trippel <[email protected]>
@timothytrippel
Copy link
Contributor Author

PR dependency removed. Read for merge, when CI passes.

@timothytrippel timothytrippel merged commit 25be343 into lowRISC:master May 10, 2022
@timothytrippel timothytrippel deleted the add-remaining-bazel-shas branch May 10, 2022 05:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bazel] Check sha256s for all external repositories
3 participants