From 0c5864f9064b7280972628c64cd83647127ddfb9 Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Thu, 18 Jul 2024 14:50:49 +0300 Subject: [PATCH 1/3] check default config profiles on CI Signed-off-by: onur-ozkan --- src/ci/docker/host-x86_64/mingw-check/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ci/docker/host-x86_64/mingw-check/Dockerfile b/src/ci/docker/host-x86_64/mingw-check/Dockerfile index 0d9c21c4487bf..c8d505406ff01 100644 --- a/src/ci/docker/host-x86_64/mingw-check/Dockerfile +++ b/src/ci/docker/host-x86_64/mingw-check/Dockerfile @@ -46,6 +46,8 @@ ENV RUN_CHECK_WITH_PARALLEL_QUERIES 1 # We disable optimized compiler built-ins because that requires a C toolchain for the target. # We also skip the x86_64-unknown-linux-gnu target as it is well-tested by other jobs. ENV SCRIPT python3 ../x.py check --stage 0 --set build.optimized-compiler-builtins=false core alloc std --target=aarch64-unknown-linux-gnu,i686-pc-windows-msvc,i686-unknown-linux-gnu,x86_64-apple-darwin,x86_64-pc-windows-gnu,x86_64-pc-windows-msvc && \ + # Ensure that default config profiles are not broken + for config_file in ../src/bootstrap/defaults/*.toml; do python3 ../x.py build --dry-run --config "$config_file"; done python3 ../x.py check --target=i686-pc-windows-gnu --host=i686-pc-windows-gnu && \ python3 ../x.py clippy bootstrap -Dwarnings && \ python3 ../x.py clippy compiler library -Aclippy::all -Dclippy::correctness && \ From 6310da9ab9bbe61ae72232d93f2d518dd1be986d Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Thu, 18 Jul 2024 15:13:08 +0300 Subject: [PATCH 2/3] remove `debug-logging` default from tools profile `debug-logging` conflicts with `download-rustc` option, and doesn't really make sense to enable it for a profile that is used for tool development. Signed-off-by: onur-ozkan --- src/bootstrap/defaults/config.tools.toml | 4 ---- src/bootstrap/src/utils/change_tracker.rs | 5 +++++ src/ci/docker/host-x86_64/mingw-check/Dockerfile | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/bootstrap/defaults/config.tools.toml b/src/bootstrap/defaults/config.tools.toml index 6e6c366002792..75ad37ce33549 100644 --- a/src/bootstrap/defaults/config.tools.toml +++ b/src/bootstrap/defaults/config.tools.toml @@ -1,10 +1,6 @@ # These defaults are meant for contributors to tools which build on the # compiler, but do not modify it directly. [rust] -# This enables `RUSTC_LOG=debug`, avoiding confusing situations -# where adding `debug!()` appears to do nothing. -# However, it makes running the compiler slightly slower. -debug-logging = true # This greatly increases the speed of rebuilds, especially when there are only minor changes. However, it makes the initial build slightly slower. incremental = true # Download rustc from CI instead of building it from source. diff --git a/src/bootstrap/src/utils/change_tracker.rs b/src/bootstrap/src/utils/change_tracker.rs index ccab25e55a9c3..6a7c5c0f9b779 100644 --- a/src/bootstrap/src/utils/change_tracker.rs +++ b/src/bootstrap/src/utils/change_tracker.rs @@ -200,4 +200,9 @@ pub const CONFIG_CHANGE_HISTORY: &[ChangeInfo] = &[ severity: ChangeSeverity::Warning, summary: "`llvm.lld` is enabled by default for the dist profile. If set to false, `lld` will not be included in the dist build.", }, + ChangeInfo { + change_id: 127913, + severity: ChangeSeverity::Warning, + summary: "`debug-logging` option has been removed from the default `tools` profile.", + }, ]; diff --git a/src/ci/docker/host-x86_64/mingw-check/Dockerfile b/src/ci/docker/host-x86_64/mingw-check/Dockerfile index c8d505406ff01..bb1941f489bd6 100644 --- a/src/ci/docker/host-x86_64/mingw-check/Dockerfile +++ b/src/ci/docker/host-x86_64/mingw-check/Dockerfile @@ -47,7 +47,7 @@ ENV RUN_CHECK_WITH_PARALLEL_QUERIES 1 # We also skip the x86_64-unknown-linux-gnu target as it is well-tested by other jobs. ENV SCRIPT python3 ../x.py check --stage 0 --set build.optimized-compiler-builtins=false core alloc std --target=aarch64-unknown-linux-gnu,i686-pc-windows-msvc,i686-unknown-linux-gnu,x86_64-apple-darwin,x86_64-pc-windows-gnu,x86_64-pc-windows-msvc && \ # Ensure that default config profiles are not broken - for config_file in ../src/bootstrap/defaults/*.toml; do python3 ../x.py build --dry-run --config "$config_file"; done + for config_file in ../src/bootstrap/defaults/*.toml; do python3 ../x.py build --dry-run --config \"$$config_file\"; done && \ python3 ../x.py check --target=i686-pc-windows-gnu --host=i686-pc-windows-gnu && \ python3 ../x.py clippy bootstrap -Dwarnings && \ python3 ../x.py clippy compiler library -Aclippy::all -Dclippy::correctness && \ From 5901c8c0cbb45a9f17440b983ffd30112a70ba4f Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Thu, 18 Jul 2024 16:31:19 +0300 Subject: [PATCH 3/3] create `check-default-config-profiles.sh` for `mingw-check` Signed-off-by: onur-ozkan --- src/ci/docker/host-x86_64/mingw-check/Dockerfile | 4 ++-- .../mingw-check/check-default-config-profiles.sh | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100755 src/ci/docker/host-x86_64/mingw-check/check-default-config-profiles.sh diff --git a/src/ci/docker/host-x86_64/mingw-check/Dockerfile b/src/ci/docker/host-x86_64/mingw-check/Dockerfile index bb1941f489bd6..571378774be01 100644 --- a/src/ci/docker/host-x86_64/mingw-check/Dockerfile +++ b/src/ci/docker/host-x86_64/mingw-check/Dockerfile @@ -37,6 +37,7 @@ RUN sh /scripts/sccache.sh COPY host-x86_64/mingw-check/reuse-requirements.txt /tmp/ RUN pip3 install --no-deps --no-cache-dir --require-hashes -r /tmp/reuse-requirements.txt +COPY host-x86_64/mingw-check/check-default-config-profiles.sh /scripts/ COPY host-x86_64/mingw-check/validate-toolstate.sh /scripts/ COPY host-x86_64/mingw-check/validate-error-codes.sh /scripts/ @@ -46,8 +47,7 @@ ENV RUN_CHECK_WITH_PARALLEL_QUERIES 1 # We disable optimized compiler built-ins because that requires a C toolchain for the target. # We also skip the x86_64-unknown-linux-gnu target as it is well-tested by other jobs. ENV SCRIPT python3 ../x.py check --stage 0 --set build.optimized-compiler-builtins=false core alloc std --target=aarch64-unknown-linux-gnu,i686-pc-windows-msvc,i686-unknown-linux-gnu,x86_64-apple-darwin,x86_64-pc-windows-gnu,x86_64-pc-windows-msvc && \ - # Ensure that default config profiles are not broken - for config_file in ../src/bootstrap/defaults/*.toml; do python3 ../x.py build --dry-run --config \"$$config_file\"; done && \ + /scripts/check-default-config-profiles.sh && \ python3 ../x.py check --target=i686-pc-windows-gnu --host=i686-pc-windows-gnu && \ python3 ../x.py clippy bootstrap -Dwarnings && \ python3 ../x.py clippy compiler library -Aclippy::all -Dclippy::correctness && \ diff --git a/src/ci/docker/host-x86_64/mingw-check/check-default-config-profiles.sh b/src/ci/docker/host-x86_64/mingw-check/check-default-config-profiles.sh new file mode 100755 index 0000000000000..d706927d6d950 --- /dev/null +++ b/src/ci/docker/host-x86_64/mingw-check/check-default-config-profiles.sh @@ -0,0 +1,12 @@ +#!/bin/bash +# Runs bootstrap (in dry-run mode) with each default config profile to ensure they are not broken. + +set -euo pipefail + +config_dir="../src/bootstrap/defaults" + +# Loop through each configuration file in the directory +for config_file in "$config_dir"/*.toml; +do + python3 ../x.py check --config $config_file --dry-run +done