-
Notifications
You must be signed in to change notification settings - Fork 24.5k
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
[iOS]Fix glog & Flipper-Glog build failed on Apple Silicon #32380
Conversation
Base commit: 61e1b6f |
Base commit: 61e1b6f |
@sota000 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
@@ -9,6 +9,28 @@ set -e | |||
PLATFORM_NAME="${PLATFORM_NAME:-iphoneos}" | |||
CURRENT_ARCH="${CURRENT_ARCH}" | |||
|
|||
# Fix build on Apple Silicon | |||
if [ "$CURRENT_ARCH" == "arm64" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if [ "$CURRENT_ARCH" == "arm64" ]; then | |
if [ "${CURRENT_ARCH:-$(arch)}" == "arm64" ]; then |
in my situation, I was finding that $CURRENT_ARCH
was not set. not sure why, but this solves it and should potentially be hoisted to line 10 (but I'm not sure if that impacts later code)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alternatively, you can move this entire code beneath the if statement below (which handles the missing CURRENT_ARCH case)
Co-authored-by: Lew Blood <[email protected]>
Co-authored-by: Lew Blood <[email protected]>
Summary: This is a fixed version of the #32380 PR. It solves a typo, prevents variable substitution in the patch file, and moves it to a better place in the script so that CURRENT_ARCH is actually detected before checking whether to patch. The `config.sub` included in glog is too old and does not recognize `arm64-*` as a valid arch when building. This, combined with an out of date Flipper-Glog version, results in persistent build failures on Apple Silicon machines. p.s. i assume all the podfile lock changes were caused by me running this on an Apple Silicon Mac, and thus all the pod checksums were run against the arm64 versions of those pods rather than the normal x86_64 versions. if this is an issue I can revert the changes to that file, but it would seem to be an inevitable issue in future PR diffs... ## Changelog - [iOS] [Fixed] - Apple Silicon builds of glog & Flipper-Glog Pull Request resolved: #32486 Test Plan: - Clone this branch on both an Apple Silicon- & Intel-based Mac - Run `pod install` in `packages/rn-tester` - Confirm that build passes successfully Reviewed By: cortinico Differential Revision: D32080994 Pulled By: yungsters fbshipit-source-id: 76a7c5bba20d91905455920609c890e92bb5b980
This seems to be a dup work with #32486. Though it sounds like we have blocker to merge the diff. I'll close this one for now, but please re-open if this is still relevant. |
Summary: NOTE: Second attempt at merging #32486 (D32080994 (25d4cb9)). This is a fixed version of the #32380 PR. It solves a typo, prevents variable substitution in the patch file, and moves it to a better place in the script so that CURRENT_ARCH is actually detected before checking whether to patch. The `config.sub` included in glog is too old and does not recognize `arm64-*` as a valid arch when building. This, combined with an out of date Flipper-Glog version, results in persistent build failures on Apple Silicon machines. p.s. i assume all the podfile lock changes were caused by me running this on an Apple Silicon Mac, and thus all the pod checksums were run against the arm64 versions of those pods rather than the normal x86_64 versions. if this is an issue I can revert the changes to that file, but it would seem to be an inevitable issue in future PR diffs... ## Changelog - [iOS] [Fixed] - Apple Silicon builds of glog & Flipper-Glog Pull Request resolved: #32486 Test Plan: See `react-native-oss-ios` Sandcastle job succeed. Reviewed By: fkgozali Differential Revision: D32256761 Pulled By: yungsters fbshipit-source-id: c7f32b72287018f070910b26aad02aa0adf4a61f
Summary
Because glog's
config.stub
&&config.guess
is too old, so executepod install
on Apple Silicon devices will failed, error message isInvalid configuration 'arm64-apple-darwin20.2.0': machine 'arm64-apple' not recognized
.So we need to update these 2 files from GNU to fix this problem.Patch
config.sub
to recognize arm64-appleChangelog
[iOS] [Fixed] - Fix glog & Flipper-Glog build failed on Apple Silicon
Test Plan
packages/rn-tester/Podfile
(becase Flipper-Glog has this problem too).pod install
, build and run tester app.