summaryrefslogtreecommitdiffstats
path: root/vendor/mdbook/ci
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:58 +0000
commita4b7ed7a42c716ab9f05e351f003d589124fd55d (patch)
treeb620cd3f223850b28716e474e80c58059dca5dd4 /vendor/mdbook/ci
parentAdding upstream version 1.67.1+dfsg1. (diff)
downloadrustc-a4b7ed7a42c716ab9f05e351f003d589124fd55d.tar.xz
rustc-a4b7ed7a42c716ab9f05e351f003d589124fd55d.zip
Adding upstream version 1.68.2+dfsg1.upstream/1.68.2+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/mdbook/ci')
-rwxr-xr-xvendor/mdbook/ci/install-rust.sh11
-rwxr-xr-xvendor/mdbook/ci/make-release.sh15
2 files changed, 21 insertions, 5 deletions
diff --git a/vendor/mdbook/ci/install-rust.sh b/vendor/mdbook/ci/install-rust.sh
index c608c70d0..d97e45a08 100755
--- a/vendor/mdbook/ci/install-rust.sh
+++ b/vendor/mdbook/ci/install-rust.sh
@@ -13,6 +13,17 @@ TOOLCHAIN="$1"
rustup set profile minimal
rustup component remove --toolchain=$TOOLCHAIN rust-docs || echo "already removed"
rustup update --no-self-update $TOOLCHAIN
+if [ -n "$2" ]
+then
+ TARGET="$2"
+ HOST=$(rustc -Vv | grep ^host: | sed -e "s/host: //g")
+ if [ "$HOST" != "$TARGET" ]
+ then
+ rustup component add llvm-tools-preview --toolchain=$TOOLCHAIN
+ rustup component add rust-std-$TARGET --toolchain=$TOOLCHAIN
+ fi
+fi
+
rustup default $TOOLCHAIN
rustup -V
rustc -Vv
diff --git a/vendor/mdbook/ci/make-release.sh b/vendor/mdbook/ci/make-release.sh
index 761923bf9..8a62b700b 100755
--- a/vendor/mdbook/ci/make-release.sh
+++ b/vendor/mdbook/ci/make-release.sh
@@ -11,16 +11,21 @@ fi
TAG=${GITHUB_REF#*/tags/}
host=$(rustc -Vv | grep ^host: | sed -e "s/host: //g")
+target=$2
+if [ "$host" != "$target" ]
+then
+ export "CARGO_TARGET_$(echo $target | tr a-z- A-Z_)_LINKER"=rust-lld
+fi
export CARGO_PROFILE_RELEASE_LTO=true
-cargo build --bin mdbook --release
-cd target/release
+cargo build --bin mdbook --release --target $target
+cd target/$target/release
case $1 in
ubuntu*)
- asset="mdbook-$TAG-$host.tar.gz"
+ asset="mdbook-$TAG-$target.tar.gz"
tar czf ../../$asset mdbook
;;
macos*)
- asset="mdbook-$TAG-$host.tar.gz"
+ asset="mdbook-$TAG-$target.tar.gz"
# There is a bug with BSD tar on macOS where the first 8MB of the file are
# sometimes all NUL bytes. See https://github.com/actions/cache/issues/403
# and https://github.com/rust-lang/cargo/issues/8603 for some more
@@ -30,7 +35,7 @@ case $1 in
tar czf ../../$asset mdbook
;;
windows*)
- asset="mdbook-$TAG-$host.zip"
+ asset="mdbook-$TAG-$target.zip"
7z a ../../$asset mdbook.exe
;;
*)