Permalink
Browse files

Fix configure glog script when building from xcodebuild

Summary:
I encountered an issue when building with fastlane gym / xcodebuild where glog would not build because of missing config.h header file. I tracked it down to the ios-configure-glog.sh script that ended up error-ing because of missing valid c compiler. I guess it didn't enter the if to set c compiler env in xcodebuild and that env doesn't have proper values set like it does in xcode so just removing this check fixed it. Also tested that it still works properly in xcode.
Closes #14267

Differential Revision: D5285691

Pulled By: javache

fbshipit-source-id: df5315926c2d2d78806618df3d9c9bbbb974d1ea
  • Loading branch information...
janicduplessis authored and facebook-github-bot committed Jun 21, 2017
1 parent 1230549 commit 5c53f89dd86160301feee024bce4ce0c89e8c187
Showing with 5 additions and 5 deletions.
  1. +5 −5 scripts/ios-configure-glog.sh
@@ -1,11 +1,11 @@
#!/bin/bash
set -e
# Only set when not running in an Xcode context
if [ -z "$ACTION" ] || [ -z "$BUILD_DIR" ]; then
export CC="$(xcrun -find -sdk iphoneos cc) -arch armv7 -isysroot $(xcrun -sdk iphoneos --show-sdk-path)"
export CXX="$CC"
fi
PLATFORM_NAME="${PLATFORM_NAME:-iphoneos}"
CURRENT_ARCH="${CURRENT_ARCH:-armv7}"
export CC="$(xcrun -find -sdk $PLATFORM_NAME cc) -arch $CURRENT_ARCH -isysroot $(xcrun -sdk $PLATFORM_NAME --show-sdk-path)"
export CXX="$CC"
./configure --host arm-apple-darwin

19 comments on commit 5c53f89

@SudoPlz

This comment has been minimized.

Show comment
Hide comment
@SudoPlz

SudoPlz Jun 21, 2017

Contributor

That commit just fixed my CI failures, and spared me hours of headaches.

Thanks!

Contributor

SudoPlz replied Jun 21, 2017

That commit just fixed my CI failures, and spared me hours of headaches.

Thanks!

@sjmueller

This comment has been minimized.

Show comment
Hide comment
@sjmueller

sjmueller Jun 29, 2017

Contributor

Great fix!

Contributor

sjmueller replied Jun 29, 2017

Great fix!

@SudoPlz

This comment has been minimized.

Show comment
Hide comment
@SudoPlz

SudoPlz Jul 10, 2017

Contributor

The only problem is, that commit doesn't seem to be found in 0.46.0 or 0.46.1 so we still have to wait for 0.47.* to come out.

Contributor

SudoPlz replied Jul 10, 2017

The only problem is, that commit doesn't seem to be found in 0.46.0 or 0.46.1 so we still have to wait for 0.47.* to come out.

@ujwal-setlur

This comment has been minimized.

Show comment
Hide comment
@ujwal-setlur

ujwal-setlur Jul 10, 2017

I second that this needs to come out ASAP and not wait for 0.47. 0.46 is not usable until this is fixed.

ujwal-setlur replied Jul 10, 2017

I second that this needs to come out ASAP and not wait for 0.47. 0.46 is not usable until this is fixed.

@SudoPlz

This comment has been minimized.

Show comment
Hide comment
@SudoPlz

SudoPlz Jul 10, 2017

Contributor

Running the following script on npm post install seems to have fixed my problem:

cd node_modules/react-native/scripts/
curl https://raw.githubusercontent.com/facebook/react-native/5c53f89dd86160301feee024bce4ce0c89e8c187/scripts/ios-configure-glog.sh >ios-configure-glog.sh
chmod +x ios-configure-glog.sh
Contributor

SudoPlz replied Jul 10, 2017

Running the following script on npm post install seems to have fixed my problem:

cd node_modules/react-native/scripts/
curl https://raw.githubusercontent.com/facebook/react-native/5c53f89dd86160301feee024bce4ce0c89e8c187/scripts/ios-configure-glog.sh >ios-configure-glog.sh
chmod +x ios-configure-glog.sh
@ujwal-setlur

This comment has been minimized.

Show comment
Hide comment
@ujwal-setlur

ujwal-setlur Jul 14, 2017

When the heck is this fix coming out??? Even 0.46.2 does not have this change. I apologize if I am sounding impatient, but this is completely blocking an upgrade to rn-0.46. Why is this not getting rolled out? Hopefully, someone is aware that 0.45 and 0.46 are completely broken on iOS???

ujwal-setlur replied Jul 14, 2017

When the heck is this fix coming out??? Even 0.46.2 does not have this change. I apologize if I am sounding impatient, but this is completely blocking an upgrade to rn-0.46. Why is this not getting rolled out? Hopefully, someone is aware that 0.45 and 0.46 are completely broken on iOS???

@ujwal-setlur

This comment has been minimized.

Show comment
Hide comment
@ujwal-setlur

ujwal-setlur Jul 14, 2017

And yes, I know manually running the script or making this code change will resolve it, but still, I would have hoped that such a critical bug fix would have been rolled out soon.

ujwal-setlur replied Jul 14, 2017

And yes, I know manually running the script or making this code change will resolve it, but still, I would have hoped that such a critical bug fix would have been rolled out soon.

@romanenko

This comment has been minimized.

Show comment
Hide comment
@romanenko

romanenko Jul 14, 2017

Yep, this could have been merged into some 0.46.* patch version. Without it our CI builds are broken too.

romanenko replied Jul 14, 2017

Yep, this could have been merged into some 0.46.* patch version. Without it our CI builds are broken too.

@hramos

This comment has been minimized.

Show comment
Hide comment
@hramos

hramos Jul 14, 2017

Contributor

You can nominate commits to be cherry picked by searching for the release number in the issues. The task tracking commits that should be cherry picked into a patch release for 0.46 is at #14713

Please be patient and use these tracking issues to let the maintainers know of anything that needs to be patched. We don't get notified of comments left on commits.

Contributor

hramos replied Jul 14, 2017

You can nominate commits to be cherry picked by searching for the release number in the issues. The task tracking commits that should be cherry picked into a patch release for 0.46 is at #14713

Please be patient and use these tracking issues to let the maintainers know of anything that needs to be patched. We don't get notified of comments left on commits.

@ujwal-setlur

This comment has been minimized.

Show comment
Hide comment
@ujwal-setlur

ujwal-setlur Jul 14, 2017

@hramos

Thanks a lot for this tip. I was unaware of this task tracking commits.

Apologies for my impatience and frustration!

ujwal-setlur replied Jul 14, 2017

@hramos

Thanks a lot for this tip. I was unaware of this task tracking commits.

Apologies for my impatience and frustration!

@ujwal-setlur

This comment has been minimized.

Show comment
Hide comment
@ujwal-setlur

ujwal-setlur Jul 14, 2017

0.46.3 is out with this fixed. Thanks @hramos!

ujwal-setlur replied Jul 14, 2017

0.46.3 is out with this fixed. Thanks @hramos!

@ujwal-setlur

This comment has been minimized.

Show comment
Hide comment
@ujwal-setlur

ujwal-setlur Jul 14, 2017

@janicduplessis, @hramos, @javache

I believe this file ios-configure-glog.sh needs another line:

rm -f test-driver

or

unlink test-driver

This is because the the tar.gz file, when expanded has this link that messes up the android build referenced by #14464, #14417, #14548

These issues occur if an android build is attempted after an iOS build. This link is not required for the iOS build and can be safely removed.

ujwal-setlur replied Jul 14, 2017

@janicduplessis, @hramos, @javache

I believe this file ios-configure-glog.sh needs another line:

rm -f test-driver

or

unlink test-driver

This is because the the tar.gz file, when expanded has this link that messes up the android build referenced by #14464, #14417, #14548

These issues occur if an android build is attempted after an iOS build. This link is not required for the iOS build and can be safely removed.

@ujwal-setlur

This comment has been minimized.

Show comment
Hide comment
@ujwal-setlur

ujwal-setlur Jul 14, 2017

I see that this is already fixed in master. Wish this could have been cherry-picked as well :)

ujwal-setlur replied Jul 14, 2017

I see that this is already fixed in master. Wish this could have been cherry-picked as well :)

@hramos

This comment has been minimized.

Show comment
Hide comment
@hramos

hramos Jul 14, 2017

Contributor

Ah, it's too late for 0.46.3 now. Hopefully we can keep better track of these issues in the 0.47 RC, so we can cherry-pick commits prior to cutting a stable release.

Contributor

hramos replied Jul 14, 2017

Ah, it's too late for 0.46.3 now. Hopefully we can keep better track of these issues in the 0.47 RC, so we can cherry-pick commits prior to cutting a stable release.

@ujwal-setlur

This comment has been minimized.

Show comment
Hide comment
@ujwal-setlur

ujwal-setlur Jul 14, 2017

Yeah, I know :(. I ran into this after I upgraded to 0.46.3. I have created a script to work around this for now. I have updated the other android bugs that this is resolved in master. Hopefully, we don't get breaking changes like this again. I would love to contribute to adding test cases to cover things like this. I really love react-native and definitely want to have the user experience get better with each release :)

ujwal-setlur replied Jul 14, 2017

Yeah, I know :(. I ran into this after I upgraded to 0.46.3. I have created a script to work around this for now. I have updated the other android bugs that this is resolved in master. Hopefully, we don't get breaking changes like this again. I would love to contribute to adding test cases to cover things like this. I really love react-native and definitely want to have the user experience get better with each release :)

@SudoPlz

This comment has been minimized.

Show comment
Hide comment
@SudoPlz

SudoPlz Jul 15, 2017

Contributor

@ujwal-setlur feel free to create a pull request bro, that's very generous of you, and would benefit all of us!

Contributor

SudoPlz replied Jul 15, 2017

@ujwal-setlur feel free to create a pull request bro, that's very generous of you, and would benefit all of us!

@ujwal-setlur

This comment has been minimized.

Show comment
Hide comment
@ujwal-setlur

ujwal-setlur Jul 15, 2017

@SudoPlz, would be happy to, but not sure if I need to? The issue is fixed in master already via 7d1981e. I have updated #14713 requesting to include that commit in case a 0.46.4 is generated. In the meantime, my workaround is very similar to your #14382 (comment). Here is my version for resolving the android build issue:

	curl https://raw.githubusercontent.com/facebook/react-native/7d1981ef8245cd6267823a970054cbebb2d2fd14/scripts/ios-configure-glog.sh > $PWD/node_modules/react-native/scripts/ios-configure-glog.sh
	chmod +x $PWD/node_modules/react-native/scripts/ios-configure-glog.sh
	printf "\nManually upgraded the ios-configure-glog.sh script.\n"

I saved this as a postinstall script in package.json

ujwal-setlur replied Jul 15, 2017

@SudoPlz, would be happy to, but not sure if I need to? The issue is fixed in master already via 7d1981e. I have updated #14713 requesting to include that commit in case a 0.46.4 is generated. In the meantime, my workaround is very similar to your #14382 (comment). Here is my version for resolving the android build issue:

	curl https://raw.githubusercontent.com/facebook/react-native/7d1981ef8245cd6267823a970054cbebb2d2fd14/scripts/ios-configure-glog.sh > $PWD/node_modules/react-native/scripts/ios-configure-glog.sh
	chmod +x $PWD/node_modules/react-native/scripts/ios-configure-glog.sh
	printf "\nManually upgraded the ios-configure-glog.sh script.\n"

I saved this as a postinstall script in package.json

@ujwal-setlur

This comment has been minimized.

Show comment
Hide comment
@ujwal-setlur

ujwal-setlur Jul 15, 2017

And yes, I will look at a generating a PR to help cover a bit more testing :)

ujwal-setlur replied Jul 15, 2017

And yes, I will look at a generating a PR to help cover a bit more testing :)

@mdstroebel

This comment has been minimized.

Show comment
Hide comment
@mdstroebel

mdstroebel Sep 19, 2017

This is fixed in 0.46.4 now.

mdstroebel replied Sep 19, 2017

This is fixed in 0.46.4 now.

Please sign in to comment.