Add support for self-contained object files (musl).#829
Merged
UebelAndre merged 4 commits intobazelbuild:mainfrom Jul 30, 2021
Merged
Add support for self-contained object files (musl).#829UebelAndre merged 4 commits intobazelbuild:mainfrom
self-contained object files (musl).#829UebelAndre merged 4 commits intobazelbuild:mainfrom
Conversation
self-contained files.self-contained object files.
Collaborator
Author
|
I also wrote this script to find what artifacts contained the #!/bin/bash
set -euo pipefail
MUSL=(
rust-std-1.26.0-aarch64-unknown-linux-musl
rust-std-1.26.0-x86_64-unknown-linux-musl
rust-std-1.36.0-aarch64-unknown-linux-musl
rust-std-1.36.0-aarch64-unknown-linux-musl
rust-std-1.45.0-aarch64-unknown-linux-musl
rust-std-1.45.0-x86_64-unknown-linux-musl
rust-std-1.46.0-aarch64-unknown-linux-musl
rust-std-1.46.0-x86_64-unknown-linux-musl
rust-std-1.53.0-aarch64-unknown-linux-musl
)
OTHER=(
rust-std-1.45.0-x86_64-apple-darwin
rust-std-1.45.0-wasm32-unknown-unknown
rust-std-1.45.0-x86_64-pc-windows-msvc
rust-std-1.46.0-x86_64-apple-darwin
rust-std-1.46.0-wasm32-unknown-unknown
rust-std-1.46.0-x86_64-pc-windows-msvc
)
function find_self_contained() {
temp_dir="$(mktemp -d -t rust-self-contained)"
pushd "${temp_dir}"
for art in ${@}; do
echo "${art}"
wget --quiet https://static.rust-lang.org/dist/${art}.tar.gz
tar -xf "${art}.tar.gz"
find "${art}" -name "self-contained" -exec tree {} \;
done
popd && rm -rf "${temp_dir}"
}
echo "Test MUSL"
find_self_contained ${MUSL[@]}
echo "Test OTHER"
find_self_contained ${OTHER[@]} |
Collaborator
Author
|
Also, I'm not sure how to add a test for |
db51b64 to
e3c8e49
Compare
self-contained object files.self-contained object files (musl).
Collaborator
illicitonion
left a comment
There was a problem hiding this comment.
I don't feel like I have enough context to really review this (or indeed to suggest how to test it on CI), but in general the change looks reasonable? If anyone has more context, it'd be great for them to review, otherwise I can somewhat unknowingly approve...
hlopko
reviewed
Jul 15, 2021
Member
|
Is there a way we could have a test? |
Collaborator
Author
I had the same question (#829 (comment)) and opened bazelbuild/continuous-integration#1190 to try and answer it. Any suggestions? |
hlopko
approved these changes
Jul 30, 2021
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In newer
rust-stdartifacts there is aself-containeddirectory which contains some.ofiles. These are currently ignored but without them the rules cannot targetmusland users will see a similar linker error:These files appear to have been introduced in Rust
1.46.0. They seem related to rust-lang/rust#70740 but I'm still not clear what mechanism actually generates and installs these directories in the artifacts.Regardless, this change addresses these linker issues without impacting other target triples as far as I can tell.