Rust coverage: copy stdlib to the referenced directory (#5776)

using rustc commit-hash version
This commit is contained in:
Catena cyber 2021-05-16 23:32:33 +02:00 committed by GitHub
parent b8a24cf949
commit beee192ed3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -157,6 +157,10 @@ if [ "${BUILD_UID-0}" -ne "0" ]; then
chown -R builder $SRC $OUT $WORK
su -c "$BUILD_CMD" builder
if [ "$SANITIZER" = "coverage" ]; then
# Copy rust std lib to its path with a hash
export rustch=`rustc --version --verbose | grep commit-hash | cut -d' ' -f2`
mkdir -p /rust/rustc/$rustch/
cp -r /rust/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/ /rust/rustc/$rustch/
# Some directories have broken symlinks (e.g. honggfuzz), ignore the errors.
su -c "$COPY_SOURCES_CMD" builder 2>/dev/null || true
fi