Skip to content
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

Fix testable executables once more #6875

Merged
merged 1 commit into from
Sep 8, 2023

Conversation

neonichu
Copy link
Member

@neonichu neonichu commented Sep 6, 2023

A previous problem here was fixed in #6723, this new fix is attempting to resolve issues where macros are used transitively by a product that a test is depending on. It seems to me that those transitively available macros should not be statically linked into tests and in fact doing so can cause various issues such as linker errors on non-Darwin platforms.

It does feel like eventually we need to get away from computeDependencies(of:) being a computation on the entire package graph and instead let each package produce separate products which we can then just use transitively, but that is a much bigger change to SwiftPM's build system.

rdar://115071012

A previous problem here was fixed in #6723, this new fix is attempting to resolve issues where macros are used transitively by a product that a test is depending on. It seems to me that those transitively available macros should not be statically linked into tests and in fact doing so can cause various issues such as linker errors on non-Darwin platforms.

It does feel like eventually we need to get away from `computeDependencies(of:)` being a computation on the entire package graph and instead let each package produce separate products which we can then just use transitively, but that is a much bigger change to SwiftPM's build system.

rdar://115071012
@neonichu neonichu self-assigned this Sep 6, 2023
@neonichu
Copy link
Member Author

neonichu commented Sep 6, 2023

@swift-ci please test

@neonichu
Copy link
Member Author

neonichu commented Sep 6, 2023

@swift-ci please test package compatibility

@neonichu
Copy link
Member Author

neonichu commented Sep 8, 2023

There's one failure in package compatibility, in swift-foundation. It doesn't look related:

/Users/ec2-user/jenkins/workspace/swift-package-manager-source-compat-suite-PR-macos/swift-source-compat-suite/project_cache/swift-foundation/Sources/FoundationEssentials/UUID.swift:15:16: error: package import can only be used from a module with a package name; set it with the compiler flag -package-name
package import _CShims // uuid.h
               ^
/Users/ec2-user/jenkins/workspace/swift-package-manager-source-compat-suite-PR-macos/swift-source-compat-suite/project_cache/swift-foundation/Sources/FoundationEssentials/_FoundationInternals/LockedState.swift:17:16: error: package import can only be used from a module with a package name; set it with the compiler flag -package-name
package import os
               ^
error: fatalError

@neonichu
Copy link
Member Author

neonichu commented Sep 8, 2023

The failure is actually already known in baseline, so it's definitely unrelated. So this can be merged.

@neonichu neonichu merged commit 00a64df into main Sep 8, 2023
5 of 6 checks passed
@neonichu neonichu deleted the fix-testable-executables-once-more branch September 8, 2023 17:07
MaxDesiatov pushed a commit that referenced this pull request Sep 28, 2023
A previous problem here was fixed in #6723, this new fix is attempting to resolve issues where macros are used transitively by a product that a test is depending on. It seems to me that those transitively available macros should not be statically linked into tests and in fact doing so can cause various issues such as linker errors on non-Darwin platforms.

It does feel like eventually we need to get away from `computeDependencies(of:)` being a computation on the entire package graph and instead let each package produce separate products which we can then just use transitively, but that is a much bigger change to SwiftPM's build system.

rdar://115071012
MaxDesiatov pushed a commit that referenced this pull request Sep 28, 2023
A previous problem here was fixed in #6723, this new fix is attempting to resolve issues where macros are used transitively by a product that a test is depending on. It seems to me that those transitively available macros should not be statically linked into tests and in fact doing so can cause various issues such as linker errors on non-Darwin platforms.

It does feel like eventually we need to get away from `computeDependencies(of:)` being a computation on the entire package graph and instead let each package produce separate products which we can then just use transitively, but that is a much bigger change to SwiftPM's build system.

rdar://115071012
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.

None yet

2 participants