Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 5 pull requests #122289

Closed
wants to merge 121 commits into from
Closed

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

Young-Flash and others added 30 commits February 21, 2024 10:57
For robustness, also test the disposition in our own process even if
tests in `tests/ui/attributes/unix_sigpipe` already covers it.
Update rustc_pattern_analysis

This should fix rust-lang/rust-analyzer#16656 but I can't check because we don't have a reproducer.
fix: Add basic support for Native Debug

Native Debug doesn't work very well and passing command-line arguments is nasty (rust-lang/rust-analyzer#9815), but I guess it's a start.

Closes rust-lang#9815
…ykril

fix: autocomplete constants inside format strings

Hi! This PR adds autocompletion for constants (including statics) inside format strings and closes rust-lang#16608.

I'm not sure about adding the `constants` field to the `CompletionContext`. It kinda makes sense, since it's in line with the `locals` field, and this way everything looks a bit cleaner, but at the same time does it really need to be there?

Anyway, let me know if anything should/can be changed. :)
fix: use 4 spaces for indentation in macro expansion

Partial fix for rust-lang#16471.

In the previous code, the indentation produced by macro expansion was set to 2 spaces. This PR modifies it to 4 spaces for the sake of consistency.
Add more methods for resolving definitions from AST to their corresponding HIR types

In order to be able to add these methods with consistent naming I had to also rename two existing methods that would otherwise be conflicting/confusing:

`Semantics::to_module_def(&self, file: FileId) -> Option<Module>` (before)
`Semantics::file_to_module_def(&self, file: FileId) -> Option<Module>` (after)

`Semantics::to_module_defs(&self, file: FileId) -> impl Iterator<Item = Module>` (before)
`Semantics::file_to_module_defs(&self, file: FileId) -> impl Iterator<Item = Module>` (after)

(the PR is motivated by an outside use of the `ra_ap_hir` crate that would benefit from being able to walk a `hir::Function`'s AST, resolving its exprs/stmts/items to their HIR equivalents)
Avoid some allocations

I went on a small `.clone()` hunting tour :D
mu001999 and others added 12 commits March 9, 2024 09:09
Some minor changes in the test explorer lsp extension

followup rust-lang#16662

cc `@nemethf` `@ShuiRuTian`
…ark-Simulacrum

unix_sigpipe: Add test for SIGPIPE disposition in child processes

To make it clearer what the impact would be to stop using `SIG_IGN` and instead use a noop handler, like suggested [here](rust-lang#62569 (comment)) and implemented [here](rust-lang#121578).

Part of rust-lang#97889
[bootstrap] Move the `split-debuginfo` setting to the per-target section

As described in rust-lang#112406, bootstrap currently applies the global `split-debuginfo` setting to all artifacts, irrespective of their target triple.

This doesn't cause problems when the "build" triple defaults `split-debuginfo` to `off` (as is the case on Linux, for example).

However, when the "build" triple has `split-debuginfo` enabled and additional target triples are configured, then artifacts for the additional triples will also be built with `split-debuginfo` (despite not necessarily supporting `split-debuginfo`).

rust-lang#112406 mentions `riscv32imc-unknown-none-elf` as one target where this happens, and I've run into this with Wasm as well.

This PR does **not** implement `@ehuss's` suggestion that "bootstrap not try to guess how to configure split-debuginfo, and instead use cargo profiles to set it", because that seemed like a lot more significant change.

---

After this PR, anyone explicitly setting `rust.split-debuginfo` should update their configuration to specify the setting in the `target.<triple>` section, though `rust.split-debuginfo` will still be honored for the "build" triple for now.

This PR changes the behavior when `rust.split-debuginfo` was **not** explicitly set **and** bootstrap is configured to cross-compile to a triple that has a different `split-debuginfo` than the "build" triple.

---

If there's a reasonable way to add additional tests for this, please let me know (I didn't find any tests checking cargo arguments in [`builder/tests.rs`](https://github.com/rust-lang/rust/blob/master/src/bootstrap/src/core/builder/tests.rs)).
…arget, r=albertlarsan68

ensure that sysroot is properly set for cross-targets

Previously, doing `x test compiler/*` would result in build failures due to missing libraries. This ensures properly setting up the sysroot for cross targets.
…lubby789

mir-opt tests: don't run a different set on --bless; enable --keep-stage-std

Currently, `./x.py test tests/mir-opt` runs only the tests for the current target, and `./x.py test tests/mir-opt --bless` runs tests for a representative set of targets.

I find this confusing and not what I want: for one I never run tests without `--bless` because I prefer to look at a git diff. What I however like to do is pass `--keep-stage-std` when I'm working on the compiler; this doesn't work today with `--bless` because it tries a bunch of targets for which I don't have a built std.

In this PR, I make it so `./x.py test tests/mir-opt` runs the same set of tests regardless of `--bless`. By default it runs a representative sample of targets, and if `--keep-stage-std` is set it only runs tests for the current target.
Subtree update of `rust-analyzer`

r? ghost
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) rollup A PR which is a rollup labels Mar 10, 2024
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=6

@bors
Copy link
Contributor

bors commented Mar 10, 2024

📌 Commit 3aa6594 has been approved by matthiaskrgr

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 Mar 10, 2024
@bors
Copy link
Contributor

bors commented Mar 10, 2024

⌛ Testing commit 3aa6594 with merge a60ff62...

bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 10, 2024
…iaskrgr

Rollup of 5 pull requests

Successful merges:

 - rust-lang#121573 (unix_sigpipe: Add test for SIGPIPE disposition in child processes)
 - rust-lang#121754 ([bootstrap] Move the `split-debuginfo` setting to the per-target section)
 - rust-lang#122205 (ensure that sysroot is properly set for cross-targets)
 - rust-lang#122257 (mir-opt tests: don't run a different set on --bless; enable --keep-stage-std)
 - rust-lang#122272 (Subtree update of `rust-analyzer`)

Failed merges:

 - rust-lang#122108 (Add `target.*.runner` configuration for targets)

r? `@ghost`
`@rustbot` modify labels: rollup
@rust-log-analyzer
Copy link
Collaborator

The job test-various failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
test result: ok. 269 passed; 0 failed; 16 ignored; 0 measured; 0 filtered out; finished in 3.60s

##[endgroup]
[TIMING] core::build_steps::test::Compiletest { compiler: Compiler { stage: 2, host: x86_64-unknown-linux-gnu }, target: i686-pc-windows-msvc, mode: "mir-opt", suite: "mir-opt", path: "tests/mir-opt", compare_mode: None } -- 3.697
[TIMING] core::build_steps::synthetic_targets::MirOptPanicAbortSyntheticTarget { compiler: Compiler { stage: 2, host: x86_64-unknown-linux-gnu }, base: x86_64-apple-darwin } -- 0.013
[TIMING] core::build_steps::compile::StartupObjects { compiler: Compiler { stage: 2, host: x86_64-unknown-linux-gnu }, target: x86_64-apple-darwin-synthetic-miropt-abort(/checkout/obj/build/synthetic-target-specs/x86_64-apple-darwin-synthetic-miropt-abort.json) } -- 0.000
##[group]Building stage2 library artifacts (x86_64-unknown-linux-gnu -> x86_64-apple-darwin-synthetic-miropt-abort(/checkout/obj/build/synthetic-target-specs/x86_64-apple-darwin-synthetic-miropt-abort.json))
    Checking core v0.0.0 (/checkout/library/core)
   Compiling compiler_builtins v0.1.108
[RUSTC-TIMING] build_script_build test:false 0.218
[RUSTC-TIMING] build_script_build test:false 0.117
---
[RUSTC-TIMING] test test:false 0.717
    Checking sysroot v0.0.0 (/checkout/library/sysroot)
[RUSTC-TIMING] sysroot test:false 0.016
    Finished release [optimized] target(s) in 21.70s
[TIMING] core::builder::Builder::sysroot_libdir::Libdir { compiler: Compiler { stage: 2, host: x86_64-unknown-linux-gnu }, target: x86_64-apple-darwin-synthetic-miropt-abort(/checkout/obj/build/synthetic-target-specs/x86_64-apple-darwin-synthetic-miropt-abort.json) } -- 0.000
[TIMING] core::build_steps::compile::StdLink { compiler: Compiler { stage: 2, host: x86_64-unknown-linux-gnu }, target_compiler: Compiler { stage: 2, host: x86_64-unknown-linux-gnu }, target: x86_64-apple-darwin-synthetic-miropt-abort(/checkout/obj/build/synthetic-target-specs/x86_64-apple-darwin-synthetic-miropt-abort.json), crates: [], force_recompile: false } -- 0.001
##[endgroup]
[TIMING] core::build_steps::compile::Std { target: x86_64-apple-darwin-synthetic-miropt-abort(/checkout/obj/build/synthetic-target-specs/x86_64-apple-darwin-synthetic-miropt-abort.json), compiler: Compiler { stage: 2, host: x86_64-unknown-linux-gnu }, crates: [], force_recompile: false, extra_rust_args: [], is_for_mir_opt_tests: true } -- 21.745
[TIMING] core::build_steps::test::RemoteCopyLibs { compiler: Compiler { stage: 2, host: x86_64-unknown-linux-gnu }, target: x86_64-apple-darwin-synthetic-miropt-abort(/checkout/obj/build/synthetic-target-specs/x86_64-apple-darwin-synthetic-miropt-abort.json) } -- 0.000
##[group]Testing stage2 compiletest suite=mir-opt mode=mir-opt (x86_64-unknown-linux-gnu -> x86_64-apple-darwin-synthetic-miropt-abort(/checkout/obj/build/synthetic-target-specs/x86_64-apple-darwin-synthetic-miropt-abort.json))
running 285 tests
test [mir-opt] tests/mir-opt/basic_assignment.rs ... ignored, ignored on targets without unwinding support
test [mir-opt] tests/mir-opt/box_expr.rs ... ignored, ignored on targets without unwinding support
test [mir-opt] tests/mir-opt/building/custom/arrays.rs ... ok
---

test result: ok. 269 passed; 0 failed; 16 ignored; 0 measured; 0 filtered out; finished in 3.46s

##[endgroup]
[TIMING] core::build_steps::test::Compiletest { compiler: Compiler { stage: 2, host: x86_64-unknown-linux-gnu }, target: x86_64-apple-darwin-synthetic-miropt-abort(/checkout/obj/build/synthetic-target-specs/x86_64-apple-darwin-synthetic-miropt-abort.json), mode: "mir-opt", suite: "mir-opt", path: "tests/mir-opt", compare_mode: None } -- 3.563
[TIMING] core::build_steps::synthetic_targets::MirOptPanicAbortSyntheticTarget { compiler: Compiler { stage: 2, host: x86_64-unknown-linux-gnu }, base: i686-unknown-linux-musl } -- 0.013
[TIMING] core::build_steps::compile::StartupObjects { compiler: Compiler { stage: 2, host: x86_64-unknown-linux-gnu }, target: i686-unknown-linux-musl-synthetic-miropt-abort(/checkout/obj/build/synthetic-target-specs/i686-unknown-linux-musl-synthetic-miropt-abort.json) } -- 0.000
##[group]Building stage2 library artifacts (x86_64-unknown-linux-gnu -> i686-unknown-linux-musl-synthetic-miropt-abort(/checkout/obj/build/synthetic-target-specs/i686-unknown-linux-musl-synthetic-miropt-abort.json))
[RUSTC-TIMING] build_script_build test:false 0.176
[RUSTC-TIMING] build_script_build test:false 0.218
[RUSTC-TIMING] build_script_build test:false 0.117
   Compiling compiler_builtins v0.1.108
---
[RUSTC-TIMING] test test:false 0.707
    Checking sysroot v0.0.0 (/checkout/library/sysroot)
[RUSTC-TIMING] sysroot test:false 0.016
    Finished release [optimized] target(s) in 21.67s
[TIMING] core::builder::Builder::sysroot_libdir::Libdir { compiler: Compiler { stage: 2, host: x86_64-unknown-linux-gnu }, target: i686-unknown-linux-musl-synthetic-miropt-abort(/checkout/obj/build/synthetic-target-specs/i686-unknown-linux-musl-synthetic-miropt-abort.json) } -- 0.000
[TIMING] core::build_steps::compile::StdLink { compiler: Compiler { stage: 2, host: x86_64-unknown-linux-gnu }, target_compiler: Compiler { stage: 2, host: x86_64-unknown-linux-gnu }, target: i686-unknown-linux-musl-synthetic-miropt-abort(/checkout/obj/build/synthetic-target-specs/i686-unknown-linux-musl-synthetic-miropt-abort.json), crates: [], force_recompile: false } -- 0.001
##[endgroup]
[TIMING] core::build_steps::compile::Std { target: i686-unknown-linux-musl-synthetic-miropt-abort(/checkout/obj/build/synthetic-target-specs/i686-unknown-linux-musl-synthetic-miropt-abort.json), compiler: Compiler { stage: 2, host: x86_64-unknown-linux-gnu }, crates: [], force_recompile: false, extra_rust_args: [], is_for_mir_opt_tests: true } -- 21.737
[TIMING] core::build_steps::test::RemoteCopyLibs { compiler: Compiler { stage: 2, host: x86_64-unknown-linux-gnu }, target: i686-unknown-linux-musl-synthetic-miropt-abort(/checkout/obj/build/synthetic-target-specs/i686-unknown-linux-musl-synthetic-miropt-abort.json) } -- 0.000
##[group]Testing stage2 compiletest suite=mir-opt mode=mir-opt (x86_64-unknown-linux-gnu -> i686-unknown-linux-musl-synthetic-miropt-abort(/checkout/obj/build/synthetic-target-specs/i686-unknown-linux-musl-synthetic-miropt-abort.json))
running 285 tests
test [mir-opt] tests/mir-opt/asm_unwind_panic_abort.rs ... ignored, only executed when the architecture is x86_64
test [mir-opt] tests/mir-opt/basic_assignment.rs ... ignored, ignored on targets without unwinding support
test [mir-opt] tests/mir-opt/box_expr.rs ... ignored, ignored on targets without unwinding support
---

test result: ok. 259 passed; 0 failed; 26 ignored; 0 measured; 0 filtered out; finished in 3.37s

##[endgroup]
[TIMING] core::build_steps::test::Compiletest { compiler: Compiler { stage: 2, host: x86_64-unknown-linux-gnu }, target: i686-unknown-linux-musl-synthetic-miropt-abort(/checkout/obj/build/synthetic-target-specs/i686-unknown-linux-musl-synthetic-miropt-abort.json), mode: "mir-opt", suite: "mir-opt", path: "tests/mir-opt", compare_mode: None } -- 3.480
##[group]Testing stage2 compiletest suite=codegen-units mode=codegen-units (x86_64-unknown-linux-gnu -> wasm32-unknown-unknown)

running 44 tests
test [codegen-units] tests/codegen-units/item-collection/asm-sym.rs ... ignored, ignored on targets without inline assembly support
---
CMAKE_wasm32-unknown-unknown = None
CMAKE_wasm32_unknown_unknown = None
TARGET_CMAKE = None
CMAKE = None
running: cd "/checkout/obj/build/wasm32-unknown-unknown/llvm/build" && CMAKE_PREFIX_PATH="" DESTDIR="" "cmake" "/checkout/src/llvm-project/llvm" "-G" "Ninja" "-DLLVM_ENABLE_ASSERTIONS=ON" "-DLLVM_UNREACHABLE_OPTIMIZE=OFF" "-DLLVM_ENABLE_PLUGINS=OFF" "-DLLVM_TARGETS_TO_BUILD=AArch64;ARM;BPF;Hexagon;LoongArch;MSP430;Mips;NVPTX;PowerPC;RISCV;Sparc;SystemZ;WebAssembly;X86" "-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=AVR;M68k;CSKY" "-DLLVM_INCLUDE_EXAMPLES=OFF" "-DLLVM_INCLUDE_DOCS=OFF" "-DLLVM_INCLUDE_BENCHMARKS=OFF" "-DLLVM_INCLUDE_TESTS=OFF" "-DLLVM_ENABLE_TERMINFO=OFF" "-DLLVM_ENABLE_LIBEDIT=OFF" "-DLLVM_ENABLE_BINDINGS=OFF" "-DLLVM_ENABLE_Z3_SOLVER=OFF" "-DLLVM_PARALLEL_COMPILE_JOBS=8" "-DLLVM_TARGET_ARCH=wasm32" "-DLLVM_DEFAULT_TARGET_TRIPLE=wasm32-unknown-unknown" "-DLLVM_ENABLE_WARNINGS=OFF" "-DLLVM_INSTALL_UTILS=ON" "-DLLVM_ENABLE_ZSTD=OFF" "-DLLVM_ENABLE_ZLIB=ON" "-DLLVM_LINK_LLVM_DYLIB=ON" "-DLLVM_ENABLE_LIBXML2=OFF" "-DLLVM_TABLEGEN=/checkout/obj/build/x86_64-unknown-linux-gnu/ci-llvm/bin/llvm-tblgen" "-DLLVM_NM=/checkout/obj/build/x86_64-unknown-linux-gnu/ci-llvm/bin/llvm-nm" "-DLLVM_CONFIG_PATH=/checkout/obj/build/x86_64-unknown-linux-gnu/ci-llvm/bin/llvm-config" "-DLLVM_VERSION_SUFFIX=-rust-1.78.0-nightly" "-DCMAKE_INSTALL_MESSAGE=LAZY" "-DCMAKE_CROSSCOMPILING=True" "-DCMAKE_C_COMPILER_LAUNCHER=sccache" "-DCMAKE_CXX_COMPILER_LAUNCHER=sccache" "-DCMAKE_C_COMPILER=clang-11" "-DCMAKE_CXX_COMPILER=clang" "-DCMAKE_ASM_COMPILER=clang-11" "-DCMAKE_C_FLAGS=-ffunction-sections -fdata-sections -fPIC --target=wasm32-unknown-unknown" "-DCMAKE_CXX_FLAGS=-ffunction-sections -fdata-sections -fPIC --target=wasm32-unknown-unknown" "-DCMAKE_SHARED_LINKER_FLAGS=" "-DCMAKE_MODULE_LINKER_FLAGS=" "-DCMAKE_EXE_LINKER_FLAGS=" "-DCMAKE_INSTALL_PREFIX=/checkout/obj/build/wasm32-unknown-unknown/llvm" "-DCMAKE_ASM_FLAGS= -ffunction-sections -fdata-sections -fPIC --target=wasm32-unknown-unknown" "-DCMAKE_BUILD_TYPE=Release"
-- The CXX compiler identification is unknown
-- The ASM compiler identification is Clang with GNU-like command-line
-- Found assembler: /usr/bin/clang-11
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: /usr/bin/clang-11
-- Check for working C compiler: /usr/bin/clang-11 - broken
CMake Error at /usr/share/cmake-3.22/Modules/CMakeTestCCompiler.cmake:69 (message):

    "/usr/bin/clang-11"

  is not able to compile a simple test program.
  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /checkout/obj/build/wasm32-unknown-unknown/llvm/build/CMakeFiles/CMakeTmp
    
    Run Build Command(s):/usr/bin/ninja cmTC_7cb52 && [1/2] Building C object CMakeFiles/cmTC_7cb52.dir/testCCompiler.c.o
    [2/2] Linking C executable cmTC_7cb52
    FAILED: cmTC_7cb52 
    : && /usr/bin/clang-11 -ffunction-sections -fdata-sections -fPIC --target=wasm32-unknown-unknown  CMakeFiles/cmTC_7cb52.dir/testCCompiler.c.o -o cmTC_7cb52   && :
    clang: error: unable to execute command: Executable "wasm-ld" doesn't exist!
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    ninja: build stopped: subcommand failed.
    

  

---
    clang

  is not a full path and was not found in the PATH.

  Tell CMake where to find the compiler by setting either the environment
  variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
  to the compiler, or to the compiler name if it is in the PATH.


-- Configuring incomplete, errors occurred!
See also "/checkout/obj/build/wasm32-unknown-unknown/llvm/build/CMakeFiles/CMakeOutput.log".
See also "/checkout/obj/build/wasm32-unknown-unknown/llvm/build/CMakeFiles/CMakeError.log".
thread 'main' panicked at /cargo/registry/src/index.crates.io-6f17d22bba15001f/cmake-0.1.48/src/lib.rs:975:5:
command did not execute successfully, got: exit status: 1

build script failed, must exit now
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

@bors
Copy link
Contributor

bors commented Mar 10, 2024

💔 Test failed - checks-actions

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

#122257, part of this rollup, got taken back.

@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-review Status: Awaiting review from the assignee but also interested parties. labels Mar 10, 2024
@matthiaskrgr matthiaskrgr deleted the rollup-uik3gaz branch March 16, 2024 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rollup A PR which is a rollup S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging this pull request may close these issues.