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

No way to disable tests for *-windows-gnu but keep them enabled for *-windows-gnullvm #132278

Open
mati865 opened this issue Oct 28, 2024 · 5 comments
Labels
A-compiletest Area: The compiletest test runner C-bug Category: This is a bug. E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@mati865
Copy link
Contributor

mati865 commented Oct 28, 2024

If I write:

//@ only-windows
//@ ignore-windows-gnu // or just ignore-gnu

Then gnullvm will be also excluded. There are few things (like CFGuad) that will probably never work with mingw-w64+GNU targets but are supported on mingw-w64+LLVM (not yet within Rust).
Using //@ only-windows-gnullvm won't be an option because it would disable the test for *-windows-msvc.

One idea I can think of is to add $ character that means end of the line, just like in regex. So //@ ignore-windows-gnu$ would skip all *-windows-gnu targets from the given test but keep *-windows-gnullvm targets.

Originally posted by @mati865 in #128602
cc @jieyouxu

@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 28, 2024
@mati865

This comment has been minimized.

@rustbot rustbot added the A-compiletest Area: The compiletest test runner label Oct 28, 2024
@jieyouxu jieyouxu added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) C-bug Category: This is a bug. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Oct 29, 2024
@jieyouxu
Copy link
Member

jieyouxu commented Oct 29, 2024

I'll double-check the target matchers, matching on a substring seems somewhat sus here.

@jieyouxu jieyouxu added the E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. label Oct 29, 2024
@mati865
Copy link
Contributor Author

mati865 commented Oct 29, 2024

I had tried that with quite dusted branch, so maybe it has changed since then. I'll try with a recent master.

@mati865
Copy link
Contributor Author

mati865 commented Oct 30, 2024

Yeah, that's right. On top of 2dece5bb commit, modifying the test to use:

//@ only-windows
//@ ignore-windows-gnu

shows test [codegen] tests\codegen\cfguard-checks.rs ... ignored, ignored when the operating system and target environment are windows-gnu.

Verbose configuration
running: "H:\\projects\\rust\\build\\x86_64-pc-windows-gnullvm\\llvm\\bin\\llvm-config.exe" "--components" (failure_mode=Exit) (created at src\core\build_steps\test.rs:1949:21, executed at src\core\build_steps\test.rs:1949:63)
Testing stage1 compiletest suite=codegen mode=codegen (x86_64-pc-windows-gnullvm)
running: "H:\\projects\\rust\\build\\x86_64-pc-windows-gnullvm\\stage0-tools-bin\\compiletest.exe" "--compile-lib-path" "H:\\projects\\rust\\build\\x86_64-pc-windows-gnullvm\\stage1\\bin" "--run-lib-path" "H:\\projects\\rust\\build\\x86_64-pc-windows-gnullvm\\stage1\\lib\\rustlib\\x86_64-pc-windows-gnullvm\\lib" "--rustc-path" "H:\\projects\\rust\\build\\x86_64-pc-windows-gnullvm\\stage1\\bin\\rustc.exe" "--src-base" "H:\\projects\\rust\\tests\\codegen" "--build-base" "H:\\projects\\rust\\build\\x86_64-pc-windows-gnullvm\\test\\codegen" "--sysroot-base" "H:\\projects\\rust\\build\\x86_64-pc-windows-gnullvm\\stage1" "--stage-id" "stage1-x86_64-pc-windows-gnullvm" "--suite" "codegen" "--mode" "codegen" "--target" "x86_64-pc-windows-gnullvm" "--host" "x86_64-pc-windows-gnullvm" "--llvm-filecheck" "H:\\projects\\rust\\build\\x86_64-pc-windows-gnullvm\\llvm\\build\\bin\\FileCheck.exe" "--optimize-tests" "--host-rustcflags" "-Crpath" "--host-rustcflags" "-Cdebuginfo=0" "--host-rustcflags" "-Lnative=H:\\projects\\rust\\build\\x86_64-pc-windows-gnullvm\\native\\rust-test-helpers" "--target-rustcflags" "-Crpath" "--target-rustcflags" "-Cdebuginfo=0" "--target-rustcflags" "-Lnative=H:\\projects\\rust\\build\\x86_64-pc-windows-gnullvm\\native\\rust-test-helpers" "--python" "H:/msys64/clang64/bin/python3.exe" "--lldb-version" "lldb version 18.1.8\n" "--lldb-python-dir" "H:\\msys64\\clang64\\lib\\python3.11\\site-packages" "cfguard-checks.rs" "--verbose" "--json" "--llvm-version" "19.1.1-rust-dev" "--llvm-components" "aarch64 aarch64asmparser aarch64codegen aarch64desc aarch64disassembler aarch64info aarch64utils aggressiveinstcombine all all-targets analysis arm armasmparser armcodegen armdesc armdisassembler arminfo armutils asmparser asmprinter avr avrasmparser avrcodegen avrdesc avrdisassembler avrinfo binaryformat bitreader bitstreamreader bitwriter bpf bpfasmparser bpfcodegen bpfdesc bpfdisassembler bpfinfo cfguard codegen codegendata codegentypes core coroutines coverage csky cskyasmparser cskycodegen cskydesc cskydisassembler cskyinfo debuginfobtf debuginfocodeview debuginfodwarf debuginfogsym debuginfologicalview debuginfomsf debuginfopdb demangle dlltooldriver dwarflinker dwarflinkerclassic dwarflinkerparallel dwp engine executionengine extensions filecheck frontenddriver frontendhlsl frontendoffloading frontendopenacc frontendopenmp fuzzercli fuzzmutate globalisel hexagon hexagonasmparser hexagoncodegen hexagondesc hexagondisassembler hexagoninfo hipstdpar instcombine instrumentation interfacestub interpreter ipo irprinter irreader jitlink libdriver lineeditor linker loongarch loongarchasmparser loongarchcodegen loongarchdesc loongarchdisassembler loongarchinfo lto m68k m68kasmparser m68kcodegen m68kdesc m68kdisassembler m68kinfo mc mca mcdisassembler mcjit mcparser mips mipsasmparser mipscodegen mipsdesc mipsdisassembler mipsinfo mirparser msp430 msp430asmparser msp430codegen msp430desc msp430disassembler msp430info native nativecodegen nvptx nvptxcodegen nvptxdesc nvptxinfo objcarcopts objcopy object objectyaml option orcdebugging orcjit orcshared orctargetprocess passes powerpc powerpcasmparser powerpccodegen powerpcdesc powerpcdisassembler powerpcinfo profiledata remarks riscv riscvasmparser riscvcodegen riscvdesc riscvdisassembler riscvinfo riscvtargetmca runtimedyld sandboxir scalaropts selectiondag sparc sparcasmparser sparccodegen sparcdesc sparcdisassembler sparcinfo support symbolize systemz systemzasmparser systemzcodegen systemzdesc systemzdisassembler systemzinfo tablegen target targetparser textapi textapibinaryreader transformutils vectorize webassembly webassemblyasmparser webassemblycodegen webassemblydesc webassemblydisassembler webassemblyinfo webassemblyutils windowsdriver windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info x86targetmca xray xtensa xtensaasmparser xtensacodegen xtensadesc xtensadisassembler xtensainfo" "--cc" "" "--cxx" "" "--cflags" "" "--cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/local/tmp/work" "--android-cross-path" "" "--channel" "dev" "--git-repository" "rust-lang/rust" "--nightly-branch" "master" "--git-merge-commit-email" "[email protected]"
configuration:
compile_lib_path: "H:\\projects\\rust\\build\\x86_64-pc-windows-gnullvm\\stage1\\bin"
run_lib_path: "H:\\projects\\rust\\build\\x86_64-pc-windows-gnullvm\\stage1\\lib\\rustlib\\x86_64-pc-windows-gnullvm\\lib"
rustc_path: "H:\\projects\\rust\\build\\x86_64-pc-windows-gnullvm\\stage1\\bin\\rustc.exe"
cargo_path: None
rustdoc_path: None
src_base: "H:\\projects\\rust\\tests\\codegen"
build_base: "H:\\projects\\rust\\build\\x86_64-pc-windows-gnullvm\\test\\codegen"
stage_id: stage1-x86_64-pc-windows-gnullvm
mode: codegen
run_ignored: false
filters: ["cfguard-checks.rs"]
skip: []
filter_exact: false
force_pass_mode: (none)
runner: (none)
host-rustcflags: ["-Crpath", "-Cdebuginfo=0", "-Lnative=H:\\projects\\rust\\build\\x86_64-pc-windows-gnullvm\\native\\rust-test-helpers"]
target-rustcflags: ["-Crpath", "-Cdebuginfo=0", "-Lnative=H:\\projects\\rust\\build\\x86_64-pc-windows-gnullvm\\native\\rust-test-helpers"]
target: x86_64-pc-windows-gnullvm
host: x86_64-pc-windows-gnullvm
android-cross-path: ""
adb_path: "adb"
adb_test_dir: "/data/local/tmp/work"
adb_device_status: false
ar: ar
target-linker: None
host-linker: None
verbose: true
format: Json

@mati865
Copy link
Contributor Author

mati865 commented Nov 3, 2024

It's matched because this matcher

condition! {
name: &target_cfg.os_and_env(),
allowed_names: &target_cfgs.all_oses_and_envs,
message: "when the operating system and target environment are {name}"
}
checks os and env but ignores abi which has its own matcher.
In this case we'd need a way to somehow combine those two and ignore the test when they are both set to specific (sometimes empty) values.

Currently, supported syntax is too limited to handle that, so fixing this issue is not possible without complicating or reworking how compiletest works.
Few ideas that come into mind:

  • support statement conjunctions like //@ ignore-windows-gnu && ignore-\0 (I've written empty abi as null character)
  • add more explicit directives: already existing ones would still work as they do, but new ones like @// ignore-os_env_abi-windows-gnu or @// ignore-arch_abi-arm-eabi could allow flexible composition

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Nov 13, 2024
…iser

allow CFGuard on windows-gnullvm

No unit tests because of rust-lang#132278
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Nov 13, 2024
…iser

allow CFGuard on windows-gnullvm

No unit tests because of rust-lang#132278
bors added a commit to rust-lang-ci/rust that referenced this issue Nov 15, 2024
allow CFGuard on windows-gnullvm

No unit tests because of rust-lang#132278
lnicola pushed a commit to lnicola/rust-analyzer that referenced this issue Nov 28, 2024
allow CFGuard on windows-gnullvm

No unit tests because of rust-lang/rust#132278
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-compiletest Area: The compiletest test runner C-bug Category: This is a bug. E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
Development

No branches or pull requests

3 participants