rust/tests/run-make
Nikita Popov 8a50bcbdce Remove extern "wasm" ABI
Remove the unstable `extern "wasm"` ABI (`wasm_abi` feature tracked
in #83788).

As discussed in https://github.com/rust-lang/rust/pull/127513#issuecomment-2220410679
and following, this ABI is a failed experiment that did not end
up being used for anything. Keeping support for this ABI in LLVM 19
would require us to switch wasm targets to the `experimental-mv`
ABI, which we do not want to do.

It should be noted that `Abi::Wasm` was internally used for two
things: The `-Z wasm-c-abi=legacy` ABI that is still used by
default on some wasm targets, and the `extern "wasm"` ABI. Despite
both being `Abi::Wasm` internally, they were not the same. An
explicit `extern "wasm"` additionally enabled the `+multivalue`
feature.

I've opted to remove `Abi::Wasm` in this patch entirely, instead
of keeping it as an ABI with only internal usage. Both
`-Z wasm-c-abi` variants are now treated as part of the normal
C ABI, just with different different treatment in
adjust_for_foreign_abi.
2024-07-11 12:20:26 +02:00
..
a-b-a-linker-guard
alloc-no-oom-handling
alloc-no-rc
alloc-no-sync
allocator-shim-circular-deps
allow-warnings-cmdline-stability
archive-duplicate-names
arguments-non-c-like-enum Improve run-make-support library args API 2024-06-30 12:40:24 +02:00
artifact-incr-cache
artifact-incr-cache-no-obj
atomic-lock-free
bare-outfile
bin-emit-no-symbols
box-struct-no-segfault
branch-protection-check-IBT
c-dynamic-dylib
c-dynamic-rlib
c-link-to-rust-dylib
c-link-to-rust-staticlib Improve run-make-support library args API 2024-06-30 12:40:24 +02:00
c-link-to-rust-va-list-fn Improve run-make-support library args API 2024-06-30 12:40:24 +02:00
c-static-dylib
c-static-rlib
c-unwind-abi-catch-lib-panic
c-unwind-abi-catch-panic
cat-and-grep-sanity-check
cdylib
cdylib-dylib-linkage
cdylib-fewer-symbols rewrite symbols-include-type-name to rmake 2024-07-09 14:30:57 -04:00
clear-error-blank-output
codegen-options-parsing
comment-section Improve target method API in run-make-support 2024-07-01 10:55:57 +02:00
compile-stdin
compiler-builtins
compiler-lookup-paths
compiler-lookup-paths-2
compiler-rt-works-on-mingw
compressed-debuginfo Rollup merge of #127201 - GuillaumeGomez:improve-run-make-support, r=Kobzol 2024-07-01 20:29:59 +02:00
const_fn_mir
const-prop-lint
core-no-fp-fmt-parse
core-no-oom-handling
crate-data-smoke
crate-hash-rustc-version
crate-name-priority
cross-lang-lto
cross-lang-lto-clang
cross-lang-lto-pgo-smoketest
cross-lang-lto-riscv-abi
cross-lang-lto-upstream-rlibs
CURRENT_RUSTC_VERSION
debug-assertions rewrite emit-stack-sizes to rmake 2024-06-28 11:18:46 -04:00
debugger-visualizer-dep-info
dep-graph
dep-info
dep-info-doesnt-run-much
dep-info-spaces
deref-impl-rustdoc-ice
doctests-keep-binaries
doctests-runtool
dump-ice-to-disk
dump-mono-stats
duplicate-output-flavors
dylib-chain rewrite rlib-chain to rmake 2024-07-02 11:37:58 -04:00
dylib-soname linker: Link dylib crates by path 2024-07-02 11:43:17 +03:00
emit
emit-named-files Small run-make-support API improvements 2024-07-03 11:34:39 +02:00
emit-path-unhashed rewrite emit-path-unhashed to rmake 2024-07-05 10:06:27 -04:00
emit-shared-files rewrite emit-shared-files to rmake 2024-07-05 10:06:27 -04:00
emit-stack-sizes rewrite emit-stack-sizes to rmake 2024-06-28 11:18:46 -04:00
emit-to-stdout
env-dep-info
error-found-staticlib-instead-crate
error-writing-dependencies
exit-code
export-executable-symbols
extern-diff-internal-name
extern-flag-disambiguates
extern-flag-fun
extern-flag-pathless rewrite symbols-include-type-name to rmake 2024-07-09 14:30:57 -04:00
extern-flag-rename-transitive
extern-fn-explicit-align
extern-fn-generic
extern-fn-mangle
extern-fn-reachable
extern-fn-struct-passing-abi
extern-fn-with-extern-types
extern-fn-with-packed-struct
extern-fn-with-union
extern-multiple-copies
extern-multiple-copies2
extern-overrides-distribution
external-crate-panic-handle-no-lint
extra-filename-with-temp-outputs
fmt-write-bloat
forced-unwind-terminate-pof
foreign-double-unwind
foreign-exceptions
foreign-rust-exceptions
glibc-staticlib-args Improve run-make-support library args API 2024-06-30 12:40:24 +02:00
inaccessible-temp-dir Disable rmake test rustdoc-io-error on riscv64gc-gnu 2024-07-03 10:12:39 -07:00
include-all-symbols-linking rewrite test-harness to rmake 2024-07-02 11:37:59 -04:00
include-bytes-deps rewrite rmeta-preferred to rmake 2024-07-04 10:05:56 -04:00
incr-add-rust-src-component
incr-foreign-head-span
incr-prev-body-beyond-eof
incremental-debugger-visualizer
incremental-session-fail
inline-always-many-cgu
interdependent-c-libraries
intrinsic-unreachable rewrite sepcomp-inlining and -separate to rmake.rs 2024-07-08 10:14:42 -04:00
invalid-library Add ar command in run-make-support 2024-06-27 14:04:46 +02:00
invalid-so rewrite invalid-so to rmake 2024-06-25 14:45:49 -04:00
invalid-staticlib
issue-14698
issue-15460
issue-18943
issue-22131
issue-25581
issue-26006
issue-28595
issue-33329
issue-35164
issue-36710
issue-47551
issue-69368
issue-83045
issue-83112-incr-test-moved-file
issue-84395-lto-embed-bitcode
issue-85019-moved-src-dir
issue-85401-static-mir
issue-88756-default-output
issue-97463-abi-param-passing
issue-107094
issue-107495-archive-permissions
issue-109934-lto-debuginfo
issue-125484-used-dependencies
jobserver-error
libs-through-symlinks
libtest-json
libtest-junit
libtest-padding rewrite libtest-padding to rmake 2024-06-26 11:44:23 -04:00
libtest-thread-limit
link-arg
link-args-order
link-cfg
link-dedup
link-framework
link-path-order
linkage-attr-on-static
llvm-ident Improve code of run-make/llvm-ident 2024-07-08 20:18:21 +02:00
llvm-outputs
long-linker-command-lines
long-linker-command-lines-cmd-exe
longjmp-across-rust
ls-metadata
lto-avoid-object-duplication
lto-dylib-dep rewrite lto-dylib-dep to rmake 2024-06-26 13:32:30 -04:00
lto-empty rewrite lto-empty to rmake 2024-06-25 14:27:43 -04:00
lto-linkage-used-attr
lto-no-link-whole-rlib
lto-readonly-lib
lto-smoke
lto-smoke-c
macos-deployment-target
macos-fat-archive
manual-crate-name
manual-link
many-crates-but-no-match rewrite many-crates-but-no-match to rmake 2024-06-27 11:17:26 -04:00
metadata-dep-info rewrite metadata-dep-info to rmake 2024-06-28 16:45:29 -04:00
metadata-flag-frobs-symbols
metadata-only-crate-no-ice rewrite rmeta-preferred to rmake 2024-07-04 10:05:56 -04:00
min-global-align
mingw-export-call-convention
mismatching-target-triples
missing-crate-dependency
mixing-deps
mixing-formats
mixing-libs
multiple-emits
native-link-modifier-bundle
native-link-modifier-verbatim-linker
native-link-modifier-verbatim-rustc
native-link-modifier-whole-archive
no-alloc-shim
no-builtins-attribute
no-builtins-lto
no-cdylib-as-rdylib
no-duplicate-libs
no-input-file
no-intermediate-extras
non-pie-thread-local
non-unicode-env
non-unicode-in-incremental-dir
notify-all-emit-artifacts
obey-crate-type-flag
optimization-remarks-dir add shallow_find_files helper function to run-make-support 2024-07-04 10:05:56 -04:00
optimization-remarks-dir-pgo add shallow_find_files helper function to run-make-support 2024-07-04 10:05:56 -04:00
output-filename-conflicts-with-directory
output-filename-overwrites-input
output-type-permutations Improve run-make/output-type-permutations code and improve filename_not_in_denylist API 2024-07-07 13:05:07 +02:00
output-with-hyphens
override-aliased-flags Migrate run-make/override-aliased-flags to rmake.rs 2024-06-29 11:55:30 +02:00
overwrite-input rewrite overwrite-input to rmake 2024-06-26 13:11:46 -04:00
panic-abort-eh_frame
panic-impl-transitive
parallel-rustc-no-overwrite
pass-linker-flags rewrite pass-linker-flags-flavor to rmake 2024-07-04 13:16:11 -04:00
pass-linker-flags-flavor rewrite pass-linker-flags-from-dep to rmake 2024-07-05 12:47:19 -04:00
pass-linker-flags-from-dep rewrite pass-linker-flags-from-dep to rmake 2024-07-05 12:47:19 -04:00
pass-non-c-like-enum-to-c
pdb-alt-path
pdb-buildinfo-cl-cmd
pgo-branch-weights
pgo-gen Add shallow_find_files helper function to run-make-support 2024-07-05 10:25:48 -04:00
pgo-gen-lto
pgo-gen-no-imp-symbols
pgo-indirect-call-promotion
pgo-use Add shallow_find_files helper function to run-make-support 2024-07-05 10:25:48 -04:00
pointer-auth-link-with-c
prefer-dylib
prefer-rlib
pretty-print-to-file rewrite pretty-print-to-file to rmake 2024-06-26 11:44:11 -04:00
pretty-print-with-dep-file rewrite pretty-print-with-dep-file to rmake 2024-06-26 10:39:45 -04:00
print-calling-conventions
print-cfg
print-check-cfg Improve run-make-support library args API 2024-06-30 12:40:24 +02:00
print-native-static-libs
print-target-list
print-to-output
proc-macro-init-order
proc-macro-three-crates rewrite track-pgo-dep-info to rmake 2024-07-08 10:31:05 -04:00
profile rewrite profile to rmake 2024-07-05 10:17:48 -04:00
prune-link-args
raw-dylib-alt-calling-convention
raw-dylib-c
raw-dylib-cross-compilation rewrite used-cdylib-macos to rmake 2024-06-28 16:28:57 -04:00
raw-dylib-custom-dlltool
raw-dylib-import-name-type
raw-dylib-inline-cross-dylib
raw-dylib-link-ordinal
raw-dylib-stdcall-ordinal
raw-fn-pointer-opt-undefined-behavior rewrite and rename issue-20626 to rmake 2024-06-25 15:02:19 -04:00
reachable-extern-fn-available-lto
redundant-libs
relocation-model
relro-levels
remap-path-prefix rmeta_contains functions for remap-path-prefix 2024-06-28 16:30:17 -04:00
remap-path-prefix-dwarf
repr128-dwarf
reproducible-build
reproducible-build-2
reset-codegen-1
resolve-rename
return-non-c-like-enum Improve run-make-support library args API 2024-06-30 12:40:24 +02:00
return-non-c-like-enum-from-c
rlib-chain rewrite rlib-chain to rmake 2024-07-02 11:37:58 -04:00
rlib-format-packed-bundled-libs
rlib-format-packed-bundled-libs-2
rlib-format-packed-bundled-libs-3
rmeta-preferred rewrite rmeta-preferred to rmake 2024-07-04 10:05:56 -04:00
run-in-tmpdir-self-test
rust-lld
rust-lld-by-default-beta-stable Add a run-make test that LLD is not being used by default on the x64 beta/stable channel 2024-06-29 10:10:59 +02:00
rust-lld-by-default-nightly Add a run-make test that LLD is not being used by default on the x64 beta/stable channel 2024-06-29 10:10:59 +02:00
rust-lld-custom-target
rustc-macro-dep-files
rustdoc-determinism
rustdoc-error-lines
rustdoc-io-error Disable rmake test rustdoc-io-error on riscv64gc-gnu 2024-07-03 10:12:39 -07:00
rustdoc-map-file
rustdoc-output-path
rustdoc-scrape-examples-invalid-expr
rustdoc-scrape-examples-macros
rustdoc-scrape-examples-multiple
rustdoc-scrape-examples-ordering
rustdoc-scrape-examples-remap
rustdoc-scrape-examples-test
rustdoc-scrape-examples-whitespace
rustdoc-shared-flags
rustdoc-target-spec-json-path
rustdoc-test-args
rustdoc-themes
rustdoc-verify-output-files
rustdoc-with-out-dir-option
rustdoc-with-output-option
rustdoc-with-short-out-dir-option
sanitizer-cdylib-link
sanitizer-dylib-link
sanitizer-staticlib-link
separate-link
separate-link-fail
sepcomp-cci-copies rewrite sepcomp-inlining and -separate to rmake.rs 2024-07-08 10:14:42 -04:00
sepcomp-inlining rewrite sepcomp-inlining and -separate to rmake.rs 2024-07-08 10:14:42 -04:00
sepcomp-separate rewrite sepcomp-inlining and -separate to rmake.rs 2024-07-08 10:14:42 -04:00
share-generics-dylib
share-generics-export-again
short-ice
silly-file-names rewrite silly-file-names to rmake 2024-06-28 16:44:50 -04:00
simd-ffi
split-debuginfo
stable-symbol-names
static-dylib-by-default
static-extern-type
static-pie Improve target method API in run-make-support 2024-07-01 10:55:57 +02:00
static-unwinding
staticlib-blank-lib
staticlib-dylib-linkage
std-core-cycle
stdin-rustc
stdin-rustdoc
suspicious-library
symbol-mangling-hashed
symbol-visibility
symbols-include-type-name rewrite symbols-include-type-name to rmake 2024-07-09 14:30:57 -04:00
symlinked-extern
symlinked-libraries
symlinked-rlib
sysroot-crates-are-unstable
target-cpu-native rewrite target-without-atomic-cas to rmake 2024-07-08 10:20:42 -04:00
target-specs rewrite target-without-atomic-cas to rmake 2024-07-08 10:20:42 -04:00
target-without-atomic-cas rewrite target-without-atomic-cas to rmake 2024-07-08 10:20:42 -04:00
test-benches
test-harness rewrite test-harness to rmake 2024-07-02 11:37:59 -04:00
textrel-on-minimal-lib Improve run-make-support library args API 2024-06-30 12:40:24 +02:00
thumb-none-cortex-m
thumb-none-qemu
track-path-dep-info rewrite track-pgo-dep-info to rmake 2024-07-08 10:31:05 -04:00
track-pgo-dep-info rewrite track-pgo-dep-info to rmake 2024-07-08 10:31:05 -04:00
translation
type-mismatch-same-crate-name
unknown-mod-stdin rewrite unknown-mod-stdin to rmake 2024-06-28 16:28:24 -04:00
unstable-flag-required
use-suggestions-rust-2018 rewrite use-suggestions-rust-2018 to rmake 2024-06-26 12:04:35 -04:00
used
used-cdylib-macos rewrite used-cdylib-macos to rmake 2024-06-28 16:28:57 -04:00
volatile-intrinsics Migrate volatile-intrinsics to rmake 2024-06-29 08:14:00 -04:00
wasm-custom-section
wasm-custom-sections-opt
wasm-exceptions-nostd Rollup merge of #126880 - Rejyr:migrate-rmake-vw, r=Kobzol 2024-07-01 20:29:57 +02:00
wasm-export-all-symbols
wasm-import-module
wasm-override-linker Migrate wasm-override-linker to rmake 2024-06-29 08:14:02 -04:00
wasm-panic-small
wasm-spurious-import
wasm-stringify-ints-small
wasm-symbols-different-module
wasm-symbols-not-exported
wasm-symbols-not-imported
weird-output-filenames Migrate weird-output-filenames to rmake 2024-06-29 08:14:02 -04:00
windows-binary-no-external-deps
windows-safeseh update run-make/windows-safeseh compiletest header 2024-06-28 20:32:31 +03:00
windows-spawn
windows-ws2_32
x86_64-fortanix-unknown-sgx-lvi
git_clone_sha1.sh
README.md
tools.mk

The run-make test suite

The run-make test suite contains tests which are the most flexible out of all the rust-lang/rust test suites. run-make tests can basically contain arbitrary code, and are supported by the run_make_support library.

Infrastructure

There are two kinds of run-make tests:

  1. The new rmake.rs version: this allows run-make tests to be written in Rust (with rmake.rs as the main test file).
  2. The legacy Makefile version: this is what run-make tests were written with before support for rmake.rs was introduced.

The implementation for collecting and building the rmake.rs recipes (or Makefiles) are in src/tools/compiletest/src/runtest.rs, in run_rmake_v2_test and run_rmake_legacy_test.

Rust-based run-make tests: rmake.rs

The setup for the rmake.rs version is a 3-stage process:

  1. First, we build the run_make_support library in bootstrap as a tool lib.

  2. Then, we compile the rmake.rs "recipe" linking the support library and its dependencies in, and provide a bunch of env vars. We setup a directory structure within build/<target>/test/run-make/

    <test-name>/
        rmake.exe              # recipe binary
        rmake_out/             # sources from test sources copied over
    

    and copy non-rmake.rs input support files over to rmake_out/. The support library is made available as an extern prelude.

  3. Finally, we run the recipe binary and set rmake_out/ as the working directory.