Skip to content

Tests: explicitly pass a ld for Darwin targets #947

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

Merged
merged 1 commit into from
Jan 17, 2022

Conversation

compnerd
Copy link
Member

This is based on #946 and transitively on #940. Only the last commit is relevant.

@compnerd
Copy link
Member Author

047a7f0?w=1 is helpful for viewing the diff.

Copy link
Contributor

@cltnschlosser cltnschlosser left a comment

Choose a reason for hiding this comment

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

Is specifying Darwin targets even valid on windows (or linux)?

This seems fine for now, since there is probably coverage that we wouldn't otherwise get, but I wonder if we need different test cases for other operating systems.

@@ -2891,60 +2927,73 @@ final class SwiftDriverTests: XCTestCase {
}

func testTargetVariant() throws {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not even sure if these tests should be valid outside of macOS, since I think catalyst is the only thing that uses -target-variant

@compnerd
Copy link
Member Author

Is specifying Darwin targets even valid on windows (or linux)?

Yes and no. Yes, that is entirely valid thing to do, no you do not expect it to get anywhere. The reason for the latter is that you do not have the platform SDK. That is only available through Xcode. But, assuming that you had the SDK, then this is totally valid to do this on other platforms.

I wonder if we need different test cases for other operating systems.

Yes, in general, we should prefer to use the host target and only explicitly specify the target triple when we are testing target specific behaviour rather than general driver behaviour.

@compnerd
Copy link
Member Author

@swift-ci please test

1 similar comment
@compnerd
Copy link
Member Author

@swift-ci please test

@compnerd
Copy link
Member Author

@swift-ci please test

1 similar comment
@compnerd
Copy link
Member Author

@swift-ci please test

@compnerd
Copy link
Member Author

@swift-ci please test

When testing with explicit Darwin targets, we need to explicitly add the
ld path to use for the tests as not all platforms use or have a `ld`
executable.  Stub out the path to ensure that the tests are able to be
executed.  Alternatively, we could remove the Darwin specific triples on
the test.

Additionally, while in the area, add an additional test case for Windows
x86_64 LTO and enable the linker profile argument checks for ELFish
targets on Windows as well.
@compnerd
Copy link
Member Author

@swift-ci please test

@compnerd compnerd merged commit f69e134 into swiftlang:main Jan 17, 2022
@compnerd compnerd deleted the ldless branch January 17, 2022 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants