-
-
Notifications
You must be signed in to change notification settings - Fork 871
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: SPM build issues with Xcode 16 #1795
Conversation
parse-community#1793 There is an issue with the Package.swift file where it uses wildcard globbing to refer to all the private header directories that should be included when building. It turns out that it was a mistake that Xcode ever supported wildcard globbing in the first place, as described here: https://forums.swift.org/t/recursive-headersearchpath/59769 To fix it, we are replacing the wildcard glob with a list of all header directories. This issue was first observed on Xcode 16.0.0 beta 1. I confirmed that it now builds correctly on Xcode 16.0.0 beta 2.
Thanks for opening this pull request!
|
Has this only been a temporary bug in a beta version of Xcode 16? If I understand correctly, you are saying that the bug has been fixed in a later beta version and this PR here would not be necessary anymore? cc @bmueller |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1795 +/- ##
==========================================
+ Coverage 64.24% 72.28% +8.04%
==========================================
Files 201 148 -53
Lines 23233 17268 -5965
==========================================
- Hits 14926 12483 -2443
+ Misses 8307 4785 -3522 ☔ View full report in Codecov by Sentry. |
This has been confirmed to still be an issue in the latest Xcode 16 beta, which is beta 3 (not by me, but I heard it from someone else). It seems Xcode 16 actually fixed a bug, and that's why we need this PR. In this Swift forums thread from 2022, someone asked about the globbing behavior, and this is the relevant reply from NeoNacho:
It sounds like earlier versions of SPM unintentionally supported globbing, and Apple has likely fixed that and removed globbing support. So we would need to list all directories for forward compatibility. I looked at a few other SPM modules I use, and they all list out all directories they use, just as this PR does. |
Whoops, now I see how my statement was poorly worded. Let me re-state that. Issue #1793 was first seen in Xcode 16.0.0 beta 1. It was confirmed to still exist in Xcode 16.0.0 beta 2 and beta 3. We should expect this to not be addressed in future versions of Xcode 16 beta, because we are probably seeing this as a result of a fix by Xcode of a previously undesired behavior. With the PR fix applied, we have verified that the build is now fixed in Xcode 16.0.0 beta 2 and Xcode 16.0.0 beta 3. I also just confirmed that with the PR fix applied, it continues to build correctly in Xcode 15.4.0. |
Sounds good to me. Xcode 16 is in beta, but we do not run our CI with prerelease versions. Since everyone confirmed that this PR fixes the issue we can merge it, but in order to prevent regression we will need to add Xcode 16 to our CI once it's released. |
Confirmed. |
## [4.1.1](4.1.0...4.1.1) (2024-07-15) ### Bug Fixes * SPM build issues with Xcode 16 ([#1795](#1795)) ([5381325](5381325))
🎉 This change has been released in version 4.1.1 |
New Pull Request Checklist
Issue Description
There is an issue with the Package.swift file where it uses wildcard globbing to refer to all the private header directories that should be included when building.
It turns out that it was a mistake that Xcode ever supported wildcard globbing in the first place, as described here:
https://forums.swift.org/t/recursive-headersearchpath/59769
Closes: #1793
Approach
To fix it, we are replacing the wildcard glob with a list of all header directories.
I generated the list of directories with:
This issue was first observed on Xcode 16.0.0 beta 1. I confirmed that it now builds correctly on Xcode 16.0.0 beta 2.
TODOs before merging
I would appreciate if someone could verify that this correctly compiles on both Xcode 15 and Xcode 16, using SPM for both.