Commit graph

155127 commits

Author SHA1 Message Date
bors
c1566141b6 Auto merge of #134865 - clubby789:proc-macro-tls, r=onur-ozkan
bootstrap: Don't apply -Ztls-model=initial-exec to deps of proc-macros

Fixes #134863

1. Checks if a crate name is in a static list before applying the flag
2. Adds a tidy check that gathers transitive deps of proc macros and ensures the list is up to date

cc `@bjorn3` - the issue specifies `rustc_fluent_macro` but I assume this applies to all proc macro crates.
2024-12-30 07:26:13 +00:00
bors
6cd33d889d Auto merge of #134901 - matthiaskrgr:rollup-b0wwuht, r=matthiaskrgr
Rollup of 4 pull requests

Successful merges:

 - #134870 (Fix sentence fragment in `pin` module docs)
 - #134884 (Fix typos)
 - #134892 (Added codegen test for elidings bounds check when indexes are manually checked)
 - #134894 (Document how to run the split Docker pipelines)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-12-29 23:16:13 +00:00
clubby789
f0734626cd bootstrap: Don't apply -Ztls-model=initial-exec to deps of proc-macros 2024-12-29 21:48:06 +00:00
clubby789
f4d215ea91 Add tidy check for list of proc-macro crate transitive dependencies 2024-12-29 21:48:03 +00:00
Matthias Krüger
e178795dba
Rollup merge of #134894 - Kobzol:docker-ci-documentation, r=the8472
Document how to run the split Docker pipelines

r? `@the8472`
2024-12-29 21:18:08 +01:00
Matthias Krüger
344a61e69b
Rollup merge of #134884 - calciumbe:patch1, r=jieyouxu
Fix typos

Hello, I fix some typos in docs and comments. Thank you very much.
2024-12-29 21:18:07 +01:00
bors
14ee63a3c6 Auto merge of #134765 - Noratrieb:linux-none-cant-unwind-silly, r=jieyouxu
Improve default target options for x86_64-unknown-linux-none

Without a standard library, we cannot unwind, so it should be panic=abort by default.

Additionally, it does not have std because while it is Linux, it cannot use libc, which std uses today for Linux.

Using PIE by default may be surprising to users, as shown in #134763, so I've documented it explicitly. I'm not sure if we want to count that as fixing the issue or not.

cc `@morr0ne,` as you added the target (and are the maintainer), and `@Noratrieb,` who reviewed that PR (:D).
2024-12-29 20:10:37 +00:00
Noratrieb
b235cc9e70 Document x86_64-unknown-linux-none is PIE by default 2024-12-29 18:12:34 +01:00
Jakub Beránek
9007cb15e4 Document how to run the split Docker pipelines 2024-12-29 18:02:14 +01:00
bors
5c0a6e68cf Auto merge of #134891 - dxsullivan:fix-typo, r=GuillaumeGomez
docs: fix typos

Fix typos in docs. Thank you.
2024-12-29 16:11:20 +00:00
dxsullivan
0ebdc0c431 docs: fix typos 2024-12-29 21:51:30 +08:00
calciumbe
4f8bebd6b5
fix: typos
Signed-off-by: calciumbe <192480234+calciumbe@users.noreply.github.com>
2024-12-29 21:35:02 +08:00
bors
64feb9b502 Auto merge of #134887 - Zalathar:rollup-ghpz7oy, r=Zalathar
Rollup of 5 pull requests

Successful merges:

 - #134799 (nits: Cleanups in `librustdoc::clean`)
 - #134851 (docs: inline `alloc::ffi::c_str` types to `alloc::ffi`)
 - #134869 (Bump compiler cc)
 - #134876 (bootstrap: Consolidate the macros for declaring compiletest test suites)
 - #134883 (bootstrap: Fix `./x check bootstrap` by moving `shared_helpers::tests`)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-12-29 12:43:22 +00:00
Stuart Cook
fc89cb202f
Rollup merge of #134883 - Zalathar:shared-helpers, r=clubby789
bootstrap: Fix `./x check bootstrap` by moving `shared_helpers::tests`

Running `./x check bootstrap` currently doesn't work, because it builds the bootstrap shim binaries with `cfg(test)`, and those binaries can't find a `tests` submodule when they include `shared_helpers.rs` via `#[path]`.

This PR fixes that by taking the tests module and moving it to `super::tests::shared_helpers_tests` instead.

(The extra `tests` submodule prevents tidy from complaining about unit tests that aren't in a dedicated tests module.)

---

It would be nice to also run `./x check bootstrap compiletest` in CI, so that this and #134848 don't regress, but I didn't want to bundle that change with this fix.
2024-12-29 22:45:39 +11:00
Stuart Cook
a43730b2af
Rollup merge of #134876 - Zalathar:bootstrap-test-macros, r=jieyouxu
bootstrap: Consolidate the macros for declaring compiletest test suites

Instead of using a dizzying assortment of different macros to declare these test suite steps, we can mostly just use one `test!` macro with a few optional named arguments.

I'm pretty sure that this doesn't change any behaviour, but please do double-check each of the individual declarations.
2024-12-29 22:45:38 +11:00
Stuart Cook
42a372fd7f
Rollup merge of #134799 - poliorcetics:ab/push-xuxotrnrtysz, r=GuillaumeGomez
nits: Cleanups in `librustdoc::clean`

r? ````@GuillaumeGomez````
2024-12-29 22:45:36 +11:00
bors
e7738afb70 Auto merge of #134650 - onur-ozkan:clean-up-fixmes, r=Kobzol
Clean up some FIXME notes on bootstrap

Fixing and removing some FIXME notes.
2024-12-29 10:04:55 +00:00
Zalathar
4192293b4d Fix ./x check bootstrap by moving shared_helpers::tests 2024-12-29 20:49:03 +11:00
Zalathar
1e37bbe2de Allow macro-declared test steps to have docstrings and attributes 2024-12-29 15:50:47 +11:00
Zalathar
7b7f634cac Consolidate the macros for declaring compiletest suites 2024-12-29 15:50:47 +11:00
bors
480eec0692 Auto merge of #134867 - rust-lang:cargo_update, r=clubby789
Weekly `cargo update`

Automation to keep dependencies in `Cargo.lock` current.

The following is the output from `cargo update`:

```txt

compiler & tools dependencies:
     Locking 8 packages to latest compatible versions
    Updating anyhow v1.0.94 -> v1.0.95
    Updating glob v0.3.1 -> v0.3.2
    Updating quote v1.0.37 -> v1.0.38
    Updating rustversion v1.0.18 -> v1.0.19
    Updating serde v1.0.216 -> v1.0.217
    Updating serde_derive v1.0.216 -> v1.0.217
    Updating syn v2.0.90 -> v2.0.93
    Updating unicase v2.8.0 -> v2.8.1
note: pass `--verbose` to see 36 unchanged dependencies behind latest

library dependencies:
     Locking 0 packages to latest compatible versions
note: pass `--verbose` to see 5 unchanged dependencies behind latest

rustbook dependencies:
     Locking 7 packages to latest compatible versions
    Updating anyhow v1.0.94 -> v1.0.95
    Updating cc v1.2.5 -> v1.2.6
    Updating quote v1.0.37 -> v1.0.38
    Updating serde v1.0.216 -> v1.0.217
    Updating serde_derive v1.0.216 -> v1.0.217
    Updating syn v2.0.90 -> v2.0.93
    Updating unicase v2.8.0 -> v2.8.1
```
2024-12-29 03:16:29 +00:00
bors
0b63477350 Auto merge of #134864 - Zalathar:rollup-suc8ay9, r=Zalathar
Rollup of 3 pull requests

Successful merges:

 - #134849 (compiletest: Slightly simplify the handling of debugger directive prefixes)
 - #134850 (Document virality of `feature(rustc_private)`)
 - #134852 (Added a codegen test for optimization with const arrays)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-12-29 00:38:26 +00:00
github-actions
519c233cbb cargo update
compiler & tools dependencies:
     Locking 8 packages to latest compatible versions
    Updating anyhow v1.0.94 -> v1.0.95
    Updating glob v0.3.1 -> v0.3.2
    Updating quote v1.0.37 -> v1.0.38
    Updating rustversion v1.0.18 -> v1.0.19
    Updating serde v1.0.216 -> v1.0.217
    Updating serde_derive v1.0.216 -> v1.0.217
    Updating syn v2.0.90 -> v2.0.93
    Updating unicase v2.8.0 -> v2.8.1
note: pass `--verbose` to see 36 unchanged dependencies behind latest

library dependencies:
     Locking 0 packages to latest compatible versions
note: pass `--verbose` to see 5 unchanged dependencies behind latest

rustbook dependencies:
     Locking 7 packages to latest compatible versions
    Updating anyhow v1.0.94 -> v1.0.95
    Updating cc v1.2.5 -> v1.2.6
    Updating quote v1.0.37 -> v1.0.38
    Updating serde v1.0.216 -> v1.0.217
    Updating serde_derive v1.0.216 -> v1.0.217
    Updating syn v2.0.90 -> v2.0.93
    Updating unicase v2.8.0 -> v2.8.1
2024-12-29 00:22:58 +00:00
Stuart Cook
8060f58150
Rollup merge of #134850 - tamird:rustc-private-book-update, r=bjorn3
Document virality of `feature(rustc_private)`

Closes #134825.

r? `@bjorn3`
2024-12-29 10:00:18 +11:00
Stuart Cook
a8a10110e0
Rollup merge of #134849 - Zalathar:debuginfo-prefixes, r=lqd,clubby789,jieyouxu
compiletest: Slightly simplify the handling of debugger directive prefixes

The `cdbg-` prefix is not used by any tests in `tests/debuginfo`, and perhaps there never were any tests that used it.

Getting rid of it also lets us get rid of the code for parsing multiple prefixes at the same time, since every debugger now has exactly one prefix.
2024-12-29 10:00:18 +11:00
Alexis (Poliorcetics) Bourget
f5c497529c
nits: librustdoc::clean
- librustdoc::clean::clean_lifetime doesn't need a mut doc context
- librustdoc::clean::normalize doesn't need a mut doc context
- move Some() wrapping up into `clean_predicate()`
- simplify nested if in librustdoc::clean::record_extern_fqn()
2024-12-28 23:53:18 +01:00
bors
b76036c88c Auto merge of #134848 - Zalathar:check-compiletest, r=jieyouxu
bootstrap: Allow `./x check compiletest`

Did you know that bootstrap didn't support `./x check compiletest`? Well, now it does!

Manually add `"compiletest"` to your `rust-analyzer.check.overrideCommand` check command to get error/warning integration when modifying compiletest.
2024-12-28 22:00:11 +00:00
bors
8742e0556d Auto merge of #134845 - jieyouxu:temp-drop-warning, r=onur-ozkan
bootstrap: drop warning for top-level test suite path check due to false positives

The current top-level test suite directory does not exist warning logic doesn't quite handle the more exotic path suffix matches that test filters seem to accept (e.g. `library/test` can be matched with `--exclude test`), so avoid warning on non-existent top-level test suites for now. To avoid false positives, we probably need to query test `Step`s for their `should_run(exclude_filter)` logic.

This retains the fix for the Windows path handling (unlike #134843).

r? `@onur-ozkan`
2024-12-28 19:20:22 +00:00
Tamir Duberstein
35e5c7d438
Document virality of feature(rustc_private)
Since 9cb1998ea1 this feature is viral.
2024-12-28 11:45:25 -05:00
bors
ceb0441e82 Auto merge of #134790 - onur-ozkan:cfg-test, r=clubby789
replace bootstrap-self-test feature flag with cfg(test)

This makes it in more rusty way.
2024-12-28 16:37:13 +00:00
Zalathar
2f8824a477 Simplify DebuggerCommands::parse_from to only take one prefix 2024-12-29 00:09:25 +11:00
Zalathar
a625ddd1ed Remove the unused cdbg-* debugger directive prefix
There are no tests in `tests/debuginfo` that use this prefix.
2024-12-29 00:09:25 +11:00
Zalathar
c1c2d85cc9 bootstrap: Allow ./x check compiletest 2024-12-28 23:23:41 +11:00
许杰友 Jieyou Xu (Joe)
c393811a48 bootstrap: drop warning for top-level test suite path check
This doesn't quite handle the more exotic path suffix matches that test
filters seem to accept (e.g. `library/test` can be matched with
`--exclude test`), so avoid warning on non-existent top-level test
suites for now. A proper fix will need to possibly query test `Step`s
for their exclude logic.
2024-12-28 17:55:05 +08:00
onur-ozkan
eedafbc92f remove deprecated option parallel-compiler
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-12-28 11:35:29 +03:00
onur-ozkan
47cd3e7c61 read to String directly without extra conversion
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-12-28 11:34:00 +03:00
onur-ozkan
ec9502d803 remove an invalid FIXME note
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-12-28 11:33:57 +03:00
Stuart Cook
41c74f4fb6
Rollup merge of #134840 - Zalathar:normalize, r=jieyouxu
compiletest: Only pass the post-colon value to `parse_normalize_rule`

Addresses one of the FIXMEs noted in #134759.

I started working on the other FIXME, but it became complex enough that I wanted to split it off from this PR.

r? jieyouxu
2024-12-28 16:50:39 +11:00
Stuart Cook
3048c4adfc
Rollup merge of #134829 - jieyouxu:migrate-libs-through-symlinks, r=lqd
Migrate `libs-through-symlink` to rmake.rs

Part of https://github.com/rust-lang/rust/issues/121876.

This PR migrates `tests/run-make/libs-through-symlink/` to use rmake.rs.

- Regression test for #13890.
- Original fix PR is #13903.
- Document test intent, backlink to #13890 and fix PR #13903.
- Fix the test logic: the `Makefile` version seems to not actually be exercising the "library search traverses symlink" logic, because the actual symlinked-to-library is present under the `$(TMPDIR)` directory tree when `bar.rs` is compiled, because the `$(RUSTC)` invocation has an implicit `-L $(TMPDIR)`. The symlink itself was actually broken, i.e. it should've been `ln -nsf $(TMPDIR)/outdir/$(NAME) $(TMPDIR)` but it used `ln -nsf outdir/$(NAME) $(TMPDIR)`. The rmake.rs version now explicitly separates the two directory trees and sets the CWD of the `bar.rs` rustc invocation so that the actual library is *not* present under its CWD tree.

I.e. it is now

```
$test_output/           # rustc foo.rs -o actual_lib_dir/libfoo.rlib
    actual_lib_dir/
        libfoo.rlib
    symlink_lib_dir/    # CWD set; rustc -L . bar.rs
        libfoo.rlib --> $test_output/actual_lib_dir/libfoo.rlib
```

Partially supersedes #129011.
This PR is co-authored with `@Oneirical.`

r? compiler
2024-12-28 16:50:38 +11:00
许杰友 Jieyou Xu (Joe)
b32591e580 tests: migrate branch-protection-check-IBT to rmake.rs
- The Makefile version *never* ran because of Makefile syntax confusion.
- The test would've always failed because precompiled std is not built
  with `-Z cf-protection=branch`, but linkers require all input object
  files to indicate IBT support in order to enable IBT for the
  executable, which is not the case for std.
- Thus, the test input file is instead changed to a `no_std` + `no_core`
  program.

Co-authored-by: Jerry Wang <jerrylwang123@gmail.com>
Co-authored-by: Oneirical <manchot@videotron.ca>
2024-12-28 11:58:32 +08:00
许杰友 Jieyou Xu (Joe)
b77ab2dd90 tests: migrate libs-through-symlink to rmake.rs
- Document test intent, backlink to #13890 and fix PR #13903.
- Fix the test logic: the `Makefile` version seems to not actually be
  exercising the "library search traverses symlink" logic, because the
  actual symlinked-to-library is present under the directory tree when
  `bar.rs` is compiled, because the `$(RUSTC)` invocation has an
  implicit `-L $(TMPDIR)`. The symlink itself was actually broken, i.e.
  it should've been `ln -nsf $(TMPDIR)/outdir/$(NAME) $(TMPDIR)` but it
  used `ln -nsf outdir/$(NAME) $(TMPDIR)`.

Co-authored-by: Oneirical <manchot@videotron.ca>
2024-12-28 11:53:01 +08:00
Zalathar
f55736365a compiletest: Make a FIXME for escaped newlines less confusing
The old FIXME implies that we don't support escaped newlines, but in fact it
was added in the same patch that added support for escaped newlines.

The new FIXME makes it clear that we do currently support this, and that the
FIXME is for doing so in a less ad-hoc way.
2024-12-28 14:23:46 +11:00
Zalathar
3a4e82195e compiletest: Only pass the post-colon value to parse_normalize_rule 2024-12-28 13:57:13 +11:00
bors
ecc189922d Auto merge of #134690 - clubby789:ci-clang-lto, r=Kobzol
CI: Add LTO support to clang in dist-x86_64-linux

After https://github.com/rust-lang/cc-rs/pull/1279, we attempt to pass `-flto=thin` to clang. In `dist-x86_64-linux`, we don't build clang with the `LLVMgold.so` library so this fails. This attempts to resolve this
First, pass the binutils plugin include directory to Clang, [which will build the library](2d6d723a85/llvm/docs/GoldPlugin.rst (how-to-build-it))
Second, this library depends on the *version of libstdc++ that we built* specifically. However, despite both the RPATH and LD_LIBRARY_PATH pointing to `/rustroot/lib`, we incorrectly resolve to the system libstdc++, which doesn't load.
```
# LD_DEBUG=libs,files
      2219:    file=libstdc++.so.6 [0];  needed by /rustroot/bin/../lib/LLVMgold.so [0]
      2219:    find library=libstdc++.so.6 [0]; searching
      2219:     search path=/rustroot/bin/../lib/../lib        (RPATH from file /rustroot/bin/../lib/LLVMgold.so)
      2219:      trying file=/rustroot/bin/../lib/../lib/libstdc++.so.6
      2219:     search path=/usr/lib64/tls:/usr/lib64        (system search path)
      2219:      trying file=/usr/lib64/tls/libstdc++.so.6
      2219:      trying file=/usr/lib64/libstdc++.so.6
```

Using `LD_PRELOAD` causes it to correctly load the library

I think this is probably not the most maintainable way to do this, so opening to see if this is desired and if there's a better way of doing this
2024-12-27 23:22:08 +00:00
bors
dd84b7d5ee Auto merge of #134830 - matthiaskrgr:rollup-7hdjojz, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #133663 (Add a compiler intrinsic to back `bigint_helper_methods`)
 - #134798 (Make `ty::Error` implement all auto traits)
 - #134808 (compiletest: Remove empty 'expected' files when blessing)
 - #134809 (Add `--no-capture`/`--nocapture` as bootstrap arguments)
 - #134826 (Add spastorino to users_on_vacation)
 - #134828 (Add clubby789 back to bootstrap review rotation)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-12-27 19:30:32 +00:00
Matthias Krüger
5b249f813b
Rollup merge of #134809 - clubby789:nocapture, r=jieyouxu
Add `--no-capture`/`--nocapture` as bootstrap arguments

I often try `x test ... --nocapture` => 'unknown argument' => `x test ... -- --nocapture`. As we forward several other compiletest flags, let's recognise this one in bootstrap as well.
2024-12-27 19:47:11 +01:00
Matthias Krüger
7ba9655cce
Rollup merge of #134808 - clubby789:compiletest-remove-stderr, r=jieyouxu
compiletest: Remove empty 'expected' files when blessing

Fixes #134793
Fixes #134196

This also refactors `compare_output` to return an enum; returning a usize was done for convenience but is misleading
2024-12-27 19:47:11 +01:00
bors
e5f0d6ffbd Auto merge of #134803 - clubby789:strip-debuginfo, r=Kobzol
Strip debuginfo from rustc-main and rustdoc

r? `@Kobzol`
Split from #134690
2024-12-27 16:50:53 +00:00
许杰友 Jieyou Xu (Joe)
f65dc4f375
Rollup merge of #134816 - Integral-Tech:pathbuf-refactor, r=lqd
tools: fix build failure caused by PR #134420

Someone reports build failure after merging pull request #134420: https://github.com/rust-lang/rust/pull/134420#discussion_r1898081258

This pull request fixes the build failure.
2024-12-27 20:44:15 +08:00
许杰友 Jieyou Xu (Joe)
3980cc6521
Rollup merge of #134815 - 9names:sort_platform_md_targets, r=jieyouxu
Sort triples by name in platform_support.md

When looking for riscv32emc support, I missed it at first because it was at the end of the tier3 target list [here](https://doc.rust-lang.org/rustc/platform-support.html#tier-3). These lists are *mostly* dictionary sorted so I assumed it should be near the riscv32i* targets.

This PR puts all targets back in dictionary order. There were only a few outside of tier3.

I ended up writing a small program to sort them because I did not trust myself to do it manually, but I stopped short of fully automating it.
I have manually reviewed the output to confirm it still has the same number of entries, and that the changed values do follow the ordering I would expect.

For folks who would prefer to review code than manual textual changes, the sorting program (including inputs) is [here.](https://github.com/9names/platform_sort_arch/blob/main/src/main.rs)
2024-12-27 20:44:14 +08:00