actions / runner-images

GitHub Actions runner images
MIT License
9.35k stars 2.9k forks source link

MacOS {12-14} GCC build failures #9997

Open EmilDohne opened 3 weeks ago

EmilDohne commented 3 weeks ago

Description

When compiling my C++ Library on MacOS 12, 13 and 14 I get a bunch of error messages from the stdlib which I am assuming has to do with the GCC bump to 13.3 in the last runner updates.

Would it be possible to drop the version again or provide a XCode 15.3 build on the macos runners as it appears that the compilation works with that version (Tested by running the macos-latest runners with XCode 15.3 which resolves the issues).

/Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdlib.h:182:28: error: macro "__API_AVAILABLE2" requires 2 arguments, but only 1 given
  182 | __API_AVAILABLE(macos(10.0)) __IOS_PROHIBITED
      |                            ^
In file included from /Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/Availability.h:166,
                 from /Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/string.h:63,
                 from /Users/runner/work/PhotoshopAPI/PhotoshopAPI/thirdparty/libdeflate/lib/../common_defs.h:56,
                 from /Users/runner/work/PhotoshopAPI/PhotoshopAPI/thirdparty/libdeflate/lib/lib_common.h:40,
                 from /Users/runner/work/PhotoshopAPI/PhotoshopAPI/thirdparty/libdeflate/lib/utils.c:28:
/usr/local/Cellar/gcc@13/13.3.0/lib/gcc/13/gcc/x86_64-apple-darwin21/13/include-fixed/AvailabilityInternal.h:4502: note: macro "__API_AVAILABLE2" defined here
 4502 |     #define __API_AVAILABLE2(x,y) __API_A(x) __API_A(y)
      | 
/Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdlib.h:184:1: error: expected ';' before 'int'
  184 | int      system(const char *) __DARWIN_ALIAS_C(system);
      | ^~~
/Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdlib.h:220:[12](https://github.com/EmilDohne/PhotoshopAPI/actions/runs/9256194501/job/25825001717#step:5:13)3: error: macro "__API_AVAILABLE5" requires 5 arguments, but only 4 given
  220 | int ptsname_r(int fildes, char *buffer, size_t buflen) __API_AVAILABLE(macos(10.[13](https://github.com/EmilDohne/PhotoshopAPI/actions/runs/9256194501/job/25825001717#step:5:14).4), ios(11.3), tvos(11.3), watchos(4.3));
      |                                                                                                                           ^
/usr/local/Cellar/gcc@13/13.3.0/lib/gcc/13/gcc/x86_64-apple-darwin21/13/include-fixed/AvailabilityInternal.h:4505: note: macro "__API_AVAILABLE5" defined here
 4505 |     #define __API_AVAILABLE5(x,y,z,t,b) __API_A(x) __API_A(y) __API_A(z) __API_A(t) __API_A(b)
      | 
/Applications/Xcode_[14](https://github.com/EmilDohne/PhotoshopAPI/actions/runs/9256194501/job/25825001717#step:5:15).2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdlib.h: In function 'ptsname_r':
/Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdlib.h:220:56: error: expected declaration specifiers before '__API_AVAILABLE5'
  220 | int ptsname_r(int fildes, char *buffer, size_t buflen) __API_AVAILABLE(macos(10.13.4), ios(11.3), tvos(11.3), watchos(4.3));
      |                                                        ^~~~~~~~~~~~~~~
In file included from /Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdlib.h:256:
/Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_dev_t.h:31:31: error: storage class specified for parameter 'dev_t'
   31 | typedef __darwin_dev_t        dev_t;    /* device number */
      |                               ^~~~~
In file included from /Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdlib.h:257:
/Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_mode_t.h:31:33: error: storage class specified for parameter 'mode_t'
   31 | typedef __darwin_mode_t         mode_t;
      |                                 ^~~~~~
/Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdlib.h:299:34: error: expected ')' before 'char'
  299 | char    *devname_r(dev_t, mode_t, char *buf, int len);
      |                                  ^~~~~
      |                                  )
/Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdlib.h:349:74: error: macro "__API_AVAILABLE5" requires 5 arguments, but only 4 given
  349 |         __API_AVAILABLE(macos(10.[15](https://github.com/EmilDohne/PhotoshopAPI/actions/runs/9256194501/job/25825001717#step:5:16)), ios(13.0), tvos(13.0), watchos(6.0));
      |                                                                          ^
/usr/local/Cellar/gcc@13/13.3.0/lib/gcc/13/gcc/x86_64-apple-darwin21/13/include-fixed/AvailabilityInternal.h:4505: note: macro "__API_AVAILABLE5" defined here
 4505 |     #define __API_AVAILABLE5(x,y,z,t,b) __API_A(x) __API_A(y) __API_A(z) __API_A(t) __API_A(b)
      | 
/Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdlib.h:349:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__API_AVAILABLE5'
  349 |         __API_AVAILABLE(macos(10.15), ios(13.0), tvos(13.0), watchos(6.0));
      |         ^~~~~~~~~~~~~~~
/Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdlib.h:357:73: error: macro "__API_AVAILABLE5" requires 5 arguments, but only 4 given
  357 |         __API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0), watchos(7.0));
      |                                                                         ^
/usr/local/Cellar/gcc@13/13.3.0/lib/gcc/13/gcc/x86_64-apple-darwin[21](https://github.com/EmilDohne/PhotoshopAPI/actions/runs/9256194501/job/25825001717#step:5:22)/13/include-fixed/AvailabilityInternal.h:4505: note: macro "__API_AVAILABLE5" defined here
 4505 |     #define __API_AVAILABLE5(x,y,z,t,b) __API_A(x) __API_A(y) __API_A(z) __API_A(t) __API_A(b)
      | 
/Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdlib.h:357:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__API_AVAILABLE5'
  357 |         __API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0), watchos(7.0));
      |         ^~~~~~~~~~~~~~~
/Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdlib.h:364:14: error: storage class specified for parameter 'suboptarg'
  364 | extern char *suboptarg;         /* getsubopt(3) external variable */
      |              ^~~~~~~~~

Here you can find the relevant builds, I have included one which I reran today which passed last week

Failure: https://github.com/EmilDohne/PhotoshopAPI/actions/runs/9256194501/job/25825001717 Success: https://github.com/EmilDohne/PhotoshopAPI/actions/runs/9256194501/job/25461660008

Platforms affected

Runner images affected

Image version and build link

Image: macos-13 Version: 20240526.1

https://github.com/EmilDohne/PhotoshopAPI/actions/runs/9365076914/job/25779508461

Is it regression?

Yes

Expected behavior

Compilation works as intended

Actual behavior

Compilation fails from stdlib

Repro steps

  1. Compile PhotoshopAPI with GCC 13 on a MacOS runner
  2. Failure
quentin commented 3 weeks ago

Is this fixed by https://github.com/Homebrew/homebrew-core/pull/173647 ?

EmilDohne commented 3 weeks ago

Looks like it is, since this isnt too critical right now I will wiat for this to be propagated to the runners instead of trying to shoehorn something together but thanks for the cross-link @quentin :)

erik-bershel commented 2 weeks ago

Hey @EmilDohne!

Should be fixed with the next image release as I see. Will be done by the end of this week.

EmilDohne commented 2 weeks ago

Hey @erik-bershel

Awesome! Thanks for looking into this :)

erik-bershel commented 1 week ago

Still working on the updates for macOS-12 runners. Moved to the next week. macOS-13 and macOS-14 based should be okay for now. May I ask you to check it, @EmilDohne? Thank you in advance.

EmilDohne commented 1 week ago

Hey @erik-bershel , unfortunately after running the ci again it still raises the same issues. I am currently away from home so I could investigate more once im back but for now it doesnt appear to work sadly :(

XCode 15.3 works however which is what i did before porting the patches but it isnt available on macos13 runners yet afaik

erik-bershel commented 1 week ago

XCode 15.3 works however which is what i did before porting the patches but it isnt available on macos13 runners yet afaik

Yeah, will never be tbh. It's macOS-14 privilege kinda. I expected that the update for GCC would help avoid the problem of incompatibility with previous versions of Xcode - unfortunately, my expectations were not met. 😞😞😞

thejohnfreeman commented 1 week ago

This seems broken still on macos-14, 20240611.1.

erik-bershel commented 1 week ago

Hey @thejohnfreeman!

Be aware that the Xcode by default is 15.0.1 for macOS-14 (reference). Please, configure your job to work with the Xcode 15.3 or later in order to be compatible with GCC 13.3. Might be done using https://github.com/maxim-lobanov/setup-xcode