Skip to content

Conversation

@bjorn3
Copy link
Member

@bjorn3 bjorn3 commented Jan 17, 2025

Unit tests directly inside of standard library crates require a very fragile way of building that is hard to reproduce outside of bootstrap.

Follow up to #133859

@rustbot
Copy link
Collaborator

rustbot commented Jan 17, 2025

r? @Noratrieb

rustbot has assigned @Noratrieb.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jan 17, 2025
@rust-log-analyzer

This comment has been minimized.

@Noratrieb
Copy link
Member

cool. @bors r+
does this mean that the cfg(test) stuff on inherent impls and lang items etc can be removed?

@bors
Copy link
Collaborator

bors commented Jan 17, 2025

📌 Commit d48be0d has been approved by Noratrieb

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 17, 2025
@bjorn3
Copy link
Member Author

bjorn3 commented Jan 17, 2025

Not yet. There are a whole bunch more tests that need to be handled. These are just some of the easier ones that are just testing the public api. There are also a lot of tests of private api's for which I don't have a good solution yet. Once all those tests are moved however we can indeed remove all cfg(test) on lang items and inherent impls.

@ehuss
Copy link
Contributor

ehuss commented Jan 18, 2025

@bors r-

I believe this failed in #135655

2025-01-18T00:04:30.9666457Z failures:
2025-01-18T00:04:30.9666675Z 
2025-01-18T00:04:30.9667018Z ---- vars_os_debug stdout ----
2025-01-18T00:04:30.9667322Z 
2025-01-18T00:04:30.9667622Z thread 'vars_os_debug' panicked at library/std/tests/env.rs:279:5:
2025-01-18T00:04:30.9667995Z assertion `left == right` failed
2025-01-18T00:04:30.9707931Z   left: "VarsOs { inner: [(\"AR_x86_64_unknown_linux_gnu\", \"ar\"), (\"AWS_ACCESS_KEY_ID\", \"AKIA46X5W6CZI5DHEBFL\"), (\"AWS_REGION\", \"us-west-1\"), (\"AWS_SECRET_ACCESS_KEY\", \"***\"), (\"BASE_COMMIT\", \"6067b36314ab5eb2eb47cecc464545ba58e1ad24\"), (\"BOOTSTRAP_PARENT_ID\", \"27972\"), (\"BOOTSTRAP_PYTHON\", \"/usr/bin/python3\"), (\"CARGO\", \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo\"), (\"CARGO_HOME\", \"/cargo\"), (\"CARGO_INCREMENTAL\", \"0\"), (\"CARGO_MANIFEST_DIR\", \"/checkout/library/std\"), (\"CARGO_MANIFEST_PATH\", \"/checkout/library/std/Cargo.toml\"), (\"CARGO_PKG_AUTHORS\", \"\"), (\"CARGO_PKG_DESCRIPTION\", \"The Rust Standard Library\"), (\"CARGO_PKG_HOMEPAGE\", \"\"), (\"CARGO_PKG_LICENSE\", \"MIT OR Apache-2.0\"), (\"CARGO_PKG_LICENSE_FILE\", \"\"), (\"CARGO_PKG_NAME\", \"std\"), (\"CARGO_PKG_README\", \"\"), (\"CARGO_PKG_REPOSITORY\", \"https://github.com/rust-lang/rust.git\"), (\"CARGO_PKG_RUST_VERSION\", \"\"), (\"CARGO_PKG_VERSION\", \"0.0.0\"), (\"CARGO_PKG_VERSION_MAJOR\", \"0\"), (\"CARGO_PKG_VERSION_MINOR\", \"0\"), (\"CARGO_PKG_VERSION_PATCH\", \"0\"), (\"CARGO_PKG_VERSION_PRE\", \"\"), (\"CARGO_PROFILE_RELEASE_CODEGEN_UNITS\", \"1\"), (\"CARGO_PROFILE_RELEASE_DEBUG\", \"0\"), (\"CARGO_PROFILE_RELEASE_DEBUG_ASSERTIONS\", \"true\"), (\"CARGO_PROFILE_RELEASE_OVERFLOW_CHECKS\", \"true\"), (\"CARGO_PROFILE_RELEASE_STRIP\", \"false\"), (\"CARGO_REGISTRIES_CRATES_IO_PROTOCOL\", \"sparse\"), (\"CARGO_TARGET_DIR\", \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-std\"), (\"CC_x86_64_unknown_linux_gnu\", \"sccache cc\"), (\"CFG_COMPILER_BUILD_TRIPLE\", \"x86_64-unknown-linux-gnu\"), (\"CFG_COMPILER_HOST_TRIPLE\", \"x86_64-unknown-linux-gnu\"), (\"CFG_RELEASE_CHANNEL\", \"nightly\"), (\"CFLAGS_x86_64_unknown_linux_gnu\", \"-ffunction-sections -fdata-sections -fPIC -m64\"), (\"CI\", \"true\"), (\"CI_JOB_NAME\", \"mingw-check\"), (\"COMPILETEST_REQUIRE_ALL_LLVM_COMPONENTS\", \"1\"), (\"CXXFLAGS_x86_64_unknown_linux_gnu\", \"-ffunction-sections -fdata-sections -fPIC -m64\"), (\"CXX_x86_64_unknown_linux_gnu\", \"sccache c++\"), (\"DISABLE_CI_RUSTC_IF_INCOMPATIBLE\", \"1\"), (\"GITHUB_ACTIONS\", \"true\"), (\"GITHUB_REF\", \"refs/heads/auto\"), (\"GITHUB_STEP_SUMMARY\", \"/checkout/obj/github-summary.md\"), (\"HOSTNAME\", \"2d58c269f549\"), (\"LC_CTYPE\", \"C.UTF-8\"), (\"LD_LIBRARY_PATH\", \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-std/x86_64-unknown-linux-gnu/release/build/compiler_builtins-6209a1d6b6c8cfba/out:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-std/x86_64-unknown-linux-gnu/release/deps:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-std/x86_64-unknown-linux-gnu/release:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib\"), (\"LIBC_CHECK_CFG\", \"1\"), (\"MAIL\", \"/var/mail/user\"), (\"MIRRORS_BASE\", \"https://ci-mirrors.rust-lang.org/rustc\"), (\"OBJDIR_ON_HOST\", \"/home/runner/work/rust/rust/obj\"), (\"OUT_DIR\", \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-std/x86_64-unknown-linux-gnu/release/build/std-51b023a611dbc6e1/out\"), (\"PATH\", \"/node/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"), (\"PWD\", \"/checkout/obj\"), (\"RANLIB_x86_64_unknown_linux_gnu\", \"ar s\"), (\"REAL_LIBRARY_PATH_VAR\", \"LD_LIBRARY_PATH\"), (\"RUN_CHECK_WITH_PARALLEL_QUERIES\", \"1\"), (\"RUSTBUILD_NATIVE_DIR\", \"/checkout/obj/build/x86_64-unknown-linux-gnu/native\"), (\"RUSTC\", \"/checkout/obj/build/bootstrap/debug/rustc\"), (\"RUSTC_BOOTSTRAP\", \"1\"), (\"RUSTC_BREAK_ON_ICE\", \"1\"), (\"RUSTC_ERROR_METADATA_DST\", \"/checkout/obj/build/tmp/extended-error-metadata\"), (\"RUSTC_FORCE_UNSTABLE\", \"1\"), (\"RUSTC_HOST_FLAGS\", \"--cfg=bootstrap -Zunstable-options --check-cfg=cfg(bootstrap)\"), (\"RUSTC_INSTALL_BINDIR\", \"bin\"), (\"RUSTC_LIBDIR\", \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib\"), (\"RUSTC_LINK_STD_INTO_RUSTC_DRIVER\", \"1\"), (\"RUSTC_LINT_FLAGS\", \"-Wrust_2018_idioms -Wunused_lifetimes -Dwarnings\"), (\"RUSTC_PRINT_STEP_TIMINGS\", \"1\"), (\"RUSTC_REAL\", \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/rustc\"), (\"RUSTC_SNAPSHOT\", \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/rustc\"), (\"RUSTC_SNAPSHOT_LIBDIR\", \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib\"), (\"RUSTC_STAGE\", \"0\"), (\"RUSTC_SYSROOT\", \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-sysroot\"), (\"RUSTC_VERBOSE\", \"0\"), (\"RUSTC_WRAPPER\", \"/checkout/obj/build/bootstrap/debug/rustc\"), (\"RUSTDOC\", \"/checkout/obj/build/bootstrap/debug/rustdoc\"), (\"RUSTDOCFLAGS\", \"--cfg=bootstrap -Csymbol-mangling-version=legacy --check-cfg=cfg(feature,values(any())) -Zunstable-options --check-cfg=cfg(bootstrap) -Dwarnings -Wrustdoc::invalid_codeblock_attributes --crate-version 1.86.0-nightly\\t(8b2289489\\t2025-01-17) -Zcrate-attr=doc(html_root_url=\\\"https://doc.rust-lang.org/nightly/\\\") -Zcrate-attr=warn(rust_2018_idioms)\"), (\"RUSTDOC_LIBDIR\", \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib\"), (\"RUSTDOC_REAL\", \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/rustdoc\"), (\"RUSTFLAGS\", \"--cfg=bootstrap -Csymbol-mangling-version=legacy --check-cfg=cfg(feature,values(any())) -Zunstable-options --check-cfg=cfg(bootstrap) -Zmacro-backtrace -Csplit-debuginfo=off -Cprefer-dynamic -Zvalidate-mir -Zmir-opt-level=3 -Zinline-mir -Zinline-mir-preserve-debug -Zmir_strip_debuginfo=locals-in-tiny-functions -Clink-args=-Wl,-z,origin -Clink-args=-Wl,-rpath,$ORIGIN/../lib -Cforce-frame-pointers=yes -Zcrate-attr=doc(html_root_url=\\\"https://doc.rust-lang.org/nightly/\\\")\"), (\"RUST_COMPILER_RT_ROOT\", \"/checkout/src/llvm-project/compiler-rt\"), (\"RUST_CONFIGURE_ARGS\", \"--set rust.validate-mir-opts=3 --set build.print-step-timings --enable-verbose-tests --set build.metrics --enable-verbose-configure --enable-sccache --disable-manage-submodules --enable-locked-deps --enable-cargo-native-static --set rust.codegen-units-std=1 --set dist.compression-profile=balanced --dist-compression-formats=xz --set build.optimized-compiler-builtins --disable-dist-src --release-channel=nightly --enable-debug-assertions --enable-overflow-checks --enable-llvm-assertions --set rust.verify-llvm-ir --set rust.codegen-backends=llvm,cranelift --set llvm.download-ci-llvm=if-unchanged --set rust.download-rustc=if-unchanged\"), (\"RUST_RELEASE_CHANNEL\", \"nightly\"), (\"RUST_TEST_THREADS\", \"4\"), (\"SCCACHE_BUCKET\", \"rust-lang-ci-sccache2\"), (\"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 &&            /scripts/check-default-config-profiles.sh &&            python3 ../x.py check --target=i686-pc-windows-gnu --host=i686-pc-windows-gnu &&            python3 ../x.py clippy ci &&            python3 ../x.py build --stage 0 src/tools/build-manifest &&            python3 ../x.py test --stage 0 src/tools/compiletest &&            python3 ../x.py test --stage 0 core alloc std test proc_macro &&            RUSTDOCFLAGS=\\\"--document-private-items --document-hidden-items\\\" python3 ../x.py doc --stage 0 library &&            mkdir -p /checkout/obj/staging/doc &&            cp -r build/x86_64-unknown-linux-gnu/doc /checkout/obj/staging &&            RUSTDOCFLAGS=\\\"--document-private-items --document-hidden-items\\\" python3 ../x.py doc --stage 0 compiler &&            RUSTDOCFLAGS=\\\"--document-private-items --document-hidden-items\\\" python3 ../x.py doc --stage 0 library/test &&            /scripts/validate-toolstate.sh &&            /scripts/validate-error-codes.sh &&            reuse --include-submodules lint &&            python3 ../x.py test collect-license-metadata &&            es-check es2019 ../src/librustdoc/html/static/js/*.js &&            eslint -c ../src/librustdoc/html/static/.eslintrc.js ../src/librustdoc/html/static/js/*.js &&            eslint -c ../src/tools/rustdoc-js/.eslintrc.js ../src/tools/rustdoc-js/tester.js &&            eslint -c ../src/tools/rustdoc-gui/.eslintrc.js ../src/tools/rustdoc-gui/tester.js\"), (\"SHLVL\", \"1\"), (\"SRC\", \"/checkout\"), (\"SSL_CERT_DIR\", \"/usr/lib/ssl/certs\"), (\"SSL_CERT_FILE\", \"/usr/lib/ssl/certs/ca-certificates.crt\"), (\"STD_ENV_ARCH\", \"x86_64\"), (\"TERM\", \"xterm\"), (\"TOOLSTATE_PUBLISH\", \"1\"), (\"TOOLSTATE_REPO\", \"https://github.com/rust-lang-nursery/rust-toolstate\"), (\"TOOLSTATE_REPO_ACCESS_TOKEN\", \"***\"), (\"WINAPI_NO_BUNDLED_LIBRARIES\", \"1\"), (\"_\", \"/usr/bin/sh\"), (\"__CARGO_DEFAULT_LIB_METADATA\", \"bootstrapstd\"), (\"HOME\", \"/home/user\"), (\"TESTBtpk8CK9fA\", \"VALUE\"), (\"TESTrtpkPr5Usq\", \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\")] }"
2025-01-18T00:04:30.9786616Z  right: "VarsOs { inner: [(\"AR_x86_64_unknown_linux_gnu\", \"ar\"), (\"AWS_ACCESS_KEY_ID\", \"AKIA46X5W6CZI5DHEBFL\"), (\"AWS_REGION\", \"us-west-1\"), (\"AWS_SECRET_ACCESS_KEY\", \"***\"), (\"BASE_COMMIT\", \"6067b36314ab5eb2eb47cecc464545ba58e1ad24\"), (\"BOOTSTRAP_PARENT_ID\", \"27972\"), (\"BOOTSTRAP_PYTHON\", \"/usr/bin/python3\"), (\"CARGO\", \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo\"), (\"CARGO_HOME\", \"/cargo\"), (\"CARGO_INCREMENTAL\", \"0\"), (\"CARGO_MANIFEST_DIR\", \"/checkout/library/std\"), (\"CARGO_MANIFEST_PATH\", \"/checkout/library/std/Cargo.toml\"), (\"CARGO_PKG_AUTHORS\", \"\"), (\"CARGO_PKG_DESCRIPTION\", \"The Rust Standard Library\"), (\"CARGO_PKG_HOMEPAGE\", \"\"), (\"CARGO_PKG_LICENSE\", \"MIT OR Apache-2.0\"), (\"CARGO_PKG_LICENSE_FILE\", \"\"), (\"CARGO_PKG_NAME\", \"std\"), (\"CARGO_PKG_README\", \"\"), (\"CARGO_PKG_REPOSITORY\", \"https://github.com/rust-lang/rust.git\"), (\"CARGO_PKG_RUST_VERSION\", \"\"), (\"CARGO_PKG_VERSION\", \"0.0.0\"), (\"CARGO_PKG_VERSION_MAJOR\", \"0\"), (\"CARGO_PKG_VERSION_MINOR\", \"0\"), (\"CARGO_PKG_VERSION_PATCH\", \"0\"), (\"CARGO_PKG_VERSION_PRE\", \"\"), (\"CARGO_PROFILE_RELEASE_CODEGEN_UNITS\", \"1\"), (\"CARGO_PROFILE_RELEASE_DEBUG\", \"0\"), (\"CARGO_PROFILE_RELEASE_DEBUG_ASSERTIONS\", \"true\"), (\"CARGO_PROFILE_RELEASE_OVERFLOW_CHECKS\", \"true\"), (\"CARGO_PROFILE_RELEASE_STRIP\", \"false\"), (\"CARGO_REGISTRIES_CRATES_IO_PROTOCOL\", \"sparse\"), (\"CARGO_TARGET_DIR\", \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-std\"), (\"CC_x86_64_unknown_linux_gnu\", \"sccache cc\"), (\"CFG_COMPILER_BUILD_TRIPLE\", \"x86_64-unknown-linux-gnu\"), (\"CFG_COMPILER_HOST_TRIPLE\", \"x86_64-unknown-linux-gnu\"), (\"CFG_RELEASE_CHANNEL\", \"nightly\"), (\"CFLAGS_x86_64_unknown_linux_gnu\", \"-ffunction-sections -fdata-sections -fPIC -m64\"), (\"CI\", \"true\"), (\"CI_JOB_NAME\", \"mingw-check\"), (\"COMPILETEST_REQUIRE_ALL_LLVM_COMPONENTS\", \"1\"), (\"CXXFLAGS_x86_64_unknown_linux_gnu\", \"-ffunction-sections -fdata-sections -fPIC -m64\"), (\"CXX_x86_64_unknown_linux_gnu\", \"sccache c++\"), (\"DISABLE_CI_RUSTC_IF_INCOMPATIBLE\", \"1\"), (\"GITHUB_ACTIONS\", \"true\"), (\"GITHUB_REF\", \"refs/heads/auto\"), (\"GITHUB_STEP_SUMMARY\", \"/checkout/obj/github-summary.md\"), (\"HOSTNAME\", \"2d58c269f549\"), (\"LC_CTYPE\", \"C.UTF-8\"), (\"LD_LIBRARY_PATH\", \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-std/x86_64-unknown-linux-gnu/release/build/compiler_builtins-6209a1d6b6c8cfba/out:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-std/x86_64-unknown-linux-gnu/release/deps:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-std/x86_64-unknown-linux-gnu/release:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib\"), (\"LIBC_CHECK_CFG\", \"1\"), (\"MAIL\", \"/var/mail/user\"), (\"MIRRORS_BASE\", \"https://ci-mirrors.rust-lang.org/rustc\"), (\"OBJDIR_ON_HOST\", \"/home/runner/work/rust/rust/obj\"), (\"OUT_DIR\", \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-std/x86_64-unknown-linux-gnu/release/build/std-51b023a611dbc6e1/out\"), (\"PATH\", \"/node/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"), (\"PWD\", \"/checkout/obj\"), (\"RANLIB_x86_64_unknown_linux_gnu\", \"ar s\"), (\"REAL_LIBRARY_PATH_VAR\", \"LD_LIBRARY_PATH\"), (\"RUN_CHECK_WITH_PARALLEL_QUERIES\", \"1\"), (\"RUSTBUILD_NATIVE_DIR\", \"/checkout/obj/build/x86_64-unknown-linux-gnu/native\"), (\"RUSTC\", \"/checkout/obj/build/bootstrap/debug/rustc\"), (\"RUSTC_BOOTSTRAP\", \"1\"), (\"RUSTC_BREAK_ON_ICE\", \"1\"), (\"RUSTC_ERROR_METADATA_DST\", \"/checkout/obj/build/tmp/extended-error-metadata\"), (\"RUSTC_FORCE_UNSTABLE\", \"1\"), (\"RUSTC_HOST_FLAGS\", \"--cfg=bootstrap -Zunstable-options --check-cfg=cfg(bootstrap)\"), (\"RUSTC_INSTALL_BINDIR\", \"bin\"), (\"RUSTC_LIBDIR\", \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib\"), (\"RUSTC_LINK_STD_INTO_RUSTC_DRIVER\", \"1\"), (\"RUSTC_LINT_FLAGS\", \"-Wrust_2018_idioms -Wunused_lifetimes -Dwarnings\"), (\"RUSTC_PRINT_STEP_TIMINGS\", \"1\"), (\"RUSTC_REAL\", \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/rustc\"), (\"RUSTC_SNAPSHOT\", \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/rustc\"), (\"RUSTC_SNAPSHOT_LIBDIR\", \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib\"), (\"RUSTC_STAGE\", \"0\"), (\"RUSTC_SYSROOT\", \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-sysroot\"), (\"RUSTC_VERBOSE\", \"0\"), (\"RUSTC_WRAPPER\", \"/checkout/obj/build/bootstrap/debug/rustc\"), (\"RUSTDOC\", \"/checkout/obj/build/bootstrap/debug/rustdoc\"), (\"RUSTDOCFLAGS\", \"--cfg=bootstrap -Csymbol-mangling-version=legacy --check-cfg=cfg(feature,values(any())) -Zunstable-options --check-cfg=cfg(bootstrap) -Dwarnings -Wrustdoc::invalid_codeblock_attributes --crate-version 1.86.0-nightly\\t(8b2289489\\t2025-01-17) -Zcrate-attr=doc(html_root_url=\\\"https://doc.rust-lang.org/nightly/\\\") -Zcrate-attr=warn(rust_2018_idioms)\"), (\"RUSTDOC_LIBDIR\", \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib\"), (\"RUSTDOC_REAL\", \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/rustdoc\"), (\"RUSTFLAGS\", \"--cfg=bootstrap -Csymbol-mangling-version=legacy --check-cfg=cfg(feature,values(any())) -Zunstable-options --check-cfg=cfg(bootstrap) -Zmacro-backtrace -Csplit-debuginfo=off -Cprefer-dynamic -Zvalidate-mir -Zmir-opt-level=3 -Zinline-mir -Zinline-mir-preserve-debug -Zmir_strip_debuginfo=locals-in-tiny-functions -Clink-args=-Wl,-z,origin -Clink-args=-Wl,-rpath,$ORIGIN/../lib -Cforce-frame-pointers=yes -Zcrate-attr=doc(html_root_url=\\\"https://doc.rust-lang.org/nightly/\\\")\"), (\"RUST_COMPILER_RT_ROOT\", \"/checkout/src/llvm-project/compiler-rt\"), (\"RUST_CONFIGURE_ARGS\", \"--set rust.validate-mir-opts=3 --set build.print-step-timings --enable-verbose-tests --set build.metrics --enable-verbose-configure --enable-sccache --disable-manage-submodules --enable-locked-deps --enable-cargo-native-static --set rust.codegen-units-std=1 --set dist.compression-profile=balanced --dist-compression-formats=xz --set build.optimized-compiler-builtins --disable-dist-src --release-channel=nightly --enable-debug-assertions --enable-overflow-checks --enable-llvm-assertions --set rust.verify-llvm-ir --set rust.codegen-backends=llvm,cranelift --set llvm.download-ci-llvm=if-unchanged --set rust.download-rustc=if-unchanged\"), (\"RUST_RELEASE_CHANNEL\", \"nightly\"), (\"RUST_TEST_THREADS\", \"4\"), (\"SCCACHE_BUCKET\", \"rust-lang-ci-sccache2\"), (\"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 &&            /scripts/check-default-config-profiles.sh &&            python3 ../x.py check --target=i686-pc-windows-gnu --host=i686-pc-windows-gnu &&            python3 ../x.py clippy ci &&            python3 ../x.py build --stage 0 src/tools/build-manifest &&            python3 ../x.py test --stage 0 src/tools/compiletest &&            python3 ../x.py test --stage 0 core alloc std test proc_macro &&            RUSTDOCFLAGS=\\\"--document-private-items --document-hidden-items\\\" python3 ../x.py doc --stage 0 library &&            mkdir -p /checkout/obj/staging/doc &&            cp -r build/x86_64-unknown-linux-gnu/doc /checkout/obj/staging &&            RUSTDOCFLAGS=\\\"--document-private-items --document-hidden-items\\\" python3 ../x.py doc --stage 0 compiler &&            RUSTDOCFLAGS=\\\"--document-private-items --document-hidden-items\\\" python3 ../x.py doc --stage 0 library/test &&            /scripts/validate-toolstate.sh &&            /scripts/validate-error-codes.sh &&            reuse --include-submodules lint &&            python3 ../x.py test collect-license-metadata &&            es-check es2019 ../src/librustdoc/html/static/js/*.js &&            eslint -c ../src/librustdoc/html/static/.eslintrc.js ../src/librustdoc/html/static/js/*.js &&            eslint -c ../src/tools/rustdoc-js/.eslintrc.js ../src/tools/rustdoc-js/tester.js &&            eslint -c ../src/tools/rustdoc-gui/.eslintrc.js ../src/tools/rustdoc-gui/tester.js\"), (\"SHLVL\", \"1\"), (\"SRC\", \"/checkout\"), (\"SSL_CERT_DIR\", \"/usr/lib/ssl/certs\"), (\"SSL_CERT_FILE\", \"/usr/lib/ssl/certs/ca-certificates.crt\"), (\"STD_ENV_ARCH\", \"x86_64\"), (\"TERM\", \"xterm\"), (\"TOOLSTATE_PUBLISH\", \"1\"), (\"TOOLSTATE_REPO\", \"https://github.com/rust-lang-nursery/rust-toolstate\"), (\"TOOLSTATE_REPO_ACCESS_TOKEN\", \"***\"), (\"WINAPI_NO_BUNDLED_LIBRARIES\", \"1\"), (\"_\", \"/usr/bin/sh\"), (\"__CARGO_DEFAULT_LIB_METADATA\", \"bootstrapstd\"), (\"HOME\", \"/home/user\"), (\"TESTBtpk8CK9fA\", \"VALUE\"), (\"TESTrtpkPr5Usq\", \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"), (\"TEST0HDOQwmP2j\", \"\"), (\"TESTfTXaSvkQHp\", \"VALUE\")] }"
2025-01-18T00:04:30.9833402Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2025-01-18T00:04:30.9833718Z 
2025-01-18T00:04:30.9833725Z 
2025-01-18T00:04:30.9833822Z failures:
2025-01-18T00:04:30.9834022Z     vars_os_debug
2025-01-18T00:04:30.9834178Z 
2025-01-18T00:04:30.9834457Z test result: FAILED. 14 passed; 1 failed; 1 ignored; 0 measured; 0 filtered out; finished in 2.21ms
2025-01-18T00:04:30.9834802Z 

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jan 18, 2025
@raoulstrackx
Copy link
Contributor

Thanks for the PR @bjorn3 ! We ran this PR on our internal CI for the SGX target and it fails with:

01:01:19    --> library/std/tests/sync/once_lock.rs:167:24
01:01:19     |
01:01:19 167 |                 crate::thread::yield_now();
01:01:19     |                        ^^^^^^ unresolved import
01:01:19     |
01:01:19 help: a similar path exists
01:01:19     |
01:01:19 167 |                 crate::std::thread::yield_now();
01:01:19     |                        ~~~~~~~~~~~
01:01:19 help: consider importing one of these modules
01:01:19     |
01:01:19 1   + use crate::once_lock::thread;
01:01:19     |
01:01:19 1   + use std::thread;
01:01:19     |
01:01:19 help: if you import `thread`, refer to it directly
01:01:19     |
01:01:19 167 -                 crate::thread::yield_now();
01:01:19 167 +                 thread::yield_now();
01:01:19     |

I believe this is caused by the following line in the sync_once_cell_does_not_leak_partially_constructed_boxes test:

                #[cfg(target_env = "sgx")]
                crate::thread::yield_now();

and that it should be changed to:

                #[cfg(target_env = "sgx")]
                std::thread::yield_now();

could you please make this change? Thank you!

@ehuss
Copy link
Contributor

ehuss commented Jan 22, 2025

Just wanted to note, if it wasn't obvious why the error above happened, is that there are a bunch of set_var tests running in the same executable, which is obviously not thread-safe.

One suggestion is to move the set_var ones to a separate integration test so they don't interfere.

@bjorn3
Copy link
Member Author

bjorn3 commented Jan 23, 2025

SGX should be fixed now. And I moved the set_var tests to a separate integration test.

@rust-log-analyzer

This comment has been minimized.

@raoulstrackx
Copy link
Contributor

SGX should be fixed now. And I moved the set_var tests to a separate integration test.

Awesome! :)

@bjorn3
Copy link
Member Author

bjorn3 commented Jan 23, 2025

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 23, 2025
@bors
Copy link
Collaborator

bors commented Jan 26, 2025

☔ The latest upstream changes (presumably #136085) made this pull request unmergeable. Please resolve the merge conflicts.

@matthiaskrgr
Copy link
Member

@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 2, 2025
@bjorn3 bjorn3 force-pushed the move_tests_to_stdtests branch from a56ecda to cc7e3a6 Compare February 2, 2025 18:28
@bjorn3
Copy link
Member Author

bjorn3 commented Feb 2, 2025

@bors r=Noratrieb

@bors
Copy link
Collaborator

bors commented Feb 2, 2025

📌 Commit cc7e3a6 has been approved by Noratrieb

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 2, 2025
@bors bors merged commit d2aa3de into rust-lang:master Feb 4, 2025
6 checks passed
@rustbot rustbot added this to the 1.86.0 milestone Feb 4, 2025
@bjorn3 bjorn3 deleted the move_tests_to_stdtests branch February 4, 2025 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants