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

Use legacy build system to build framework #940

Merged
merged 1 commit into from
Sep 20, 2018

Conversation

karanjthakkar
Copy link
Contributor

In Xcode 10, the build system defaults to the New Build System launched in Xcode 9. Because of this, the postinstall script fails with the following error (only important parts added. see here for complete log):

<blah blah>

PhaseScriptExecution Run\ Script /Users/karanthakkar/Library/Detox/ios/3b8bf121e33a47a46e6d2ca92c7d743d2d56b3cf/DetoxBuild/Build/Intermediates.noindex/Detox.build/Release-iphoneos/DetoxFramework.build/Script-3941F4F61DC6203000F23DAC.sh (in target: DetoxFramework)

<blah blah>

note: Using new build system

error: Could not delete `/Users/karanthakkar/Work/skyscanner-app/react-native/node_modules/detox/ios_src/COSTouchVisualizer/Classes/build` because it was not created by the build system and it is not a subfolder of derived data.


** CLEAN FAILED **

<blah blah>


** BUILD FAILED **


The following build commands failed:
	PhaseScriptExecution Run\ Script /Users/karanthakkar/Library/Detox/ios/3b8bf121e33a47a46e6d2ca92c7d743d2d56b3cf/DetoxBuild/Build/Intermediates.noindex/Detox.build/Release-iphoneos/DetoxFramework.build/Script-3941F4F61DC6203000F23DAC.sh
(1 failure)

Here's another report in the wild for a similar case: lionheart/openradar-mirror#19856

Fixes #913

PS: While this is something that fixes the issue in the short term, someone who's more proficient with the iOS ecosystem should look into how to fix this properly for the future. 🙂 This is as far as I could go with my very minimal knowledge.

@Monte9
Copy link
Contributor

Monte9 commented Sep 20, 2018

I just ran into this too. I'll use your fork and report back if it works.

Thanks for identifying the issue and submitting a quick fix for it.

@karanjthakkar
Copy link
Contributor Author

@Monte9 thats great! You can use this to test it super quick if you want: github:Skyscanner/detox#5ebce45d4bcb4a27ec52dd4d6e3508013f4f5d87. Since this is a monorepo, you won't be able to use the fork directly very easily. 🙂

@Monte9
Copy link
Contributor

Monte9 commented Sep 20, 2018

@karanjthakkar thank you! I was struggling to install your fork. I used that link in my package.json and was successfully able to yarn install.

Although seeing a lot of errors on Xcode related to React Native due to the new build system in Xcode 10. Found this to be helpful but I am still in debugging mode. Will keep you posted.

@LeoNatan
Copy link
Contributor

Great, I am accepting on faith that you have tested. This is the way to go for now, until we upgrade everything for the new build system.

@LeoNatan LeoNatan merged commit 7f375f1 into wix:master Sep 20, 2018
@karanjthakkar karanjthakkar deleted the fix_xcode10 branch September 21, 2018 06:44
@karanjthakkar
Copy link
Contributor Author

Can confirm that there are other projects who have made similar fixes to support Xcode 10 for the time being.

@noomorph
Copy link
Collaborator

I tried to build all detox projects in the monorepo, and It appeared that pull request missed adding the flag to these places. The build was failing locally. Today I am checking things step-by-step manually on a couple of virtual machines and fixing stuff as I find.

If it goes well, I'll publish a new version as soon as it is possible.

diff --git a/detox/test/package.json b/detox/test/package.json
index dfe4e4af..bea15388 100644
--- a/detox/test/package.json
+++ b/detox/test/package.json
@@ -35,13 +35,13 @@
     "configurations": {
       "ios.sim.debug": {
         "binaryPath": "ios/build/Build/Products/Debug-iphonesimulator/example.app",
-        "build": "set -o pipefail && xcodebuild -project ios/example.xcodeproj -scheme example_ci -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build | xcpretty",
+        "build": "set -o pipefail && xcodebuild -project ios/example.xcodeproj -UseNewBuildSystem=NO -scheme example_ci -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build | xcpretty",
         "type": "ios.simulator",
         "name": "iPhone X"
       },
       "ios.sim.release": {
         "binaryPath": "ios/build/Build/Products/Release-iphonesimulator/example.app",
-        "build": "set -o pipefail && export CODE_SIGNING_REQUIRED=NO && export RCT_NO_LAUNCH_PACKAGER=true && xcodebuild -project ios/example.xcodeproj -scheme example_ci -configuration Release -sdk iphonesimulator -derivedDataPath ios/build | xcpretty",
+        "build": "set -o pipefail && export CODE_SIGNING_REQUIRED=NO && export RCT_NO_LAUNCH_PACKAGER=true && xcodebuild -project ios/example.xcodeproj  -UseNewBuildSystem=NO -scheme example_ci -configuration Release -sdk iphonesimulator -derivedDataPath ios/build | xcpretty",
         "type": "ios.simulator",
         "name": "iPhone X"
       },
diff --git a/examples/demo-native-ios/package.json b/examples/demo-native-ios/package.json
index faf9d5a3..2c16bf49 100644
--- a/examples/demo-native-ios/package.json
+++ b/examples/demo-native-ios/package.json
@@ -11,13 +11,13 @@
 		"configurations": {
 			"ios.sim.release": {
 				"binaryPath": "build/Build/Products/Release-iphonesimulator/NativeExample.app",
-				"build": "xcodebuild -project NativeExample.xcodeproj -scheme NativeExample -configuration Release -sdk iphonesimulator -derivedDataPath build",
+				"build": "xcodebuild -project NativeExample.xcodeproj -UseNewBuildSystem=NO -scheme NativeExample -configuration Release -sdk iphonesimulator -derivedDataPath build",
 				"type": "ios.simulator",
 				"name": "iPhone 7 Plus"
 			},
 			"ios.sim.debug": {
 				"binaryPath": "build/Build/Products/Debug-iphonesimulator/NativeExample.app",
-				"build": "xcodebuild -project NativeExample.xcodeproj -scheme NativeExample -configuration Debug -sdk iphonesimulator -derivedDataPath build",
+				"build": "xcodebuild -project NativeExample.xcodeproj -UseNewBuildSystem=NO -scheme NativeExample -configuration Debug -sdk iphonesimulator -derivedDataPath build",
 				"type": "ios.simulator",
 				"name": "iPhone 7 Plus"
 			}
diff --git a/examples/demo-react-native-jest/package.json b/examples/demo-react-native-jest/package.json
index 9fff0ed9..30cb029a 100644
--- a/examples/demo-react-native-jest/package.json
+++ b/examples/demo-react-native-jest/package.json
@@ -24,13 +24,13 @@
     "configurations": {
       "ios.sim.release": {
         "binaryPath": "ios/build/Build/Products/Release-iphonesimulator/DemoReactNativeJest.app",
-        "build": "export RCT_NO_LAUNCH_PACKAGER=true && xcodebuild -project ios/DemoReactNativeJest.xcodeproj -scheme DemoReactNativeJest -configuration Release -sdk iphonesimulator -derivedDataPath ios/build -quiet",
+        "build": "export RCT_NO_LAUNCH_PACKAGER=true && xcodebuild -project ios/DemoReactNativeJest.xcodeproj -UseNewBuildSystem=NO -scheme DemoReactNativeJest -configuration Release -sdk iphonesimulator -derivedDataPath ios/build -quiet",
         "type": "ios.simulator",
         "name": "iPhone 7 Plus"
       },
       "ios.sim.debug": {
         "binaryPath": "ios/build/Build/Products/Debug-iphonesimulator/DemoReactNativeJest.app",
-        "build": "xcodebuild -project ios/DemoReactNativeJest.xcodeproj -scheme DemoReactNativeJest -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build",
+        "build": "xcodebuild -project ios/DemoReactNativeJest.xcodeproj -UseNewBuildSystem=NO -scheme DemoReactNativeJest -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build",
         "type": "ios.simulator",
         "name": "iPhone 7 Plus"
       },
diff --git a/examples/demo-react-native/package.json b/examples/demo-react-native/package.json
index 6b696677..4cdac6e0 100644
--- a/examples/demo-react-native/package.json
+++ b/examples/demo-react-native/package.json
@@ -20,13 +20,13 @@
     "configurations": {
       "ios.sim.release": {
         "binaryPath": "ios/build/Build/Products/Release-iphonesimulator/example.app",
-        "build": "export RCT_NO_LAUNCH_PACKAGER=true && xcodebuild -project ios/example.xcodeproj -scheme example -configuration Release -sdk iphonesimulator -derivedDataPath ios/build -quiet",
+        "build": "export RCT_NO_LAUNCH_PACKAGER=true && xcodebuild -project ios/example.xcodeproj -UseNewBuildSystem=NO -scheme example -configuration Release -sdk iphonesimulator -derivedDataPath ios/build -quiet",
         "type": "ios.simulator",
         "name": "iPhone 7 Plus"
       },
       "ios.sim.debug": {
         "binaryPath": "ios/build/Build/Products/Debug-iphonesimulator/example.app",
-        "build": "xcodebuild -project ios/example.xcodeproj -scheme example -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build",
+        "build": "xcodebuild -project ios/example.xcodeproj -UseNewBuildSystem=NO -scheme example -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build",
         "type": "ios.simulator",
         "name": "iPhone 7 Plus"
       },

@lock lock bot locked as resolved and limited conversation to collaborators Sep 27, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to install Detox 8.2.3 using Xcode 10 beta 6
5 participants