about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/errors.rs
diff options
context:
space:
mode:
authorJubilee <workingjubilee@gmail.com>2024-10-24 15:53:33 -0700
committerGitHub <noreply@github.com>2024-10-24 15:53:33 -0700
commitf8af0aad41786911562e24eed445f6bf5dd53aa1 (patch)
tree62ab478b61c95800422cc056a836013da6c00350 /compiler/rustc_codegen_llvm/src/errors.rs
parent1d4a7670d4f37bfbae2d89ec3ec07cd40dbc5a5d (diff)
parent7f74c894b0e31f370b5321d94f2ca2830e1d30fd (diff)
downloadrust-f8af0aad41786911562e24eed445f6bf5dd53aa1.tar.gz
rust-f8af0aad41786911562e24eed445f6bf5dd53aa1.zip
Rollup merge of #131851 - sunshowers:musl-posix, r=workingjubilee
[musl] use posix_spawn if a directory change was requested

Currently, not all libcs have the `posix_spawn_file_actions_addchdir_np` symbol available to them. So we attempt to do a weak symbol lookup for that function. But that only works if libc is a dynamic library -- with statically linked musl binaries the symbol lookup would never work, so we would never be able to use it even if the musl in use supported the symbol.

Now that Rust has a minimum musl version of 1.2.3, all supported musl versions now include this symbol, so we can unconditionally expect it to be there. This symbol was added to libc in https://github.com/rust-lang/libc/pull/3949 -- use it here.

I couldn't find any tests for whether the posix_spawn path is used, but I've verified with cargo-nextest that this change works. This is a substantial improvement to nextest's performance with musl. On my workstation with a Ryzen 7950x, against https://github.com/clap-rs/clap at
61f5ee514f8f60ed8f04c6494bdf36c19e7a8126:

Before:

```
     Summary [   1.071s] 879 tests run: 879 passed, 0 skipped
```

After:

```
     Summary [   0.392s] 879 tests run: 879 passed, 0 skipped
```

Fixes #99740.

try-job: dist-various-1
try-job: dist-various-2
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/errors.rs')
0 files changed, 0 insertions, 0 deletions