summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCeleste <20312-Celeste@users.gitlab.alpinelinux.org>2024-08-13 00:52:21 +0000
committerCeleste <20312-Celeste@users.gitlab.alpinelinux.org>2024-09-06 06:13:08 +0000
commit1fa026816e18151796d687a8560b20e60ed34a7a (patch)
tree277da8be030039e9d12c2b9717f0fb55401a9cf1
parent157db54c2b021afa15ea139ce5061721fca8cc85 (diff)
downloadaports-1fa026816e18151796d687a8560b20e60ed34a7a.zip
main/rust: skip stage0 when bootstrapping from same version
We constrain the version of `rust-bootstrap` with `>=$_bootver`, so essentially `$_bootver` can either be the previous version (taken care by the `>` part), or the current version (`=`). Therefore, to allow for faster rebuilding, skip stage0 by setting `local-rebuild=true` whenever $_bootver is the same as $pkgver.
-rw-r--r--main/rust/APKBUILD6
1 files changed, 6 insertions, 0 deletions
diff --git a/main/rust/APKBUILD b/main/rust/APKBUILD
index 01aacd53d17..0fce5ab91b9 100644
--- a/main/rust/APKBUILD
+++ b/main/rust/APKBUILD
@@ -198,6 +198,11 @@ build() {
# Do not carry over toolchain (flags) from $CBUILD.
unset RUSTFLAGS CC CXX
fi
+ if [ "$pkgver" = "$_bootver" ]; then
+ # Skip stage0 when `rust-bootstrap` is of the
+ # same version as the Rust we are building.
+ local local_rebuild=--set="build.local-rebuild=true"
+ fi
if [ -z "$BOOTSTRAP" ]; then
# Skip LTO to allow for faster bootstrapping.
case "$CARCH" in
@@ -272,6 +277,7 @@ build() {
--set="rust.remap-debuginfo=true" \
--set="rust.description=Alpine Linux $pkgver-r$pkgrel" \
$lto \
+ $local_rebuild \
--set="target.$_target.llvm-config=/usr/lib/llvm$_llvmver/bin/llvm-config" \
--set="target.$_target.musl-root=/usr" \
--set="target.$_target.crt-static=false" \