Skip to content

Improve search paths for XCFrameworks #5724

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
Nov 2, 2022
Merged

Conversation

neonichu
Copy link
Contributor

When packaging a Swift dylib as an XCFramework, its modules will be at the top-level, so that directory needs to become part of search paths.

fixes #5723

@neonichu neonichu self-assigned this Aug 12, 2022
@neonichu
Copy link
Contributor Author

@swift-ci please smoke test

@hassila
Copy link

hassila commented Aug 16, 2022

Just did a simple test:

Built a local SwiftPM and just tried building my sample project with this patch applied instead of the standard toolchain 'swift build' one and it worked:

hassila@ice ~/G/prototype-library-evolution-client (main)> swift build
Building for debugging...
/Users/hassila/GitHub/prototype-library-evolution-client/Sources/PrototypeLibraryEvolutionClient/PrototypeLibraryEvolutionClient.swift:2:8: error: no such module 'PrototypeLibraryEvolution'
import PrototypeLibraryEvolution
       ^
/Users/hassila/GitHub/prototype-library-evolution-client/Sources/PrototypeLibraryEvolutionClient/PrototypeLibraryEvolutionClient.swift:2:8: error: no such module 'PrototypeLibraryEvolution'
import PrototypeLibraryEvolution
       ^

hassila@ice ~/G/prototype-library-evolution-client (main) [1]> ../swift-package-manager/.build/debug/swift-build
Building for debugging...
[3/3] Linking PrototypeLibraryEvolutionClient
Build complete! (0.34s)
hassila@ice ~/G/prototype-library-evolution-client (main)> ls

@abertelrud
Copy link
Contributor

Thanks for trying it out @hassila! @neonichu, this just needs tests, or is there more to the fix?

@tomerd tomerd added the WIP Work in progress label Aug 25, 2022
When packaging a Swift dylib as an XCFramework, its modules will be at the top-level, so that directory needs to become part of search paths.

fixes #5723
@neonichu neonichu force-pushed the fix-xcframeworks-search-paths branch from 084a3ce to dbea3ab Compare November 1, 2022 23:43
@neonichu neonichu removed the WIP Work in progress label Nov 1, 2022
@neonichu neonichu marked this pull request as ready for review November 1, 2022 23:43
@neonichu neonichu requested review from tomerd and elsh as code owners November 1, 2022 23:43
@neonichu
Copy link
Contributor Author

neonichu commented Nov 1, 2022

@swift-ci please smoke test

@neonichu
Copy link
Contributor Author

neonichu commented Nov 2, 2022

@swift-ci please smoke test macOS

@tonyarnold
Copy link
Contributor

@neonichu will this fix be in the next public release of Swift? (after Swift 5.7.1)

@neonichu
Copy link
Contributor Author

I think we haven't branched for 5.8 yet, so that should be the case.

@tonyarnold
Copy link
Contributor

Thanks! I appreciate the info 😄

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.

xcframework binary dependency does not work from SPM/CLI (but does with Xcode)
5 participants