You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The rust_rules attempt to download the rust_linux_x86_64 external repository using the ctx.download action. Unfortunately, it seems this action does not first check in the repository cache for files before downloading, where as the ctx.download_and_extract action does. This is vaguely hinted at in the bazel repository rules documentation. Specifically, the description for the sha256 parameter of the download action only states: "the expected SHA-256 hash of the file downloaded. This must match the SHA-256 hash of the file downloaded ..."; while the the description for the sha256 parameter of the download_and_extract action additionally states: "... If provided, the repository cache will first be checked for a file with the given hash; a download will only be attempted if the file was not found in the cache. After a successful download, the file will be added to the cache."
Moreover, after testing out a patch of the rules_rust repository that replaces the ctx.download action with the ctx.download_and_extract action the rust_linux_x86_64 repository files are then found in the pre-populated repository cache (prepared with the prep-bazel-airgapped-builds.sh script), instead of downloaded from the network.
To fix this issue and support airgapped SW builds, the following item must be addressed:
fork and patch the rules_rust repo (see this commit)
As described in lowRISC#12515, the upstream `rules_rust` repository attempted
to download several dependencies in a manner that did not first check
the repository cache before going to the network. This made supporting
an airgapped build environment problematic. To fix this issue, the
`rules_rust` repository was forked and patched. Please follow this link
for the commit message that describes the patch in detail:
lowRISC/rules_rust@be0d6ca
This commit update the bazel dependencies to use our patched
`rust_rules` instead of the upstream ones. Additionally, this commit
updates the `prep-bazel-airgapped-builds.sh` script to pre-fetch
additional dependencies to pre-populate the bazel repository cache with
additional required dependencies to support airgapped builds.
This fixeslowRISC#12515.
Signed-off-by: Timothy Trippel <[email protected]>
As described in #12515, the upstream `rules_rust` repository attempted
to download several dependencies in a manner that did not first check
the repository cache before going to the network. This made supporting
an airgapped build environment problematic. To fix this issue, the
`rules_rust` repository was forked and patched. Please follow this link
for the commit message that describes the patch in detail:
lowRISC/rules_rust@be0d6ca
This commit update the bazel dependencies to use our patched
`rust_rules` instead of the upstream ones. Additionally, this commit
updates the `prep-bazel-airgapped-builds.sh` script to pre-fetch
additional dependencies to pre-populate the bazel repository cache with
additional required dependencies to support airgapped builds.
This fixes#12515.
Signed-off-by: Timothy Trippel <[email protected]>
The
rust_rules
attempt to download therust_linux_x86_64
external repository using thectx.download
action. Unfortunately, it seems this action does not first check in the repository cache for files before downloading, where as thectx.download_and_extract
action does. This is vaguely hinted at in the bazel repository rules documentation. Specifically, the description for thesha256
parameter of thedownload
action only states: "the expected SHA-256 hash of the file downloaded. This must match the SHA-256 hash of the file downloaded ..."; while the the description for thesha256
parameter of thedownload_and_extract
action additionally states: "... If provided, the repository cache will first be checked for a file with the given hash; a download will only be attempted if the file was not found in the cache. After a successful download, the file will be added to the cache."Moreover, after testing out a patch of the
rules_rust
repository that replaces thectx.download
action with thectx.download_and_extract
action therust_linux_x86_64
repository files are then found in the pre-populated repository cache (prepared with theprep-bazel-airgapped-builds.sh
script), instead of downloaded from the network.To fix this issue and support airgapped SW builds, the following item must be addressed:
rules_rust
repo (see this commit)Addressed in: #12526
rules_rust
repo in the opentitan bazel workspaceprep-bazel-airgapped-builds.sh
to prefetch and cache therust_linux_x86_64
external repositoryThe text was updated successfully, but these errors were encountered: