Skip to content

Commit

Permalink
[nix] Fix glog Pod build on Nix with Xcode 15
Browse files Browse the repository at this point in the history
Summary:
The clang that is bundled in Xcode 15 now generates a different "triple" (compilation target) when it sees `MACOSX_DEPLOYMENT_TARGET` set. Instead of looking at the `isysroot`, for some reason it overrides that based on `MACOSX_DEPLOYMENT_TARGET`.

Nix sets `MACOSX_DEPLOYMENT_TARGET` to 11 for some backwards compatibility reason.

As a result, we started seeing build failures for the glog Pod in Nix after upgrading to Xcode 15.

This diff solves the issue by overriding `MACOSX_DEPLOYMENT_TARGET` to the empty string.

Test Plan:
1. To reproduce the error, you first need to clear your pods cache: `pod cache clean --all && rm -rf native/ios/Pods`
2. Then try running a `yarn cleaninstall` (or manually running `yarn postinstall` in the root)

Before this diff it failed with Xcode 15 + Nix, but now it succeeds.

Reviewers: atul

Reviewed By: atul

Subscribers: tomek, wyilio

Differential Revision: https://phab.comm.dev/D9568
  • Loading branch information
Ashoat committed Oct 23, 2023
1 parent 7990a46 commit 0075027
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion postinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ yarn flow-mono create-symlinks native
yarn workspace native jetify

if [[ "$OSTYPE" == "darwin"* ]]; then
(cd native/ios && PATH=/usr/bin:/bin:"$PATH" pod install --repo-update)
(cd native/ios && PATH=/usr/bin:/bin:"$PATH" MACOSX_DEPLOYMENT_TARGET='' pod install --repo-update)
fi

0 comments on commit 0075027

Please sign in to comment.