about summary refs log tree commit diff
path: root/tests/run-make
AgeCommit message (Collapse)AuthorLines
2025-01-29tests: port `translation` to rmake.rs许杰友 Jieyou Xu (Joe)-78/+194
Co-authored-by: Oneirical <manchot@videotron.ca>
2025-01-28Auto merge of #133929 - saethlin:remove-inline-in-all-cgus, r=nnethercotebors-127/+0
Remove -Zinline-in-all-cgus and clean up tests/codegen-units/ Implementation of https://github.com/rust-lang/compiler-team/issues/814 I've taken some liberties with cleaning up the CGU partitioning tests, because that's the only place this flag was used and also mattered. I've often fought a lot with the contents of `tests/codegen-units` and it has never been clear to me when a test failure indicates a problem with my changes as opposed to a test just needing to be manually blessed. Hopefully the combination of the new README, new comments, and using `-Zprint-mono-items=lazy` in the partitioning tests improves that. I've also deleted some of the `tests/run-make/sepcomp` tests. I think all the "sepcomp" tests have been obviated for years by better-designed (less flaky, clearer failures) test suites, but here I'm just deleting the ones I'm confident in.
2025-01-27Remove -Zinline-in-all-cgus and clean up CGU partitioning testsBen Kimock-127/+0
2025-01-26Downgrade `linker-warnings` to allow-by-defaultjyn-5/+19
This needs more time to bake before we turn it on. Turning it on early risks people silencing the warning indefinitely, before we have the chance to make it less noisy.
2025-01-25Shorten linker output even more when `--verbose` is not presentjyn-11/+42
- Don't show environment variables. Seeing PATH is almost never useful, and it can be extremely long. - For .rlibs in the sysroot, replace crate hashes with a `"-*"` string. This will expand to the full crate name when pasted into the shell. - Move `.rlib` to outside the glob. - Abbreviate the sysroot path to `<sysroot>` wherever it appears in the arguments. This also adds an example of the linker output as a run-make test. Currently it only runs on x86_64-unknown-linux-gnu, because each platform has its own linker arguments. So that it's stable across machines, pass BUILD_ROOT as an argument through compiletest through to run-make tests. - Only use linker-flavor=gnu-cc if we're actually going to compare the output. It doesn't exist on MacOS.
2025-01-25Auto merge of #119286 - jyn514:linker-output, r=bjorn3bors-30/+73
show linker output even if the linker succeeds Show stderr and stderr by default, controlled by a new `linker_messages` lint. fixes https://github.com/rust-lang/rust/issues/83436. fixes https://github.com/rust-lang/rust/issues/38206. cc https://rust-lang.zulipchat.com/#narrow/stream/233931-t-compiler.2Fmajor-changes/topic/uplift.20some.20-Zverbose.20calls.20and.20rename.20to.E2.80.A6.20compiler-team.23706/near/408986134 <!-- try-job: dist-x86_64-msvc --> try-job: aarch64-apple r? `@bjorn3`
2025-01-24Allow LLD version info to be either stderr or stdoutjyn-1/+1
2025-01-23Auto merge of #135461 - jieyouxu:migrate-jobserver-errors, r=Noratriebbors-18/+48
tests: Port `jobserver-error` to rmake.rs Part of #121876. This PR ports `tests/run-make/jobserver-error` to rmake.rs, and is basically #128789 slightly adjusted. The complexity involved here is mostly how to get `/dev/null/` piping to fd 3 working with std `Command`, whereas with a shell this is much easier (as is evident with the `Makefile` version). Supersedes #128789. This PR is co-authored with `@Oneirical` and `@coolreader18.` try-job: aarch64-gnu try-job: i686-gnu-1 try-job: x86_64-gnu-debug try-job: x86_64-gnu-llvm-18-1
2025-01-23Auto merge of #135164 - Kobzol:run-make-test-glibc-symbols, r=jieyouxubors-0/+112
Add test for checking used glibc symbols This test checks that we do not use too new glibc symbols in the compiler on x64 GNU Linux, in order not to break our [glibc promises](https://blog.rust-lang.org/2022/08/01/Increasing-glibc-kernel-requirements.html). One thing that isn't solved in the PR yet is to make sure that this test will only run on `dist` CI, more specifically on the `dist-x86_64-linux` runner, in the opt-dist post-optimization tests (it can fail elsewhere, that doesn't matter). Any suggestions on how to do that are welcome. Fixes: https://github.com/rust-lang/rust/issues/134037 r? `@jieyouxu`
2025-01-22Reword comment slightlyJakub Beránek-1/+3
2025-01-22Use objdump instead of llvm-objdumpJakub Beránek-2/+4
2025-01-22Run the glibc run-make test in opt-distJakub Beránek-1/+1
2025-01-22tests: port `jobserver-error.rs` to rmake.rs许杰友 Jieyou Xu (Joe)-18/+48
Co-authored-by: Noa <coolreader18@gmail.com> Co-authored-by: Oneirical <manchot@videotron.ca>
2025-01-21Rollup merge of #135824 - jieyouxu:delete-bintools-check, r=NoratriebMatthias Krüger-50/+0
tests: delete `cat-and-grep-sanity-check` Part of #121876. All remaining `Makefile`s have open PRs that do not rely on platform `cat` or `grep` or the `cat-and-grep` script.
2025-01-21Auto merge of #134299 - RalfJung:remove-start, r=compiler-errorsbors-10/+9
remove support for the (unstable) #[start] attribute As explained by `@Noratrieb:` `#[start]` should be deleted. It's nothing but an accidentally leaked implementation detail that's a not very useful mix between "portable" entrypoint logic and bad abstraction. I think the way the stable user-facing entrypoint should work (and works today on stable) is pretty simple: - `std`-using cross-platform programs should use `fn main()`. the compiler, together with `std`, will then ensure that code ends up at `main` (by having a platform-specific entrypoint that gets directed through `lang_start` in `std` to `main` - but that's just an implementation detail) - `no_std` platform-specific programs should use `#![no_main]` and define their own platform-specific entrypoint symbol with `#[no_mangle]`, like `main`, `_start`, `WinMain` or `my_embedded_platform_wants_to_start_here`. most of them only support a single platform anyways, and need cfg for the different platform's ways of passing arguments or other things *anyways* `#[start]` is in a super weird position of being neither of those two. It tries to pretend that it's cross-platform, but its signature is a total lie. Those arguments are just stubbed out to zero on ~~Windows~~ wasm, for example. It also only handles the platform-specific entrypoints for a few platforms that are supported by `std`, like Windows or Unix-likes. `my_embedded_platform_wants_to_start_here` can't use it, and neither could a libc-less Linux program. So we have an attribute that only works in some cases anyways, that has a signature that's a total lie (and a signature that, as I might want to add, has changed recently, and that I definitely would not be comfortable giving *any* stability guarantees on), and where there's a pretty easy way to get things working without it in the first place. Note that this feature has **not** been RFCed in the first place. *This comment was posted [in May](https://github.com/rust-lang/rust/issues/29633#issuecomment-2088596042) and so far nobody spoke up in that issue with a usecase that would require keeping the attribute.* Closes https://github.com/rust-lang/rust/issues/29633 try-job: x86_64-gnu-nopt try-job: x86_64-msvc-1 try-job: x86_64-msvc-2 try-job: test-various
2025-01-21remove support for the #[start] attributeRalf Jung-10/+9
2025-01-21tests: delete `cat-and-grep-sanity-check`许杰友 Jieyou Xu (Joe)-50/+0
All remaining `Makefile`s have open PRs that do not rely on platform `cat` or `grep`.
2025-01-21Add test for checking used glibc symbolsJakub Beránek-0/+108
2025-01-20Don't require `--verbose` to show linker stdoutjyn-21/+8
2025-01-20don't ICE when emitting linker errors during `-Z link-only`jyn-0/+29
note that this still ICEs when passed `-Z link-only --error-format json` because i can't be bothered to fix it right now
2025-01-20show linker warnings even if it returns 0jyn-24/+51
2025-01-19When LLVM's location discriminator value limit is exceeded, emit locations ↵Kyle Huey-0/+76
with dummy spans instead of dropping them entirely Revert most of #133194 (except the test and the comment fixes). Then refix not emitting locations at all when the correct location discriminator value exceeds LLVM's capacity.
2025-01-18Fix use of pipe in tests/run-make/broken-pipe-no-ice/rmake.rsJiahao XU-1/+1
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2025-01-16Auto merge of #135458 - jieyouxu:migrate-extern-fn-reachable, r=lqdbors-26/+61
tests: Port `extern-fn-reachable` to rmake.rs Part of #121876. ## Summary This PR ports `tests/run-make/extern-fn-reachable` to use `rmake.rs`. Notable changes: - We now use the `object` crate and look at the exported symbols specifically. - This test's coverage regressed against windows-msvc back in [replace dynamic library module with libloading #90716](https://github.com/rust-lang/rust/pull/90716), but since we use `object` now, we're able to claw the test coverage back. - The checks are now stricter: 1. It no longer looks for substring symbol matches in `nm` textual outputs, it inspects the symbol names precisely. 2. We now also explicitly check for the presence of leading underscore in exported symbol names on apple vs non-apple targets. - Added another case of `#[no_mangle] fn fun6() {}` (note the lack of `pub`) to check that Rust nameres visibility is orthogonal to symbol visibility in dylib. ## History - Test was initially introduced as a run-pass[^run-pass] test as part of [Don't mark reachable extern fns as internal #10539](https://github.com/rust-lang/rust/pull/10539). - Test re-introduced as a run-make test in https://github.com/rust-lang/rust/pull/13741. - Later, the test coverage regressed in https://github.com/rust-lang/rust/pull/90716. [^run-pass]: no longer a thing nowadays Supersedes #128314. Co-authored with `@lolbinarycat.` try-job: x86_64-msvc try-job: i686-msvc try-job: i686-mingw try-job: x86_64-mingw-1 try-job: x86_64-apple-1 try-job: aarch64-apple try-job: test-various
2025-01-15tests: port `extern-fn-reachable` to rmake.rs许杰友 Jieyou Xu (Joe)-26/+61
Co-authored-by: binarycat <binarycat@envs.net>
2025-01-14fix typo and unit testbinarycat-1/+2
2025-01-11re-add --disable-minification to rustdocbinarycat-1/+1
this also makes the rust.docs-minification option work as advertised in config.toml nothing fancy this time, this is intended to be perma-unstable. it's only really here for the benefit of rustdoc devs. mitegates https://github.com/rust-lang/rust/issues/135345
2025-01-06Replace the random substring of a linker argument with a placeholder and ↵Xing Xue-3/+44
nullify the timestamp field of XCOFF files for file comparison.
2025-01-05Auto merge of #134794 - RalfJung:abi-required-target-features, r=workingjubileebors-1/+1
Add a notion of "some ABIs require certain target features" I think I finally found the right shape for the data and checks that I recently added in https://github.com/rust-lang/rust/pull/133099, https://github.com/rust-lang/rust/pull/133417, https://github.com/rust-lang/rust/pull/134337: we have a notion of "this ABI requires the following list of target features, and it is incompatible with the following list of target features". Both `-Ctarget-feature` and `#[target_feature]` are updated to ensure we follow the rules of the ABI. This removes all the "toggleability" stuff introduced before, though we do keep the notion of a fully "forbidden" target feature -- this is needed to deal with target features that are actual ABI switches, and hence are needed to even compute the list of required target features. We always explicitly (un)set all required and in-conflict features, just to avoid potential trouble caused by the default features of whatever the base CPU is. We do this *before* applying `-Ctarget-feature` to maintain backward compatibility; this poses a slight risk of missing some implicit feature dependencies in LLVM but has the advantage of not breaking users that deliberately toggle ABI-relevant target features. They get a warning but the feature does get toggled the way they requested. For now, our logic supports x86, ARM, and RISC-V (just like the previous logic did). Unsurprisingly, RISC-V is the nicest. ;) As a side-effect this also (unstably) allows *enabling* `x87` when that is harmless. I used the opportunity to mark SSE2 as required on x86-64, to better match the actual logic in LLVM and because all x86-64 chips do have SSE2. This infrastructure also prepares us for requiring SSE on x86-32 when we want to use that for our ABI (and for float semantics sanity), see https://github.com/rust-lang/rust/issues/133611, but no such change is happening in this PR. r? `@workingjubilee`
2025-01-03Auto merge of #135034 - Noratrieb:strip-correctly, r=jieyouxubors-0/+50
Pass objcopy args for stripping on OSX When `-Cstrip` was changed in #131405 to use the bundled rust-objcopy instead of /usr/bin/strip on OSX, strip-like arguments were preserved. But strip and objcopy are, while being the same binary, different, they have different defaults depending on which binary they are. Notably, strip strips everything by default, and objcopy doesn't strip anything by default. Additionally, `-S` actually means `--strip-all`, so debuginfo stripped everything and symbols didn't strip anything. We now correctly pass `--strip-debug` and `--strip-all`. fixes #135028 try-job: aarch64-apple try-job: dist-aarch64-apple
2025-01-02Pass objcopy args for stripping on OSXNoratrieb-0/+50
When `-Cstrip` was changed to use the bundled rust-objcopy instead of /usr/bin/strip on OSX, strip-like arguments were preserved. But strip and objcopy are, while being the same binary, different, they have different defaults depending on which binary they are. Notably, strip strips everything by default, and objcopy doesn't strip anything by default. Additionally, `-S` actually means `--strip-all`, so debuginfo stripped everything and symbols didn't strip anything. We now correctly pass `--strip-debug` and `--strip-all`.
2025-01-01Try to write the panic message with a single `write_all` callJohn Kåre Alsaker-5/+5
2024-12-31arm: use target.llvm_floatabi over soft-float target featureRalf Jung-1/+1
2024-12-28Rollup merge of #134829 - jieyouxu:migrate-libs-through-symlinks, r=lqdStuart Cook-22/+48
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-28tests: migrate `branch-protection-check-IBT` to rmake.rs许杰友 Jieyou Xu (Joe)-53/+58
- 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-28tests: migrate `libs-through-symlink` to rmake.rs许杰友 Jieyou Xu (Joe)-22/+48
- 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-26Rollup merge of #134656 - jieyouxu:migrate-incr-add-rust-src-component, ↵Guillaume Gomez-45/+131
r=wesleywiser Migrate `incr-add-rust-src-component` to rmake This PR partially supersedes #128562, and ports the Makefile-based `tests/run-make/incr-add-rust-src-component` to use rmake.rs infra. Part of #121876. This run-make test is a regression test for https://github.com/rust-lang/rust/issues/70924. It (tries to) checks that if we add the `rust-src` component in between two incremental compiles, that the compiler doesn't ICE on the second invocation. - Original issue:https://github.com/rust-lang/rust/issues/70924 - Fix PR: https://github.com/rust-lang/rust/pull/72767 - PR adding this regression test: https://github.com/rust-lang/rust/pull/72952 However, the Makefile version of this used `$SYSROOT/lib/rustlib/src/rust/src/libstd/lib.rs`, but that actually got moved around and reorganized over the years. As of Dec 2024, the `rust-src` component is more like (specific for our purposes): ``` $SYSROOT/lib/rustlib/src/rust/ library/std/src/lib.rs src/ ``` However, this run-make test is ancient and it exercises incr-comp system logic. I'm not sure if this test would actually catch the original regression. This PR was co-authored with `@Oneirical.` r? incremental try-job: i686-msvc try-job: x86_64-mingw-1 try-job: x86_64-msvc try-job: aarch64-apple
2024-12-23Note def descr in NonConstFunctionCallMichael Goulet-4/+4
2024-12-23tests: migrate `incr-add-rust-src-component` to rmake.rs许杰友 Jieyou Xu (Joe)-45/+131
The Makefile version seems to contain a bug. Over the years, the directory structure of the `rust-src` component changed as the source tree directory structure changed. `libstd` is no longer a thing directly under `root/lib/rustlib/src/rust/src/`, it is moved to `root/lib/rustlib/src/rust/library/std`. Co-authored-by: Oneirical <manchot@videotron.ca>
2024-12-23fix a few typos in rmake tests' commentsRémy Rakic-6/+6
2024-12-23remove unnecessary `mut` from `dump-ice-to-disk` rmake testRémy Rakic-1/+1
2024-12-23clean up `remove-dir-all-race` rmake testRémy Rakic-7/+6
- removes unused variables - fixes a few typos
2024-12-23remove unused imports from rmake testsRémy Rakic-12/+5
2024-12-20Update `run-make/rustdoc-default-output` testGuillaume Gomez-2/+4
2024-12-17Use field init shorthand where possibleJosh Triplett-2/+2
Field init shorthand allows writing initializers like `tcx: tcx` as `tcx`. The compiler already uses it extensively. Fix the last few places where it isn't yet used.
2024-12-15Rollup merge of #133633 - jyn514:hide-linker-args, r=bjorn3,jyn514Stuart Cook-8/+52
don't show the full linker args unless `--verbose` is passed the linker arguments can be *very* long, especially for crates with many dependencies. often they are not useful. omit them unless the user specifically requests them. split out from https://github.com/rust-lang/rust/pull/119286. fixes https://github.com/rust-lang/rust/issues/109979. r? `@bjorn3` try-build: i686-mingw
2024-12-14don't show the full linker args unless `--verbose` is passedjyn-8/+52
the linker arguments can be *very* long, especially for crates with many dependencies. some parts of them are not very useful. unless specifically requested: - omit object files specific to the current invocation - fold rlib files into a single braced argument (in shell expansion format) this shortens the output significantly without removing too much information.
2024-12-14Rollup merge of #133386 - wesleywiser:update_musl_base_crt_default, r=jieyouxuMatthias Krüger-0/+62
Update linux_musl base to dynamically link the crt by default However, don't change the behavior of any existing targets at this time. For targets that used the old default, explicitly set `crt_static_default = true`. This makes it easier for new targets to use the correct defaults while leaving the changing of individual targets to future PRs. Related to https://github.com/rust-lang/compiler-team/issues/422
2024-12-10Add test for musl dynamically linkingWesley Wiser-0/+62
2024-12-10Rollup merge of #134094 - estebank:const-trait-errors, r=compiler-errorsLeón Orell Valerian Liehr-0/+301
Tweak wording of non-const traits used as const bounds Use verbose suggestions and add additional labels/notes. r? ``@compiler-errors``