This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Add LTO dependency to lldb test suite
ClosedPublic

Authored by augusto2112 on Dec 14 2022, 1:24 PM.

Details

Summary

Make the lldb test target depend on LTO, since TestFullLtoStepping
needs it.

Diff Detail

Event Timeline

augusto2112 created this revision.Dec 14 2022, 1:24 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 14 2022, 1:24 PM
Herald added a subscriber: inglorion. · View Herald Transcript
augusto2112 requested review of this revision.Dec 14 2022, 1:24 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 14 2022, 1:24 PM

If you don't have LTO, does this mean that only that one test won't run, or will the whole suite not run?

Perhaps I misunderstand the purpose of add_lldb_test_dependency.

@DavidSpickett right now if you don't have LTO the test will run but fail.

Sorry I should have been specific. With this change applied, when you don't have LTO, we'll just skip the individual test, or we'll not do testing at all?

Wondering if this is an all or nothing situation, which would be unfortunate for a single test.

@DavidSpickett Is it possible to configure LLVM to not build with libLTO? Which CMake flag controls this?

Well that was my confusion, no there isn't an option. So how does one end up with a build that doesn't include it. Perhaps a standalone build of lldb, built with a prebuilt llvm that didn't package libLTO?

Which sounds perfectly legitimate and the test should be skipped. I'd just like to see whatever the use case is added to the commit message.

Well that was my confusion, no there isn't an option. So how does one end up with a build that doesn't include it. Perhaps a standalone build of lldb, built with a prebuilt llvm that didn't package libLTO?

This is just about adding a dependency between lldb-test-deps and libLTO. If you just run ninja check-lldb prior to this patch libLTO would not be built. Now it is. This is not about a build setting, just about a build dependency. Without this dependency why would we expect libLTO get built?

DavidSpickett accepted this revision.Dec 19 2022, 1:25 AM

If you just run ninja check-lldb prior to this patch libLTO would not be built.

Great, put that in the commit message.

What I was trying to get at was the meaning of depends on:

  • depends on thing, so we should build the thing
  • depends on thing, so we shouldn't run the test if thing isn't present

And confirm that the former was your intent, but we do a lot of the latter elsewhere.

This revision is now accepted and ready to land.Dec 19 2022, 1:25 AM
aprantl accepted this revision.Dec 20 2022, 11:12 AM

@DavidSpickett thanks for the review, I've updated the commit message to be clearer.

This revision was automatically updated to reflect the committed changes.