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

MacOS: Fixes configuration hang; bump MacOS SDK. #8530

Merged
merged 2 commits into from
Jan 13, 2020
Merged

MacOS: Fixes configuration hang; bump MacOS SDK. #8530

merged 2 commits into from
Jan 13, 2020

Conversation

s-daveb
Copy link
Contributor

@s-daveb s-daveb commented Dec 22, 2019

Removed conditional use of std::mutex instead of std::shared_mutex on MacOS.

Because MacOS < 10.12 did not support std::shared_mutex, a previous commit
naïvely substituted std::mutex, which does not have the same behavior.

Reverses PR #8273, which substitues std::mutex for std::shared_mutex on
macOS, and results in several bugs that seem to only affect MacOS

This change eliminates conditional code for MacOS in the core configuration
layer code and enables the use of modern language features that are more
secure and thread-safe.

Removed conditional use of std::mutex instead of std::shared_mutex on MacOS.

Because MacOS < 10.12 did not support std::shared_mutex, a previous commit
naïvely substituted std::mutex, which does not have the same behavior.

Reverses PR #8273, which substitues std::mutex for std::shared_mutex on
macOS, and results in several bugs that seem to only affect MacOS

- https://bugs.dolphin-emu.org/issues/11919
- https://bugs.dolphin-emu.org/issues/11842
- https://bugs.dolphin-emu.org/issues/11845

This change eliminates conditional code for MacOS in the core configuration
layer code and enables the use of modern language features that are more
secure and thread-safe.
Copy link
Contributor

@stenzek stenzek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Probably should update README.md as well to reflect the new minimum version.

@pizuz
Copy link

pizuz commented Dec 22, 2019

Is there a reason why there are no macOS checks in this branch? I'd really like to test this.

@stenzek
Copy link
Contributor

stenzek commented Dec 22, 2019

Probably buildbot issues.

Yep, been stuck for ~3 hours apparently.

@JosJuice
Copy link
Member

Thanks for figuring out the issue!

@s-daveb
Copy link
Contributor Author

s-daveb commented Dec 22, 2019

I encountered similar build issues at first. I believe the MacOS Buildbot needs to have its SDK upgraded.

@pizuz
Copy link

pizuz commented Dec 22, 2019

I believe the MacOS Buildbot needs to have its SDK upgraded.

Looks like this won't even be necessary, since Buildbot is already using the 10.14 SDK. Looks like this argument is to blame:

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -mmacosx-version-min=10.10.0

This results in XCode throwing this error:

error: 'shared_mutex' is unavailable: introduced in macOS 10.12

@s-daveb
Copy link
Contributor Author

s-daveb commented Dec 22, 2019

I believe the MacOS Buildbot needs to have its SDK upgraded.

Looks like this won't even be necessary, since Buildbot is already using the 10.14 SDK. Looks like this argument is to blame:

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -mmacosx-version-min=10.10.0

This results in XCode throwing this error:

error: 'shared_mutex' is unavailable: introduced in macOS 10.12

From what I understand of the CMake documentation, "CMake uses this variable value [CMAKE_OSX_DEPLOYMENT_TARGET] for the -mmacosx-version-min flag or their respective target platform equivalents. "

I'm not sure how buildbot is configured, but if there is an environment or commandline parameter hardcoding CMAKE_OSX_DEPLOYMENT_TARGET to 10.10, that could explain the failure.

@stenzek
Copy link
Contributor

stenzek commented Dec 28, 2019

We might have to clear the cache on the buildbot for the new default to take effect?

@pizuz
Copy link

pizuz commented Dec 30, 2019

While you‘re at it, why not indeed bump the SDK to 10.15 and MoltenVK to the current release for full Metal 3 support? I‘m not sure if this will make any difference performance-wise, but one might at least give it a try.

@s-daveb
Copy link
Contributor Author

s-daveb commented Dec 30, 2019

@pizuz I thought about it, and I realize dolphin is a performance-heavy application that probably doesn’t fare well on older-macs-that-can’t-run-Catalina, but ultimately I decided to bump it only to 10.12 because the compiler pointed out this is the minimum required version for C++17 support.

to;dr I am not part of the project’s development planning, so I bumped it conservatively.

If anyone wants to go ahead and give me the green-light, I don’t mind making Dolphin a Catalina-only application. I just don’t know the reasons why Yosemite is still supported, and don’t want to step on people’s toes.

@JosJuice
Copy link
Member

We've actually discouraged Dolphin users from updating to Catalina, due to the new notarization requirements. I agree that this PR should not set the required version to anything higher than 10.12.

@s-daveb
Copy link
Contributor Author

s-daveb commented Dec 30, 2019

We've actually discouraged Dolphin users from updating to Catalina, due to the new notarization requirements. I agree that this PR should not set the required version to anything higher than 10.12.

@JosJuice @pizuz Ah, I understand now. From what I'm seeing on developer.apple.com, it seems applications built on older SDK's for the time being are grandfathered in until January 2020.

If push comes to shove, from what I'm seeing on the internet, a continuous integration system could also notarize the application in an automated way.

@pizuz
Copy link

pizuz commented Dec 30, 2019

I'm not even sure if Dolphin actually needs to be compiled against the 10.15 SDK in order to make use of the new functions in Metal 3 or if the current MoltenVK dylib alone takes care of that, since it's built against the 10.15 SDK.

@stenzek
Copy link
Contributor

stenzek commented Dec 31, 2019

WRT updating MoltenVK, unless there's a critical issue I'd rather not add megabytes to the repository size when it's not absolutely necessary. There's nothing stopping you from downloading the SDK and replacing it yourself, and this is probably a better way to go about it anyway, rather than including it in the repo (perhaps with an auto downloader).

@gtalusan
Copy link
Contributor

gtalusan commented Jan 2, 2020

If push comes to shove, from what I'm seeing on the internet, a continuous integration system could also notarize the application in an automated way.

https://github.com/rednoah/notarize-app is a project I use to notarize a Qt app from the command line. All it needs is an app-level AppleID password and an AppleID that owns the application identifier of the underlying .pkg/.dmg.

FWIW, the notarizing process is a bit chatty over email.

@stenzek
Copy link
Contributor

stenzek commented Jan 3, 2020

Anyone have any objection to merging this and sorting out the buildbot issues later?

Like I said earlier, it might just be matter of clearing the cache/wiping the build directory.

@stenzek stenzek merged commit ae6d3be into dolphin-emu:master Jan 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants