Skip to content

Disallow static linking core libraries in swift test #7087

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 3 commits into from
Nov 14, 2023

Conversation

MaxDesiatov
Copy link
Contributor

This is currently not supported and we should show a proper error message in this case.

Resolves rdar://117908112.

This is currently not supported and we should show a proper error message in this case.

Resolves rdar://117908112.
@MaxDesiatov
Copy link
Contributor Author

cc @grynspan this may need to be updated when swift-testing support lands, unless you can confirm that it doesn't support static linking either?

@MaxDesiatov
Copy link
Contributor Author

@swift-ci test

@grynspan
Copy link
Contributor

cc @grynspan this may need to be updated when swift-testing support lands, unless you can confirm that it doesn't support static linking either?

swift-testing is agnostic here. As it's also just a package, it only needs the symbols it uses to eventually exist, and isn't too concerned with the state of the linker.

@MaxDesiatov
Copy link
Contributor Author

Great, then you'll just need to make this static linking check specific to XCTest in your swift-testing PR, in case mine is merged first 🙂

@MaxDesiatov MaxDesiatov enabled auto-merge (squash) November 13, 2023 16:59
@neonichu
Copy link
Contributor

Hm, why aren't we just removing the option? It seems a bit weird to have an option that 100% leads to an error.

@MaxDesiatov
Copy link
Contributor Author

We can't remove it since it's a linker option shared with swift build.

@neonichu
Copy link
Contributor

In that case, I think we should move the option so that we can have it only apply to build

@MaxDesiatov
Copy link
Contributor Author

In that case, I think we should move the option so that we can have it only apply to build

What's the best place to move it? SwiftTestTool has access to GlobalOptions, which contains both BuildOptions and LinkerOptions.

@neonichu
Copy link
Contributor

I think we would move it to BuildToolOptions?

@MaxDesiatov
Copy link
Contributor Author

@swift-ci test

@MaxDesiatov
Copy link
Contributor Author

@swift-ci test windows

@MaxDesiatov
Copy link
Contributor Author

I think we would move it to BuildToolOptions?

Doesn't seem to be currently possible, as we construct BuildParameters in SwiftTool.swift, before BuildToolOptions are even available. Are there any alternatives, or should I just revert the last commit to get back to the initial error message implementation of this?

@neonichu
Copy link
Contributor

One option could be moving the static stdlib option to createBuildSystem() like the other build-only options such as explicitProduct.

@MaxDesiatov
Copy link
Contributor Author

@swift-ci test

@MaxDesiatov
Copy link
Contributor Author

@swift-ci test windows

@MaxDesiatov
Copy link
Contributor Author

@swift-ci test windows

@MaxDesiatov MaxDesiatov merged commit 0849e9d into main Nov 14, 2023
@MaxDesiatov MaxDesiatov deleted the maxd/static-linking-swift-test branch November 14, 2023 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants