Don't add an autolink-extract job unless actually linking ELF/Wasm objects, matching the original C++ driver #1479
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
This is needed for swiftlang/swift#69564, which enables building the early swift driver and running tests from the compiler validation suite with it for the first time on the linux CI. Looking at those test failures, I noticed that the Swift toolchain wrongly runs
autolink-extract
on linux when simply compiling object files, which is obviously unused:and which the old C++ driver doesn't:
That's because the old driver checks if it
shouldLink()
before scheduling anautolink-extract
, whereas there's no equivalent check in this repo going back to when theautolink-extract
job was added in c4bf245. That's why @eeckstein had to add this linux-specific hack for these tests he added in #1019, which can now be removed and acts as a regression test.The
autolink-extract
could also be disabled for static libraries, but I kept the behavior the same across both drivers instead.