Skip to content
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

Target to Mac OS X 10.12+ in release build workflow #49595

Merged
merged 1 commit into from Jul 5, 2021
Merged

Conversation

BrettDong
Copy link
Member

Summary

None

Purpose of change

The package built on GitHub Actions targets to macOS 10.15 so it doesn't run on older Mac OS X systems. See #49570, #49572.

Describe the solution

Target to Mac OS X 10.12+.

10.12 is chosen because it is the earliest version to ship system libraries that have proper C++14 support.

Describe alternatives you've considered

None

Testing

None

Additional context

To really fix the two issues, current macOS packages on https://github.com/CleverRaven/Cataclysm-DDA/releases/tag/0.F needs to be deleted and a manual build is needed.

@BrettDong BrettDong added Code: Build Issues regarding different builds and build environments OS: macOS Issues related to macOS / OSX operating system labels Jul 5, 2021
@ZhilkinSerg ZhilkinSerg merged commit 74a89d3 into master Jul 5, 2021
@BrettDong BrettDong deleted the mac-release branch July 5, 2021 15:08
@jbytheway
Copy link
Contributor

jbytheway commented Jul 8, 2021

FYI, once #49598 is merged I'm planning to switch us to C++17 (at least, the subset of C++17 supported by gcc 7.5 and clang 6, which is everything except a few library features). What Mac OS version would be appropriate for that? Do we need to hold back because older Mac OS are still popular?

@BrettDong
Copy link
Member Author

BrettDong commented Jul 8, 2021

I don't actually know which macOS version is "C++17 compatible", because I haven't encountered any C++17 & macOS bug yet. But I did experience a C++14 program exhibiting unexpected behaviour when compiled with -mmacosx-version-min=10.11 while the program runs completely normal if compiled with -mmacosx-version-min=10.12.

@actual-nh actual-nh added the <Bugfix> This is a fix for a bug (or closes open issue) label Jul 8, 2021
@actual-nh
Copy link
Contributor

actual-nh commented Jul 9, 2021

EDIT: Correction; I didn't see the "Apple Clang" column; I'm not sure what simply "Yes" means; XCode 10 is required for about half of the library; having a file system library up to spec requires XCode 11; XCode 12 is required for "std::shared_ptr and std::weak_ptr with array support", and no version has FP support for fully-compliant string conversions.

XCode and versions: https://xcodereleases.com/ says XCode 10 requires 10.13.6+, and was released in non-beta in 2018. XCode 11 requires 10.14.4+, and was released for non-beta in 2019.

@jbytheway
Copy link
Contributor

I've just noticed that the "Apple Clang" column on the cppreference page has tool tips for XCode versions. Agreed that it looks like we would need XCode 10.0 to get reasonable library support (in particular, std::optional and std::string_view, which are the two library features I was most hoping for).

For other platforms we base our decision on what has 'official support' (although excluding Ubuntu extended security maintenance). I'm struggling to find any reference for what Apple supports. The closest I've found is this page that sort of implies that 10.2x is the oldest supported version of XCode, but it's not explicit.

If we instead extrapolated the rule of thumb of "we should support things for five years" which is essentially what ends up happening with Ubuntu, then I guess we'd be looking at XCode 8.0 / Mac OS 10.11. We'd reach XCode 10.0 in June 2023.

I don't want to cut out active developers, and I don't really understand the Apple ecosystem (for example, how easy it is to upgrade Mac OS or use a different compiler than XCode), so I'd like to hear your thoughts on what would be reasonable.

@jbytheway
Copy link
Contributor

OK, I found this article which explains how to use this page to determine which versions of Mac OS are still supported by Apple, based on seeing what they are releasing security updates for.

It looks like they are definitely supporting Mojave (10.14), but the last patch for High Sierra (10.13) was in November, which suggests that is no longer supported.

@actual-nh
Copy link
Contributor

actual-nh commented Jul 10, 2021

I don't want to cut out active developers, and I don't really understand the Apple ecosystem (for example, how easy it is to upgrade Mac OS or use a different compiler than XCode), so I'd like to hear your thoughts on what would be reasonable.

In terms of ease of upgrade... depends on your hardware. There's an upper limit to what any given older mac hardware can support (frequently a bit higher than Apple will admit, but there are limits). For instance, my computer is a 2012 mac mini; the highest version that it can run is 10.12 (.6, as it happens). (I am uncomfortable with regard to not supporting 10.11, but it appears that C++14 is now necessary for the codebase. I can only call myself biased in evaluating whether 10.12 should be supported!) As a hardware manufacturer, Apple does have an incentive to stop supporting versions that can run on hardware they'd like to replace, to be blunt.

In terms of compilers other than XCode, dunno; I've found it more reliable than non-apple compilers, but that may have been fixed by now. How much room does gcc take on disk, and what version should I try compiling if it isn't too much room?

Library compatibility is an equally large issue, and is the cause of about half the limits on using C++17 according to the site. Depending on what library functions were used, this could make it impossible for someone on an older Mac to play the game, much less help develop it, unless they were able to get another c++ library running and the game was designed to use it. (The OS X ld is not set up to do static compiles for anything except the kernel, BTW.) I suppose CDDA could distribute a library, the same way as some libraries are included in the distributed dmg even now, although that would make the dmg rather larger...

@jbytheway
Copy link
Contributor

A gcc binary installation doesn't take up much space, but compiling your own gcc will take a lot more (my gcc working copy with all the source code and build objects is 10GB) because it has all the support and libraries for a bunch of other languages besides C/C++.

Given what you've said, I guess I'm now leaning towards a "support for five years" rule of thumb. By that metric we ought to be supporting 10.11 still, but I guess that ship has sailed. The next relevant event will be switching to XCode 10.0 in June 2023. I'll PR a change to the docs and see if anyone else has any input.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bugfix> This is a fix for a bug (or closes open issue) Code: Build Issues regarding different builds and build environments OS: macOS Issues related to macOS / OSX operating system (P2 - High) High priority (for ex. important bugfixes)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants