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
cmake builds with gcc-11 on macOS now permafail #10356
Comments
I honestly have no clue what this is. |
Xcode 14.0.1 does not reproduce this errors. So it happen on 14.1 and 14.2. Not sure if this is fixed in 14.3. |
ah! |
issue is faced on neovim as well: https://www.reddit.com/r/neovim/comments/yz3peb/compiling_and_running_make_unittest_on_macos/ |
Specifically gcc provided via Homebrew. This package doesn't ship with binutils, so for now this build mode relies on Xcode tools. This means they suffer from the same reproducibility bugs as Apple clang builds. Must supply this to enable: export CW_CCSUFFIX='-13' Optional: export CW_CONFIG='-gcc' Follow-up to 5add616 Build is broken with the latest Xcode and CommandLineTools, due to this: curl/curl#10356 ``` In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk/usr/include/dispatch/dispatch.h:28, from /Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:20, from /Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFPropertyList.h:17, from /Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:66, from /Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk/System/Library/Frameworks/SystemConfiguration.framework/Headers/SCDynamicStoreCopySpecific.h:30, from .../curl/lib/macos.c:33, from .../curl/bld-cmake-gcc-x64-sys/lib/CMakeFiles/libcurl_object.dir/Unity/unity_0_c.c:241: /Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk/usr/include/os/object.h:275:1: error: expected ';' before 'extern' 275 | OS_EXPORT OS_SWIFT_UNAVAILABLE("Can't be used with ARC") | ^~~~~~~~~ /Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk/usr/include/os/clock.h:14:1: error: expected ';' before 'typedef' 14 | OS_ENUM(os_clockid, uint32_t, | ^~~~~~~ In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk/usr/include/os/workgroup.h:29, from /Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk/usr/include/dispatch/dispatch.h:64: /Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk/usr/include/os/workgroup_base.h:67:1: error: expected ';' before 'struct' 67 | struct OS_REFINED_FOR_SWIFT os_workgroup_attr_opaque_s { | ^~~~~~ [...] ``` The root cause is not Xcode itself but the default SDK it's pointing to. With SDK 12 it compiles without error. The failure above is with SDK 13, the default SDK since Xcode 14.
The issue is not with Xcode 14.1 per se, but with the macOS SDK 13, I could fix this error by building against SDK 12. With CMake, this can be done with: cmake -DCMAKE_OSX_SYSROOT=$(xcrun -sdk macosx --show-sdk-path | sed 's/\.sdk/12.sdk/') [...] See: curl/curl-for-win@e2db3c4 It means we could upgrade to the latest Xcode and set the above |
I was testing it againist 14.2 which is now the default on macOS CI but it still fails |
Sorry if my post was unclear, but I didn't say that Xcode 14.2 would fix this. This could only be true if Apple fixed their latest default SDKs to be gcc-compatible. Till this happens, the workaround is to force building against an older SDK that is compatible with gcc, e.g. SDK 12. This needs that SDK to be present, then CMake needs to be told to use it instead of the default. Here's the code doing that in curl-for-win: |
These builds seem to have started to fail on Jan 21, 2023. Before that the cmake builds failed because of homebrew problems but on the 21st the problem changed to seemingly only not work for gcc-11 on mac. Before the homebrew problems (Jan 8), those builds worked fine in the CI.
The three builds are known as
Example build failure (from here):
The text was updated successfully, but these errors were encountered: