From 701897074fb61c412d0c5289b9608e86962efb98 Mon Sep 17 00:00:00 2001 From: klensy Date: Thu, 14 Nov 2024 14:07:15 +0300 Subject: [PATCH 01/12] turn creating 8dot3 names off for windows for speed --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 703f6e5281d2c..5726f1c6c44e5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -96,6 +96,10 @@ jobs: install: > make + - name: turn off windows 8dot3 names for speed(?) + if: contains(matrix.os, 'windows') + run: fsutil behavior set disable8dot3 1 + - name: disable git crlf conversion run: git config --global core.autocrlf false From a64923a824ef51c77b345cf194589194a4a17c05 Mon Sep 17 00:00:00 2001 From: klensy Date: Thu, 14 Nov 2024 19:20:49 +0300 Subject: [PATCH 02/12] Revert "turn creating 8dot3 names off for windows for speed" This reverts commit 65584f94f22fc691953e957067f77977ff1a8f65. --- .github/workflows/ci.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5726f1c6c44e5..703f6e5281d2c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -96,10 +96,6 @@ jobs: install: > make - - name: turn off windows 8dot3 names for speed(?) - if: contains(matrix.os, 'windows') - run: fsutil behavior set disable8dot3 1 - - name: disable git crlf conversion run: git config --global core.autocrlf false From 4a7836f866e7c921d3cc759f9a3ac452b820388b Mon Sep 17 00:00:00 2001 From: klensy Date: Thu, 14 Nov 2024 19:30:18 +0300 Subject: [PATCH 03/12] [skip ci] try to use D drive on windows --- .github/workflows/ci.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 703f6e5281d2c..a653609694af8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,6 +65,8 @@ jobs: defaults: run: shell: ${{ contains(matrix.os, 'windows') && 'msys2 {0}' || 'bash' }} + # linux not exist + working-directory: d:/a/rust/rust timeout-minutes: 240 env: CI_JOB_NAME: ${{ matrix.image }} @@ -80,6 +82,13 @@ jobs: # Check the `calculate_matrix` job to see how is the matrix defined. include: ${{ fromJSON(needs.calculate_matrix.outputs.jobs) }} steps: + - name: create working dir for windows runner + if: contains(matrix.os, 'windows') + shell: bash + run: | + echo ${{ github.workspace }} + mkdir -p d:/a/rust/rust + - if: contains(matrix.os, 'windows') uses: msys2/setup-msys2@v2.22.0 with: From 09acbff80aa2ecf1804326c31078a2472e793dee Mon Sep 17 00:00:00 2001 From: klensy Date: Fri, 15 Nov 2024 11:40:57 +0300 Subject: [PATCH 04/12] Revert "[skip ci] try to use D drive on windows" This reverts commit 939bd1fdc429566261db4fd07ed6e1264617dad9. --- .github/workflows/ci.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a653609694af8..703f6e5281d2c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,8 +65,6 @@ jobs: defaults: run: shell: ${{ contains(matrix.os, 'windows') && 'msys2 {0}' || 'bash' }} - # linux not exist - working-directory: d:/a/rust/rust timeout-minutes: 240 env: CI_JOB_NAME: ${{ matrix.image }} @@ -82,13 +80,6 @@ jobs: # Check the `calculate_matrix` job to see how is the matrix defined. include: ${{ fromJSON(needs.calculate_matrix.outputs.jobs) }} steps: - - name: create working dir for windows runner - if: contains(matrix.os, 'windows') - shell: bash - run: | - echo ${{ github.workspace }} - mkdir -p d:/a/rust/rust - - if: contains(matrix.os, 'windows') uses: msys2/setup-msys2@v2.22.0 with: From 88e77871d607d19a4c94ca53dc49d5658c2ca9e1 Mon Sep 17 00:00:00 2001 From: klensy Date: Fri, 15 Nov 2024 12:04:38 +0300 Subject: [PATCH 05/12] [skip ci] bump sccache for linux x86_64 --- src/ci/docker/scripts/sccache.sh | 6 ++++-- src/ci/run.sh | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ci/docker/scripts/sccache.sh b/src/ci/docker/scripts/sccache.sh index 6c713e1f8611f..a16ae85305b46 100644 --- a/src/ci/docker/scripts/sccache.sh +++ b/src/ci/docker/scripts/sccache.sh @@ -6,7 +6,7 @@ set -ex case "$(uname -m)" in x86_64) - url="https://ci-mirrors.rust-lang.org/rustc/2021-08-24-sccache-v0.2.15-x86_64-unknown-linux-musl" + url="https://github.com/mozilla/sccache/releases/download/v0.3.3/sccache-v0.3.3-x86_64-unknown-linux-musl.tar.gz" ;; aarch64) url="https://ci-mirrors.rust-lang.org/rustc/2021-08-25-sccache-v0.2.15-aarch64-unknown-linux-musl" @@ -16,5 +16,7 @@ case "$(uname -m)" in exit 1 esac -curl -fo /usr/local/bin/sccache "${url}" +curl -fLo sccache.tar.gz "${url}" +tar zxvf sccache.tar.gz --wildcards --no-anchored 'sccache' --strip-components=1 +cp sccache /usr/local/bin/sccache chmod +x /usr/local/bin/sccache diff --git a/src/ci/run.sh b/src/ci/run.sh index 5690d8edea6a2..ec899ca6a3482 100755 --- a/src/ci/run.sh +++ b/src/ci/run.sh @@ -279,5 +279,6 @@ if [ "$RUN_CHECK_WITH_PARALLEL_QUERIES" != "" ]; then fi echo "::group::sccache stats" +sccache --version || true sccache --show-stats || true echo "::endgroup::" From fa6fa5e9f2c1b2e18c99650bb6cb7c9ef0e4f65f Mon Sep 17 00:00:00 2001 From: klensy Date: Fri, 15 Nov 2024 17:05:45 +0300 Subject: [PATCH 06/12] sccache 0.3.1 for aarch64 linux --- src/ci/docker/scripts/sccache.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ci/docker/scripts/sccache.sh b/src/ci/docker/scripts/sccache.sh index a16ae85305b46..b7ef24cf9773f 100644 --- a/src/ci/docker/scripts/sccache.sh +++ b/src/ci/docker/scripts/sccache.sh @@ -9,7 +9,8 @@ case "$(uname -m)" in url="https://github.com/mozilla/sccache/releases/download/v0.3.3/sccache-v0.3.3-x86_64-unknown-linux-musl.tar.gz" ;; aarch64) - url="https://ci-mirrors.rust-lang.org/rustc/2021-08-25-sccache-v0.2.15-aarch64-unknown-linux-musl" + # no aarch64 release for 0.3.3, so use this + url="https://github.com/mozilla/sccache/releases/download/v0.3.1/sccache-v0.3.1-aarch64-unknown-linux-musl.tar.gz" ;; *) echo "unsupported architecture: $(uname -m)" From b106ac92ba3731d24767088d5746b41bf43c0391 Mon Sep 17 00:00:00 2001 From: klensy Date: Fri, 15 Nov 2024 22:03:07 +0300 Subject: [PATCH 07/12] Revert "sccache 0.3.1 for aarch64 linux" This reverts commit fa6fa5e9f2c1b2e18c99650bb6cb7c9ef0e4f65f. --- src/ci/docker/scripts/sccache.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ci/docker/scripts/sccache.sh b/src/ci/docker/scripts/sccache.sh index b7ef24cf9773f..a16ae85305b46 100644 --- a/src/ci/docker/scripts/sccache.sh +++ b/src/ci/docker/scripts/sccache.sh @@ -9,8 +9,7 @@ case "$(uname -m)" in url="https://github.com/mozilla/sccache/releases/download/v0.3.3/sccache-v0.3.3-x86_64-unknown-linux-musl.tar.gz" ;; aarch64) - # no aarch64 release for 0.3.3, so use this - url="https://github.com/mozilla/sccache/releases/download/v0.3.1/sccache-v0.3.1-aarch64-unknown-linux-musl.tar.gz" + url="https://ci-mirrors.rust-lang.org/rustc/2021-08-25-sccache-v0.2.15-aarch64-unknown-linux-musl" ;; *) echo "unsupported architecture: $(uname -m)" From 2d79d415604a7c9a758f0551909237a67324fe8c Mon Sep 17 00:00:00 2001 From: klensy Date: Fri, 15 Nov 2024 22:09:08 +0300 Subject: [PATCH 08/12] Revert "[skip ci] bump sccache for linux x86_64" This reverts commit 88e77871d607d19a4c94ca53dc49d5658c2ca9e1. --- src/ci/docker/scripts/sccache.sh | 6 ++---- src/ci/run.sh | 1 - 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/ci/docker/scripts/sccache.sh b/src/ci/docker/scripts/sccache.sh index a16ae85305b46..6c713e1f8611f 100644 --- a/src/ci/docker/scripts/sccache.sh +++ b/src/ci/docker/scripts/sccache.sh @@ -6,7 +6,7 @@ set -ex case "$(uname -m)" in x86_64) - url="https://github.com/mozilla/sccache/releases/download/v0.3.3/sccache-v0.3.3-x86_64-unknown-linux-musl.tar.gz" + url="https://ci-mirrors.rust-lang.org/rustc/2021-08-24-sccache-v0.2.15-x86_64-unknown-linux-musl" ;; aarch64) url="https://ci-mirrors.rust-lang.org/rustc/2021-08-25-sccache-v0.2.15-aarch64-unknown-linux-musl" @@ -16,7 +16,5 @@ case "$(uname -m)" in exit 1 esac -curl -fLo sccache.tar.gz "${url}" -tar zxvf sccache.tar.gz --wildcards --no-anchored 'sccache' --strip-components=1 -cp sccache /usr/local/bin/sccache +curl -fo /usr/local/bin/sccache "${url}" chmod +x /usr/local/bin/sccache diff --git a/src/ci/run.sh b/src/ci/run.sh index ec899ca6a3482..5690d8edea6a2 100755 --- a/src/ci/run.sh +++ b/src/ci/run.sh @@ -279,6 +279,5 @@ if [ "$RUN_CHECK_WITH_PARALLEL_QUERIES" != "" ]; then fi echo "::group::sccache stats" -sccache --version || true sccache --show-stats || true echo "::endgroup::" From d7db01dd791c224e84e4d55b80744fc40f278836 Mon Sep 17 00:00:00 2001 From: klensy Date: Fri, 15 Nov 2024 22:05:16 +0300 Subject: [PATCH 09/12] [skip ci] bump sccache for win --- src/ci/run.sh | 1 + src/ci/scripts/install-sccache.sh | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ci/run.sh b/src/ci/run.sh index 5690d8edea6a2..ec899ca6a3482 100755 --- a/src/ci/run.sh +++ b/src/ci/run.sh @@ -279,5 +279,6 @@ if [ "$RUN_CHECK_WITH_PARALLEL_QUERIES" != "" ]; then fi echo "::group::sccache stats" +sccache --version || true sccache --show-stats || true echo "::endgroup::" diff --git a/src/ci/scripts/install-sccache.sh b/src/ci/scripts/install-sccache.sh index e143152f330cf..4d4b82621daff 100755 --- a/src/ci/scripts/install-sccache.sh +++ b/src/ci/scripts/install-sccache.sh @@ -12,7 +12,9 @@ if isMacOS; then chmod +x /usr/local/bin/sccache elif isWindows; then mkdir -p sccache - curl -fo sccache/sccache.exe "${MIRRORS_BASE}/2018-04-26-sccache-x86_64-pc-windows-msvc" + curl -fLo sccache.tar.gz "https://github.com/mozilla/sccache/releases/download/v0.3.3/sccache-v0.3.3-x86_64-pc-windows-msvc.tar.gz" + tar zxvf sccache.tar.gz --wildcards --no-anchored 'sccache.exe' --strip-components=1 + mv sccache.exe sccache ciCommandAddPath "$(pwd)/sccache" fi From d404da04f1e7a5f59099519bcc379885815025e0 Mon Sep 17 00:00:00 2001 From: klensy Date: Sat, 16 Nov 2024 11:31:34 +0300 Subject: [PATCH 10/12] [skip ci] wix: allow to skip more components --- src/bootstrap/src/core/build_steps/dist.rs | 32 ++++++++- src/etc/installer/msi/rust.wxs | 80 +++++++++++++--------- 2 files changed, 78 insertions(+), 34 deletions(-) diff --git a/src/bootstrap/src/core/build_steps/dist.rs b/src/bootstrap/src/core/build_steps/dist.rs index c022285211fab..968d9befed0b3 100644 --- a/src/bootstrap/src/core/build_steps/dist.rs +++ b/src/bootstrap/src/core/build_steps/dist.rs @@ -1870,7 +1870,7 @@ impl Step for Extended { .arg("-out") .arg(&output) .arg(input); - add_env(builder, &mut cmd, target); + add_env(builder, &mut cmd, target, &built_tools); if built_tools.contains("clippy") { cmd.arg("-dClippyDir=clippy"); @@ -1974,7 +1974,14 @@ impl Step for Extended { } } -fn add_env(builder: &Builder<'_>, cmd: &mut BootstrapCommand, target: TargetSelection) { +fn add_env( + builder: &Builder<'_>, + cmd: &mut BootstrapCommand, + target: TargetSelection, + built_tools: &HashSet<&'static str>, +) { + // envs for wix should be always defined, even if not used + // FIXME: is they affect ccache? let mut parts = builder.version.split('.'); cmd.env("CFG_RELEASE_INFO", builder.rust_version()) .env("CFG_RELEASE_NUM", &builder.version) @@ -1995,6 +2002,27 @@ fn add_env(builder: &Builder<'_>, cmd: &mut BootstrapCommand, target: TargetSele } else { cmd.env("CFG_MINGW", "0").env("CFG_ABI", "MSVC"); } + + if built_tools.contains("rustfmt") { + cmd.env("CFG_RUSTFMT", "1"); + } else { + cmd.env("CFG_RUSTFMT", "0"); + } + if built_tools.contains("clippy") { + cmd.env("CFG_CLIPPY", "1"); + } else { + cmd.env("CFG_CLIPPY", "0"); + } + if built_tools.contains("miri") { + cmd.env("CFG_MIRI", "1"); + } else { + cmd.env("CFG_MIRI", "0"); + } + if built_tools.contains("rust-analyzer") { + cmd.env("CFG_RA", "1"); + } else { + cmd.env("CFG_RA", "0"); + } } fn install_llvm_file( diff --git a/src/etc/installer/msi/rust.wxs b/src/etc/installer/msi/rust.wxs index 2d155bf0b1019..64cceccc97582 100644 --- a/src/etc/installer/msi/rust.wxs +++ b/src/etc/installer/msi/rust.wxs @@ -172,11 +172,19 @@ - - - + + + + + + + + + - + + + @@ -284,34 +292,42 @@ - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + Date: Sun, 17 Nov 2024 14:03:26 +0300 Subject: [PATCH 11/12] [skip ci] bump sccache to 0.4.2 --- src/ci/scripts/install-sccache.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ci/scripts/install-sccache.sh b/src/ci/scripts/install-sccache.sh index 4d4b82621daff..66963897b5a65 100755 --- a/src/ci/scripts/install-sccache.sh +++ b/src/ci/scripts/install-sccache.sh @@ -12,7 +12,7 @@ if isMacOS; then chmod +x /usr/local/bin/sccache elif isWindows; then mkdir -p sccache - curl -fLo sccache.tar.gz "https://github.com/mozilla/sccache/releases/download/v0.3.3/sccache-v0.3.3-x86_64-pc-windows-msvc.tar.gz" + curl -fLo sccache.tar.gz "https://github.com/mozilla/sccache/releases/download/v0.4.2/sccache-v0.4.2-x86_64-pc-windows-msvc.tar.gz" tar zxvf sccache.tar.gz --wildcards --no-anchored 'sccache.exe' --strip-components=1 mv sccache.exe sccache ciCommandAddPath "$(pwd)/sccache" From 6eecb1e5a1df51aabd98358c317c74c0a65ae3d5 Mon Sep 17 00:00:00 2001 From: klensy Date: Sun, 17 Nov 2024 23:15:56 +0300 Subject: [PATCH 12/12] [skip ci] bump sccache to 0.7.7 --- src/ci/scripts/install-sccache.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ci/scripts/install-sccache.sh b/src/ci/scripts/install-sccache.sh index 66963897b5a65..a507dddb51033 100755 --- a/src/ci/scripts/install-sccache.sh +++ b/src/ci/scripts/install-sccache.sh @@ -12,7 +12,7 @@ if isMacOS; then chmod +x /usr/local/bin/sccache elif isWindows; then mkdir -p sccache - curl -fLo sccache.tar.gz "https://github.com/mozilla/sccache/releases/download/v0.4.2/sccache-v0.4.2-x86_64-pc-windows-msvc.tar.gz" + curl -fLo sccache.tar.gz "https://github.com/mozilla/sccache/releases/download/v0.7.7/sccache-v0.7.7-x86_64-pc-windows-msvc.tar.gz" tar zxvf sccache.tar.gz --wildcards --no-anchored 'sccache.exe' --strip-components=1 mv sccache.exe sccache ciCommandAddPath "$(pwd)/sccache"