Fixed the manifest override and cargo checksum patches

This commit is contained in:
Alexander Hill
2025-05-07 23:50:00 -04:00
parent 8cf38995be
commit 4db1523e4a

View File

@@ -760,12 +760,6 @@ cd mrustc-*/
# FIXME: The optimize(-O) flag has been patched out of minicargo because clang # FIXME: The optimize(-O) flag has been patched out of minicargo because clang
# optimizes essential parts of code generated by mrustc. ~ahill # optimizes essential parts of code generated by mrustc. ~ahill
patch -p1 < /maple/patches/mrustc-maple.patch patch -p1 < /maple/patches/mrustc-maple.patch
# NOTE: Rust's unwind crate attempts to link with libgcc_s, even on a musl-based
# system. Enabling the "system-llvm-unwind" feature fixes this. ~ahill
echo "[add.'library/panic_unwind'.dependencies.unwind]" >> rustc-$RUST_VERSION-overrides.toml
echo "features = [\"system-llvm-libunwind\"]" >> rustc-$RUST_VERSION-overrides.toml
echo "[add.'library/std'.dependencies.unwind]" >> rustc-$RUST_VERSION-overrides.toml
echo "features = [\"system-llvm-libunwind\"]" >> rustc-$RUST_VERSION-overrides.toml
# FIXME: I have no idea how, but this script somehow invokes the now # FIXME: I have no idea how, but this script somehow invokes the now
# non-existent version of clang++ from /maple/tools. Will need to look # non-existent version of clang++ from /maple/tools. Will need to look
# into this further. CXX=clang++ exists to fix this temporarily. ~ahill # into this further. CXX=clang++ exists to fix this temporarily. ~ahill
@@ -781,6 +775,12 @@ cd rustc-*-src/
RUST_VERSION=$(pwd | sed -r "s/.*rustc-(.*)-src/\1/") RUST_VERSION=$(pwd | sed -r "s/.*rustc-(.*)-src/\1/")
patch -p0 < ../rustc-$RUST_VERSION-src.patch patch -p0 < ../rustc-$RUST_VERSION-src.patch
cd .. cd ..
# NOTE: Rust's unwind crate attempts to link with libgcc_s, even on a musl-based
# system. Enabling the "system-llvm-unwind" feature fixes this. ~ahill
echo "[add.'library/panic_unwind'.dependencies.unwind]" >> rustc-$RUST_VERSION-overrides.toml
echo "features = [\"system-llvm-libunwind\"]" >> rustc-$RUST_VERSION-overrides.toml
echo "[add.'library/std'.dependencies.unwind]" >> rustc-$RUST_VERSION-overrides.toml
echo "features = [\"system-llvm-libunwind\"]" >> rustc-$RUST_VERSION-overrides.toml
# NOTE: mrustc defaults to 1.29, which means macros such as asm! do not function # NOTE: mrustc defaults to 1.29, which means macros such as asm! do not function
# correctly unless you manually define MRUSTC_TARGET_VER. ~ahill # correctly unless you manually define MRUSTC_TARGET_VER. ~ahill
export MRUSTC_TARGET_VER=$(echo $RUST_VERSION | sed "s/\.[^.]*$//") export MRUSTC_TARGET_VER=$(echo $RUST_VERSION | sed "s/\.[^.]*$//")
@@ -845,8 +845,9 @@ rm -rf openssl-sys*
tar xf ../../../../sources/openssl-sys-*.crate tar xf ../../../../sources/openssl-sys-*.crate
# NOTE: This silences warnings from our newly-built cargo complaining about missing # NOTE: This silences warnings from our newly-built cargo complaining about missing
# checksums for a vendored crate # checksums for a vendored crate
echo "{\"files\":{}}" > openssl-sys-*/.cargo-checksum.json cd openssl-sys-*/
cd ../.. echo "{\"files\":{}}" > .cargo-checksum.json
cd ../../..
./bin/minicargo \ ./bin/minicargo \
--vendor-dir rustc-$RUST_VERSION-src/vendor \ --vendor-dir rustc-$RUST_VERSION-src/vendor \
--output-dir $(pwd)/build-cargo \ --output-dir $(pwd)/build-cargo \