-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add test fixture for experimental-lto-mode #6891
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
Conversation
@swift-ci please smoke test |
@swift-ci please test |
[12/14] Write Objects.LinkFileList
error: autolink-extract command failed with exit code 1 (use -v to see invocation)
<unknown>:0: error: error opening input file '/tmp/Miscellaneous_LTO_SwiftAndCTargets.GHkhKS/Miscellaneous_LTO_SwiftAndCTargets/.build/x86_64-unknown-linux-gnu/debug/cLib.build/cLib.c.o' (The file was not recognized as a valid object file) @fabianfett it looks lto (as currently implemented) just doesn't work on linux! Thanks for the report! |
The error comes from swift-autolink-extract, which I know nothing about... /usr/bin/swift-autolink-extract /swift-package-manager/Fixtures/Miscellaneous/LTO/SwiftAndCTargets/.build/aarch64-unknown-linux-gnu/debug/cLib.build/cLib.c.o /swift-package-manager/Fixtures/Miscellaneous/LTO/SwiftAndCTargets/.build/aarch64-unknown-linux-gnu/debug/exe.build/exe.swiftmodule.o /swift-package-manager/Fixtures/Miscellaneous/LTO/SwiftAndCTargets/.build/aarch64-unknown-linux-gnu/debug/swiftLib.build/swiftLib.swiftmodule.o -o /swift-package-manager/Fixtures/Miscellaneous/LTO/SwiftAndCTargets/.build/aarch64-unknown-linux-gnu/debug/cLib.build/exe.autolink
error: autolink-extract command failed with exit code 1 (use -v to see invocation)
<unknown>:0: error: error opening input file '/swift-package-manager/Fixtures/Miscellaneous/LTO/SwiftAndCTargets/.build/aarch64-unknown-linux-gnu/debug/cLib.build/cLib.c.o' (The file was not recognized as a valid object file |
Maybe @artemcm does |
|
Well this file doesn't exist on disk because the file extension is ./.build/aarch64-unknown-linux-gnu/debug/swiftLib.build/swiftLib.swift.bc
./.build/aarch64-unknown-linux-gnu/debug/exe.build/main.swift.bc |
Ah, then we need to teach the driver about how this works, I believe it is just forwarding compilation outputs to |
I'm a little confused because we use |
This job must not be configured correctly. It cannot accept |
@artemcm would teaching |
Reading the code, I get the impression that if we're using LTO, then we're using So I wonder if we can simply teach the driver that this flow does not require |
Hmm, the driver is already supposed to skip So we need to figure out why we're still generating this job here. |
Oh I see, that is interesting.
I've been running under docker to repro this issue. But I guess the question is why the driver doesn't see this link command as an lto job. Lemme try to get the full swiftc command and maybe that will provide some clues. |
Maybe its as simple as adding |
@swift-ci please test |
@swift-ci please smoke test windows |
8c513a1
to
8c8dfef
Compare
@swift-ci please test |
@swift-ci please smoke test windows |
8c8dfef
to
26678f2
Compare
@swift-ci please test |
@swift-ci please smoke test windows |
@swift-ci please smoke test windows |
@swift-ci test windows |
add a verbose flag to be able to help debug why this fixture is failing on linux
@swift-ci please test |
swiftlang/swift#69696 |
swiftlang/swift#69564 |
@swift-ci please test |
@swift-ci please test |
@swift-ci please test |
try fixture(name: "Miscellaneous/LTO/SwiftAndCTargets") { fixturePath in | ||
do { | ||
let output = try executeSwiftBuild( | ||
fixturePath, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be using a mix of 4 and 2-space formatting. Additionally, why wrap this in do
/catch
if try fixture(name:)
would be rethrowing the error anyway?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had added XCTFail("\(error)")
to help with debugging, removing and fixing indentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in 93f7309f8a58c7f6cce5827c254af5e8015d3eb2
@swift-ci please test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
@swift-ci test windows |
Cherry-pick of #6891. Adds a test covering experimental LTO mode and fixes a bug where the LTO mode was not passed to the linker. Fixes #6888 --------- Co-authored-by: Rauhul Varma <[email protected]>
Adds a test covering experimental lto mode and fixes a bug where the
lto mode was not passed to the linker.
Fixes #6888