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

Supporting Xcode 10 and the new Xcode build system #19573

Open
hramos opened this Issue Jun 5, 2018 · 18 comments

Comments

@hramos
Copy link
Contributor

hramos commented Jun 5, 2018

For Discussion

This task tracks issues with Xcode 10 as well as the new Xcode build system. This modern build system was originally introduced in Xcode 9, and it is now used by default in Xcode 10.

Troubleshooting

Please take a look at the list of known issues below. If your issue does not match any of these, please try the following:

  • Clean up your project.
  • Remove any build artifacts.
  • Re-build the app.

If that does not work, please do the following to help us keep track of any remaining issues that need to be solved:

  1. File a new issue.
  2. Add a link back to this issue, #19573

A maintainer will then update this post with a reference to your issue as needed.

Known Issues

  • #20492 - 'Multiple commands produce' error when building with new Xcode build system

Fixed Issues

  • #16881 - Xcode signing issues due to Facebook Team ID being used by default in npm release

  • #19569 - Xcode 10 libfishhook.a cannot be found

  • #19774 - glog (config.h missing) and gflags/gflags.h

  • #19781 - wrong iOS simulator is used in Xcode 10

  • #19839 - third-party encounters a semantic issue during Xcode builds to physical iOS device

  • #21137 - Unable to open dependencies file when archiving a project

  • #20774 - When new Xcode build system is used, Xcode build fails to download third-party dependencies (workaround in the issue description)

Opting out of the new Xcode build system

For issues related to the new Xcode build system, you may be able to unblock yourself by switching to the legacy build system.

Using Xcode:

  1. Go to File, then Project Settings or Workspace Settings.
  2. Select Legacy Build System from the Build System dropdown.

screen shot 2018-09-25 at 1 48 03 pm

Using xcodebuild:

You may use the -UseModernBuildSystem=NO flag to opt out of the new Xcode build system.

Mitigating issues in future Xcode updates

Currently, our CI runs tests on the latest stable Xcode release. We could have caught many of these issues by doing two things:

  • Opting into the new build system in CI
  • Using the Xcode 10.0 beta in CI when it was introduced this summer

PRs that add support for either of these are welcome. For the latter, we'd look for Xcode 11 beta support once it's presumably announced next summer.

@amitassaraf

This comment was marked as resolved.

Copy link

amitassaraf commented Jun 8, 2018

I experienced only #19569 which is now solved and another issue with the FBSDK that I solved manually. Besides that seems to be working great 👍

@WesleydeSouza

This comment was marked as resolved.

Copy link

WesleydeSouza commented Jun 17, 2018

@hramos please take a look at #19772 #19774, I've experienced that on a fresh RN project on two different machines on macOS Mojave.

@LeoNatan

This comment has been minimized.

Copy link
Contributor

LeoNatan commented Jul 3, 2018

By "Xcode 10", I hope you mean using the new build system rather than requiring the legacy one.

@hramos

This comment has been minimized.

Copy link
Contributor

hramos commented Jul 3, 2018

@LeoNatan the issue is intentionally ambiguous, and should cover support by the new build system even though it's available in Xcode 9 as well. In general, we want people, come September, to be able to install Xcode 10 and continue working on their projects without being held back by some incompatibility on our side. Ideally, we'd address any issues ASAP as people have already been working on iOS 12 updates using Xcode 10 for a month now.

@hramos hramos added the Core Team label Jul 3, 2018

@LeoNatan

This comment has been minimized.

Copy link
Contributor

LeoNatan commented Jul 3, 2018

While available in Xcode 9, the amount of people that actually enabled it was miniscule. Now it is enabled by default, and is difficult in some cases. It is good that the team is looking into it from early on. 👍

@hramos

This comment has been minimized.

Copy link
Contributor

hramos commented Jul 17, 2018

Is there any other issue we need to take into account before we can close out this issue?

@eliperkins

This comment has been minimized.

Copy link
Contributor

eliperkins commented Jul 17, 2018

I've been using Xcode 10 with these patches applied now for a couple of weeks and haven't encountered any other blockers. Thanks for following up on this, @hramos!

@hramos

This comment has been minimized.

Copy link
Contributor

hramos commented Jul 18, 2018

Added #19839 to the list of pending issues.

@hramos hramos changed the title Prepare for Xcode 10 Prepare for Xcode 10 and the new build system Aug 2, 2018

@hramos hramos changed the title Prepare for Xcode 10 and the new build system [MASTER] Prepare for Xcode 10 and the new build system Aug 2, 2018

@maxbeech

This comment has been minimized.

Copy link

maxbeech commented Sep 9, 2018

With public release days away - any update on when these issues will be resolved please?

@hramos

This comment was marked as resolved.

Copy link
Contributor

hramos commented Sep 11, 2018

@maxbeech do you have a specific issue in mind? This is a master list meant to track remaining issues. It's probably best to comment on the individual one affecting you if it's something you'd like to work on resolving.

@maxbeech

This comment was marked as resolved.

Copy link

maxbeech commented Sep 17, 2018

Thanks @hramos will do

@Amurmurmur

This comment has been minimized.

Copy link

Amurmurmur commented Sep 17, 2018

@hramos Does my issue relate to this discussion?
#21137

@hramos hramos changed the title [MASTER] Prepare for Xcode 10 and the new build system [MASTER] Tracking Xcode 10 and new build system support Sep 17, 2018

@dulmandakh

This comment has been minimized.

Copy link
Collaborator

dulmandakh commented Sep 19, 2018

Today, I created a new project with RN 0.57 and it compiled, run without any issues using XCode 10.

@maxbeech

This comment has been minimized.

Copy link

maxbeech commented Sep 19, 2018

Can confirm it’s working me now now too having cleared out /iOS and /android folders.

@ftier-tech

This comment has been minimized.

Copy link

ftier-tech commented Sep 25, 2018

Hey, try going into your XCode project settings (File->Project Settings) and change the build system to Legacy Build System. This helped me.

@hramos hramos added this to the 0.58 RC milestone Sep 25, 2018

@hramos

This comment has been minimized.

Copy link
Contributor

hramos commented Sep 25, 2018

It would be nice to get to 100% Xcode 10 / new build system support in time for 0.58. For people just arriving here, if you are facing issues in Xcode 10, please take a look at the list of known issues in the original post above. If your issue does not match any of those, please try the following:

  • Clean up your project. Remove the build artifacts, and try re-building the app.

If that does not work, please do the following to help us keep track of any remaining issues that need to be solved:

  1. File a new issue.
  2. Add a link back to this issue, #19573

GitHub will show the list of related issues in this here thread. I'm going to lock this master issue in order to keep the discussion focused on moving support for Xcode 10 forward.

@facebook facebook locked and limited conversation to collaborators Sep 25, 2018

@hramos hramos changed the title [MASTER] Tracking Xcode 10 and new build system support Supporting Xcode 10 and the new Xcode build system Sep 25, 2018

@kelset

This comment has been minimized.

Copy link
Collaborator

kelset commented Oct 9, 2018

Quick update: there is currently a PR in the working that should help with XCode 10 support #21458

@hramos

This comment has been minimized.

Copy link
Contributor

hramos commented Nov 2, 2018

I'm in the process of switching our CI to use Xcode 10 by default. We're currently blocked due to an issue with Circle CI's macOS image. While Xcode 10.0.0 is available, the command line tools for 10.0.0 are not available in the image. This is keeping us from being able to compile applesimutils for use in tests. See https://circleci.com/gh/hramos/react-native/4447 for an example of such a failure:

==> Installing applesimutils from wix/brew ==> Downloading https://raw.githubusercontent.com/wix/homebrew-brew/master/Apple

######################################################################## 100.0%
==> ./buildForBrew.sh /usr/local/Cellar/applesimutils/0.6.0
Last 15 lines from /Users/distiller/Library/Logs/Homebrew/applesimutils/01.buildForBrew.sh:
export LANG=en_US.US-ASCII
clang -x objective-c -arch x86_64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -fobjc-arc -fmodules -gmodules -fmodules-cache-path=/tmp/applesimutils-20181102-18112-6h2nr4/build/ModuleCache.noindex -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild-session-file=/tmp/applesimutils-20181102-18112-6h2nr4/build/ModuleCache.noindex/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -Wno-trigraphs -fpascal-strings -Os -fno-common -Werror -Wno-missing-field-initializers -Wno-missing-prototypes -Werror=return-type -Wdocumentation -Wunreachable-code -Wno-implicit-atomic-properties -Werror=deprecated-objc-isa-usage -Wno-objc-interface-ivars -Werror=objc-root-class -Wno-arc-repeated-use-of-weak -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-float-conversion -Wnon-literal-null-conversion -Wobjc-literal-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wno-deprecated-implementations -DNS_BLOCK_ASSERTIONS=1 -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -isysroot /Applications/Xcode-10.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -fasm-blocks -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -mmacosx-version-min=10.11 -g -fvisibility=hidden -Wno-sign-conversion -Winfinite-recursion -Wcomma -Wblock-capture-autoreleasing -Wstrict-prototypes -Wno-semicolon-before-method-body -iquote /tmp/applesimutils-20181102-18112-6h2nr4/build/Build/Intermediates.noindex/applesimutils.build/Release/applesimutils.build/applesimutils-generated-files.hmap -I/tmp/applesimutils-20181102-18112-6h2nr4/build/Build/Intermediates.noindex/applesimutils.build/Release/applesimutils.build/applesimutils-own-target-headers.hmap -I/tmp/applesimutils-20181102-18112-6h2nr4/build/Build/Intermediates.noindex/applesimutils.build/Release/applesimutils.build/applesimutils-all-target-headers.hmap -iquote /tmp/applesimutils-20181102-18112-6h2nr4/build/Build/Intermediates.noindex/applesimutils.build/Release/applesimutils.build/applesimutils-project-headers.hmap -I/tmp/applesimutils-20181102-18112-6h2nr4/build/Build/Products/Release/include -I/tmp/applesimutils-20181102-18112-6h2nr4/build/Build/Intermediates.noindex/applesimutils.build/Release/applesimutils.build/DerivedSources/x86_64 -I/tmp/applesimutils-20181102-18112-6h2nr4/build/Build/Intermediates.noindex/applesimutils.build/Release/applesimutils.build/DerivedSources -F/tmp/applesimutils-20181102-18112-6h2nr4/build/Build/Products/Release -MMD -MT dependencies -MF /tmp/applesimutils-20181102-18112-6h2nr4/build/Build/Intermediates.noindex/applesimutils.build/Release/applesimutils.build/Objects-normal/x86_64/LNOptionsParser.d --serialize-diagnostics /tmp/applesimutils-20181102-18112-6h2nr4/build/Build/Intermediates.noindex/applesimutils.build/Release/applesimutils.build/Objects-normal/x86_64/LNOptionsParser.dia -c /tmp/applesimutils-20181102-18112-6h2nr4/ObjCCLIInfra/LNOptionsParser.m -o /tmp/applesimutils-20181102-18112-6h2nr4/build/Build/Intermediates.noindex/applesimutils.build/Release/applesimutils.build/Objects-normal/x86_64/LNOptionsParser.o

CompileC /tmp/applesimutils-20181102-18112-6h2nr4/build/Build/Intermediates.noindex/applesimutils.build/Release/applesimutils.build/Objects-normal/x86_64/main.o /tmp/applesimutils-20181102-18112-6h2nr4/applesimutils/applesimutils/main.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target: applesimutils)
cd /tmp/applesimutils-20181102-18112-6h2nr4/applesimutils
export LANG=en_US.US-ASCII
clang -x objective-c -arch x86_64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -fobjc-arc -fmodules -gmodules -fmodules-cache-path=/tmp/applesimutils-20181102-18112-6h2nr4/build/ModuleCache.noindex -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild-session-file=/tmp/applesimutils-20181102-18112-6h2nr4/build/ModuleCache.noindex/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -Wno-trigraphs -fpascal-strings -Os -fno-common -Werror -Wno-missing-field-initializers -Wno-missing-prototypes -Werror=return-type -Wdocumentation -Wunreachable-code -Wno-implicit-atomic-properties -Werror=deprecated-objc-isa-usage -Wno-objc-interface-ivars -Werror=objc-root-class -Wno-arc-repeated-use-of-weak -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-float-conversion -Wnon-literal-null-conversion -Wobjc-literal-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wno-deprecated-implementations -DNS_BLOCK_ASSERTIONS=1 -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -isysroot /Applications/Xcode-10.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -fasm-blocks -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -mmacosx-version-min=10.11 -g -fvisibility=hidden -Wno-sign-conversion -Winfinite-recursion -Wcomma -Wblock-capture-autoreleasing -Wstrict-prototypes -Wno-semicolon-before-method-body -iquote /tmp/applesimutils-20181102-18112-6h2nr4/build/Build/Intermediates.noindex/applesimutils.build/Release/applesimutils.build/applesimutils-generated-files.hmap -I/tmp/applesimutils-20181102-18112-6h2nr4/build/Build/Intermediates.noindex/applesimutils.build/Release/applesimutils.build/applesimutils-own-target-headers.hmap -I/tmp/applesimutils-20181102-18112-6h2nr4/build/Build/Intermediates.noindex/applesimutils.build/Release/applesimutils.build/applesimutils-all-target-headers.hmap -iquote /tmp/applesimutils-20181102-18112-6h2nr4/build/Build/Intermediates.noindex/applesimutils.build/Release/applesimutils.build/applesimutils-project-headers.hmap -I/tmp/applesimutils-20181102-18112-6h2nr4/build/Build/Products/Release/include -I/tmp/applesimutils-20181102-18112-6h2nr4/build/Build/Intermediates.noindex/applesimutils.build/Release/applesimutils.build/DerivedSources/x86_64 -I/tmp/applesimutils-20181102-18112-6h2nr4/build/Build/Intermediates.noindex/applesimutils.build/Release/applesimutils.build/DerivedSources -F/tmp/applesimutils-20181102-18112-6h2nr4/build/Build/Products/Release -MMD -MT dependencies -MF /tmp/applesimutils-20181102-18112-6h2nr4/build/Build/Intermediates.noindex/applesimutils.build/Release/applesimutils.build/Objects-normal/x86_64/main.d --serialize-diagnostics /tmp/applesimutils-20181102-18112-6h2nr4/build/Build/Intermediates.noindex/applesimutils.build/Release/applesimutils.build/Objects-normal/x86_64/main.dia -c /tmp/applesimutils-20181102-18112-6h2nr4/applesimutils/applesimutils/main.m -o /tmp/applesimutils-20181102-18112-6h2nr4/build/Build/Intermediates.noindex/applesimutils.build/Release/applesimutils.build/Objects-normal/x86_64/main.o

** BUILD FAILED **

The following build commands failed:
CompileC /tmp/applesimutils-20181102-18112-6h2nr4/build/Build/Intermediates.noindex/applesimutils.build/Release/applesimutils.build/Objects-normal/x86_64/SetNotificationsPermission.o /tmp/applesimutils-20181102-18112-6h2nr4/applesimutils/applesimutils/SetNotificationsPermission.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
cp: build/Build/Products/Release/applesimutils: No such file or directory

If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
https://github.com/wix/homebrew-brew/issues

Error: A newer Command Line Tools release is available.
Update them from Software Update in the App Store.

Exited with code 1

There's some workarounds in wix/AppleSimulatorUtils#29 that we could attempt, if anyone is interested in getting this working.

@kelset kelset pinned this issue Dec 14, 2018

@hramos hramos added this to In progress in ✅ Testing Infrastructure Dec 14, 2018

@hramos hramos added this to To do in 🛠 Updated Tooling via automation Dec 14, 2018

@hramos hramos removed this from the 0.58 RC milestone Jan 12, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.