Open benlangmuir opened 2 years ago
Hi @igor-makarov 👋
This is failing to build in our source compatibility suite due to the fact that with Xcode's clang this is a warning, but with open source clang (including the clang in our swift.org toolchain) it's an error by default.
We wanted to bring this error to your attention. I was able to confirm that adding the appropriate #import <TargetConditionals.h>
statements does in fact fix the build.
If you decide to update your project, I would recommend updating the project definition in the source compat suite. This will allow your project to be continuously tested with compiler changes properly. https://github.com/apple/swift-source-compat-suite/blob/main/projects.json#L2368
So here's the issue: while SwiftPM-Packages/ReactiveObjC.swiftpm is my repo, it merely exists to reference a legacy library located in https://github.com/ReactiveCocoa/ReactiveObjC and link it as a Swiff PM package.
The legacy library does not belong to me and I do not see a path forward where someone updates it for this specific concern.
FYI @zixu-w @xymus @benlangmuir can I do something about this that doesn't involve changes to the legacy library? Perhaps make some changes to the cSettings
?
Adding -Wno-error=undef-prefix
to the compilation will demote the error to a warning, but I don't know if swiftpm has a way to specify that without using unsafeFlags
. @MaxDesiatov?
Adding
-Wno-error=undef-prefix
to the compilation will demote the error to a warning, but I don't know if swiftpm has a way to specify that without usingunsafeFlags
. @MaxDesiatov?
Not at the moment, unfortunately.
Attachment: Download
Environment
Swift 5.5 from swift.org (with Xcodes's clang it is a warning).Additional Detail from JIRA
| | | |------------------|-----------------| |Votes | 0 | |Component/s | | |Labels | Bug | |Assignee | None | |Priority | Medium | md5: 2f367cbeee8b0f06e0fad0c33591725aIssue Description:
Jenkins URL: https://ci.swift.org/job/swift-main-source-compat-suite/6220
This is affecting many other files in this project as well. The consequence is that these macros are always undefined, causing code to not be compiled that ought to. The fix is to add
#import <TargetConditionals.h>
to any files using these macros.I believe this problem was hidden before, because we were defaulting to this being a warning instead of an error.