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

compiletest: Support ignoring tests requiring missing LLVM components #75064

Merged
merged 1 commit into from
Aug 2, 2020

Conversation

petrochenkov
Copy link
Contributor

@petrochenkov petrochenkov commented Aug 2, 2020

This PR implements a more principled solution to the problem described in #66084.

Builds of LLVM backends take a lot of time and disk space.
So it usually makes sense to build rustc with

[llvm]
targets = "X86"
experimental-targets = ""

unless you are working on some target-specific tasks.

A few tests, however, require non-x86 backends to be built.
A new test directive // needs-llvm-components: component1 component2 component3 makes such tests to be automatically ignored if one of the listed components is missing in the provided LLVM (this is determined through llvm-config --components).

As a result, the test suite now fully passes with LLVM built only with the x86 backend. The component list in this case is

aggressiveinstcombine all all-targets analysis asmparser asmprinter binaryformat bitreader bitstreamreader bitwriter cfguard codegen core coroutines coverage debuginfocodeview debuginfodwarf debuginfogsym debuginfomsf debuginfopdb demangle dlltooldriver dwarflinker engine executionengine frontendopenmp fuzzmutate globalisel instcombine instrumentation interpreter ipo irreader jitlink libdriver lineeditor linker lto mc mca mcdisassembler mcjit mcparser mirparser native nativecodegen objcarcopts object objectyaml option orcerror orcjit passes profiledata remarks runtimedyld scalaropts selectiondag support symbolize tablegen target textapi transformutils vectorize windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info x86utils xray

(With the default target list it's much larger.)

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 cfguard codegen core coroutines coverage debuginfocodeview debuginfodwarf debuginfogsym debuginfomsf debuginfopdb demangle dlltooldriver dwarflinker engine executionengine frontendopenmp fuzzmutate globalisel hexagon hexagonasmparser hexagoncodegen hexagondesc hexagondisassembler hexagoninfo instcombine instrumentation interpreter ipo irreader jitlink libdriver lineeditor linker lto 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 object objectyaml option orcerror orcjit passes powerpc powerpcasmparser powerpccodegen powerpcdesc powerpcdisassembler powerpcinfo profiledata remarks riscv riscvasmparser riscvcodegen riscvdesc riscvdisassembler riscvinfo riscvutils runtimedyld scalaropts selectiondag sparc sparcasmparser sparccodegen sparcdesc sparcdisassembler sparcinfo support symbolize systemz systemzasmparser systemzcodegen systemzdesc systemzdisassembler systemzinfo tablegen target textapi transformutils vectorize webassembly webassemblyasmparser webassemblycodegen webassemblydesc webassemblydisassembler webassemblyinfo windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info x86utils xray

#66084 is also reverted now.

r? @Mark-Simulacrum

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 2, 2020
@Mark-Simulacrum
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Aug 2, 2020

📌 Commit d3277b9 has been approved by Mark-Simulacrum

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 2, 2020
@Aaron1011
Copy link
Member

It might be a good idea to add a flag to assert that all needed components are available, to ensure that we don't accidentally stop running these tests entirely.

bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 2, 2020
…arth

Rollup of 5 pull requests

Successful merges:

 - rust-lang#74980 (pprust: adjust mixed comment printing and add regression test for rust-lang#74745)
 - rust-lang#75009 (Document the discrepancy in the mask type for _mm_shuffle_ps)
 - rust-lang#75031 (Do not trigger `unused_{braces,parens}` lints with `yield`)
 - rust-lang#75059 (fix typos)
 - rust-lang#75064 (compiletest: Support ignoring tests requiring missing LLVM components)

Failed merges:

r? @ghost
@bors bors merged commit 0bf2dcf into rust-lang:master Aug 2, 2020
@petrochenkov
Copy link
Contributor Author

@Aaron1011

It might be a good idea to add a flag to assert that all needed components are available, to ensure that we don't accidentally stop running these tests entirely.

Addressed in #77280.

//arm: define void @has_efiapi
//riscv: define void @has_efiapi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to use CHECK for this, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe. I simply reverted #66084 here and didn't make any changes.

Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Sep 30, 2020
…acrum

Ensure that all LLVM components requested by tests are available on CI

Addresses rust-lang#75064 (comment)

I used an environment variable because passing a command line option all the way from CI to compiletest would be just too much hassle for this task.
I added a new variable, but any of the already existing ones defined by CI could be used instead.
r? @Mark-Simulacrum
@cuviper cuviper added this to the 1.47.0 milestone May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants