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

fix: Flip signs in Time.h's Apple version checks #1688

Conversation

amgleitman
Copy link
Contributor

When trying to bring react-native-macos up to date with 0.66, I was running into an issue getting RNTester to compile due to an error regarding redefining clockid_t. Other people have been seeing similar issues as per these search results.

The history behind this appears to be as follows:

Several declarations in <time.h> were not available on Apple platforms until macOS 10.12 and iOS 10, which is why Folly needs to check the minimum version and set FOLLY_HAVE_CLOCK_GETTIME as needed. The problem is, the current logic as it stands right now is to set FOLLY_HAVE_CLOCK_GETTIME = 1 (which implies that we don't need to declare them ourselves as the OS provides them for us) if...

  • ...we're building for macOS, and the minimum required version is less than 10.12, or...
  • ...we're building for iOS, and the minimum required version is less than 10.

However, this doesn't make any sense. This is saying that we don't need to declare these missing APIs if we could be compiling Folly for use on an older version (i.e., macOS 10.11/iOS 9 or earlier), which is totally wrong! Instead, we ought to be checking if the versions are at least macOS 10.12 or iOS 10.

React Native currently works around this by eliminating the minimum version check entirely with this PR, which is certainly a valid local fix (the minimum iOS version for React Native apps is currently iOS 11), but doesn't solve the problem at its core. This PR does solve the problem.

I have not tested building this with a minimum version below the above thresholds for use on a modern version of macOS/iOS, but considering the discussion in #1545, I think we should be safe to ignore these older versions from now on.

@facebook-github-bot
Copy link
Contributor

Hi @amgleitman!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@Saadnajmi
Copy link
Contributor

@kelset I remember there was a lot of issues around the post_install_script phase on iOS around the RN Core 0.66 release. I think this is related, and a more long term fix that may help with removing the need for that phase.

@Saadnajmi
Copy link
Contributor

New year, new ping! Anything we can do to move this PR forward? I'm somewhat optimistic it'll help remove some of the "hacks" were needed for RN 0.66 =)

@facebook-github-bot
Copy link
Contributor

@Orvid has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants