This is an archive of the discontinued LLVM Phabricator instance.

[Dexter] Remove the Windows dependency on lld from CMake
ClosedPublic

Authored by Orlando on Dec 16 2021, 4:47 AM.

Details

Summary

Currently, lld is marked as a dependency on Windows in
cross-project-tests/CMakeLists.txt which means CMake will fail if lld isn't
enabled. The idea of the cross-project-tests is that tests that don't have
their dependencies met should just be unsupported.

Remove the depenency from the CMake step and check whether Dexter's
platform-specific dependencies have been met in
cross-project-tests/lit.cfg.py. If the dependencies are met then add 'dexter'
to the available_features, otherwise don't and the dexter tests will be
"UNSUPPORTED".

Diff Detail

Event Timeline

Orlando created this revision.Dec 16 2021, 4:47 AM
Orlando requested review of this revision.Dec 16 2021, 4:47 AM

I decided to (add and) have configure_dexter_substitutions return the dependencies rather than having the dependencies checked independently of the substitutions because I felt that keeping them close together in code (as they are really coupled) would help to keep things in sync.

jhenderson requested changes to this revision.Dec 16 2021, 5:26 AM
jhenderson added inline comments.
cross-project-tests/CMakeLists.txt
58–61

Shouldn't this just be removing the "WIN32" part? If cross-project-tests and lld are both enabled, then check-cross-project-tests will run LLD-requiring tests (there may not be any right at this moment, but I wrote the code with the intention of them being possible). Without this dependency, there could a build-time race condition, whereby the LLD project doesn't finish building before starting the tests.

This revision now requires changes to proceed.Dec 16 2021, 5:26 AM
Orlando updated this revision to Diff 394836.Dec 16 2021, 5:37 AM

+ Add lld as a dependency if lld is in LLVM_ENABLE_PROJECTS

This revision is now accepted and ready to land.Dec 16 2021, 5:38 AM
Orlando marked an inline comment as done.Dec 16 2021, 5:38 AM
Orlando added inline comments.
cross-project-tests/CMakeLists.txt
58–61

Good point - fixed.

This revision was landed with ongoing or failed builds.Dec 16 2021, 5:47 AM
This revision was automatically updated to reflect the committed changes.
Orlando marked an inline comment as done.

Thanks @jhenderson.

cross-project-tests/lit.cfg.py
147–151

These lines are repeated earlier so have been removed from my commit.