mirror of
https://github.com/oxalica/rust-overlay.git
synced 2024-10-04 05:07:13 +03:00
Wrap cargo-miri for rust-src
This commit is contained in:
parent
80287ab66a
commit
0565a346c1
11
cargo-miri-wrapper.sh
Executable file
11
cargo-miri-wrapper.sh
Executable file
@ -0,0 +1,11 @@
|
||||
#!@bash@ -e
|
||||
src_dir="@out@/lib/rustlib/src/rust/library"
|
||||
if [[ ! -v XARGO_RUST_SRC ]]; then
|
||||
if [[ ! -d "$src_dir" ]]; then
|
||||
echo '`rust-src` is required by miri but not installed.' >&2
|
||||
echo 'Please either install component `rust-src` or set `XARGO_RUST_SRC`.' >&2
|
||||
exit 1
|
||||
fi
|
||||
export XARGO_RUST_SRC="$src_dir"
|
||||
fi
|
||||
exec -a "$0" "@miri@" "$@"
|
@ -253,6 +253,16 @@ let
|
||||
cp --remove-destination "$(realpath -e $target)" $target
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -e $out/bin/cargo-miri ]; then
|
||||
cargo_miri=$(readlink $out/bin/cargo-miri)
|
||||
cp -f ${./cargo-miri-wrapper.sh} $out/bin/cargo-miri
|
||||
chmod +w $out/bin/cargo-miri
|
||||
substituteInPlace $out/bin/cargo-miri \
|
||||
--replace "@bash@" "${self.pkgs.bash}/bin/bash" \
|
||||
--replace "@miri@" "$cargo_miri" \
|
||||
--replace "@out@" "$out"
|
||||
fi
|
||||
'';
|
||||
|
||||
# Add the compiler as part of the propagated build inputs in order
|
||||
|
Loading…
Reference in New Issue
Block a user