From 45abd8caf2d596a520a8b712967aa19d799d002b Mon Sep 17 00:00:00 2001 From: LuuuX Date: Tue, 22 Aug 2023 15:15:00 +0800 Subject: [PATCH] Fix Issue 112009 modify fuction clond() -> cloned() optimize the code Handle the problem that the pathset is empty and modify the judgment of the builder::tests::test_exclude_kind Delete unnecessary judegment conditions skip test for library/std duo to OOM in benches as library/alloc Add FIXME for WASM32 --- src/bootstrap/builder.rs | 6 ++++-- src/bootstrap/builder/tests.rs | 4 ++-- src/ci/docker/host-x86_64/wasm32/Dockerfile | 3 ++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs index b3666192853..d28ac1a05f4 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs @@ -302,8 +302,10 @@ fn from(kind: Kind) -> StepDescription { } } - fn maybe_run(&self, builder: &Builder<'_>, pathsets: Vec) { - if pathsets.iter().any(|set| self.is_excluded(builder, set)) { + fn maybe_run(&self, builder: &Builder<'_>, mut pathsets: Vec) { + pathsets.retain(|set| !self.is_excluded(builder, set)); + + if pathsets.is_empty() { return; } diff --git a/src/bootstrap/builder/tests.rs b/src/bootstrap/builder/tests.rs index 43b4a34fe5b..80e66622e8b 100644 --- a/src/bootstrap/builder/tests.rs +++ b/src/bootstrap/builder/tests.rs @@ -136,9 +136,9 @@ fn test_exclude_kind() { let mut config = configure("test", &["A"], &["A"]); // Ensure our test is valid, and `test::Rustc` would be run without the exclude. assert!(run_build(&[], config.clone()).contains::()); - // Ensure tests for rustc are skipped. + // Ensure tests for rustc are not skipped. config.skip = vec![path.clone()]; - assert!(!run_build(&[], config.clone()).contains::()); + assert!(run_build(&[], config.clone()).contains::()); // Ensure builds for rustc are not skipped. assert!(run_build(&[], config).contains::()); } diff --git a/src/ci/docker/host-x86_64/wasm32/Dockerfile b/src/ci/docker/host-x86_64/wasm32/Dockerfile index 02b4664eb55..0d0f1edd003 100644 --- a/src/ci/docker/host-x86_64/wasm32/Dockerfile +++ b/src/ci/docker/host-x86_64/wasm32/Dockerfile @@ -58,5 +58,6 @@ ENV NO_CHANGE_USER=1 RUN chown 10719 -R /emsdk-portable/ # Exclude library/alloc due to OOM in benches. +# FIXME: Fix std tests ENV SCRIPT python3 ../x.py test --stage 2 --host='' --target $TARGETS \ - --skip library/alloc + --skip library/alloc --skip library/std