Xcode 11 Beta 4

Hello,

I am trying to build from source, following instructions on Couchbase’s github page, and am not able to get past this error that crept on Beta 4 of Xcode (not an issue on Beta 3).

./Scripts/build_framework.sh -s “CBL Swift” -p iOS -o output

The following build commands failed:
Ld ~/Library/Developer/Xcode/DerivedData/CouchbaseLite-aachofjoorbscpenmeugkbmxbibu/Build/Intermediates.noindex/CouchbaseLite.build/Release-iphoneos/CBL\ Swift.build/Objects-normal/arm64/Binary/CouchbaseLiteSwift normal arm64

(1 failure)

Suggestions on getting past this, if you’ve tried Beta 4? I am not getting a build error with Xcode UI itself. Something in build_framework.sh could be triggering it?

There should be a log message above that containing the actual error from the Ld command … ?

CompileC /~/Library/Developer/Xcode/DerivedData/CouchbaseLite-aachofjoorbscpenmeugkbmxbibu/Build/Intermediates.noindex/CouchbaseLite.build/Release-iphoneos/CBL\ Swift.build/Objects-normal/armv7/MYErrorUtils.o /~/SourceControl/CBLite/couchbase-lite-ios/vendor/MYUtilities/MYErrorUtils.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target ‘CBL Swift’ from project ‘CouchbaseLite’)
cd /~/SourceControl/CBLite/couchbase-lite-ios
export LANG=en_US.US-ASCII
/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -target armv7-apple-ios9.0 -fmessage-length=121 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -fcolor-diagnostics -std=gnu99 -fobjc-arc -fmodules -gmodules -fmodules-cache-path=/~/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild-session-file=/~/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -fmodule-name=CouchbaseLiteSwift -Wno-trigraphs -fpascal-strings -Os -flto -fno-common -Werror -Werror=implicit-function-declaration -Wno-missing-field-initializers -Wmissing-prototypes -Werror=return-type -Wdocumentation -Wunreachable-code -Wimplicit-atomic-properties -Werror=deprecated-objc-isa-usage -Wno-objc-interface-ivars -Wobjc-missing-property-synthesis -Werror=objc-root-class -Warc-repeated-use-of-weak -Wno-arc-maybe-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 -Wshadow -Wno-four-char-constants -Wconversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wfloat-conversion -Wnon-literal-null-conversion -Wobjc-literal-conversion -Wsign-compare -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wdeprecated-implementations -DNDEBUG=1 -DCBL_VERSION_STRING=“2.6.0” -DCBL_BUILD_NUMBER=0 -DCBL_PRODUCT_NAME=“CouchbaseLiteSwift” -DNS_BLOCK_ASSERTIONS=1 -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -isysroot /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.0.sdk -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -g -Wno-sign-conversion -Winfinite-recursion -Wno-comma -Wblock-capture-autoreleasing -Wstrict-prototypes -Wno-semicolon-before-method-body -Wunguarded-availability -fembed-bitcode -iquote /~/Library/Developer/Xcode/DerivedData/CouchbaseLite-aachofjoorbscpenmeugkbmxbibu/Build/Intermediates.noindex/CouchbaseLite.build/Release-iphoneos/CBL\ Swift.build/CouchbaseLiteSwift-generated-files.hmap -I/~/Library/Developer/Xcode/DerivedData/CouchbaseLite-aachofjoorbscpenmeugkbmxbibu/Build/Intermediates.noindex/CouchbaseLite.build/Release-iphoneos/CBL\ Swift.build/CouchbaseLiteSwift-own-target-headers.hmap -I/~/Library/Developer/Xcode/DerivedData/CouchbaseLite-aachofjoorbscpenmeugkbmxbibu/Build/Intermediates.noindex/CouchbaseLite.build/Release-iphoneos/CBL\ Swift.build/CouchbaseLiteSwift-all-non-framework-target-headers.hmap -ivfsoverlay /~/Library/Developer/Xcode/DerivedData/CouchbaseLite-aachofjoorbscpenmeugkbmxbibu/Build/Intermediates.noindex/CouchbaseLite.build/Release-iphoneos/CBL\ Swift.build/all-product-headers.yaml -iquote /~/Library/Developer/Xcode/DerivedData/CouchbaseLite-aachofjoorbscpenmeugkbmxbibu/Build/Intermediates.noindex/CouchbaseLite.build/Release-iphoneos/CBL\ Swift.build/CouchbaseLiteSwift-project-headers.hmap -I/~/Library/Developer/Xcode/DerivedData/CouchbaseLite-aachofjoorbscpenmeugkbmxbibu/Build/Products/Release-iphoneos/include -I/~/SourceControl/CBLite/couchbase-lite-ios/vendor/couchbase-lite-core/C/include -I/~/SourceControl/CBLite/couchbase-lite-ios/vendor/couchbase-lite-core/C -I/~/SourceControl/CBLite/couchbase-lite-ios/vendor/couchbase-lite-core/vendor/fleece/API -I/~/SourceControl/CBLite/couchbase-lite-ios/vendor/couchbase-lite-core/vendor/fleece/ObjC -I/~/SourceControl/CBLite/couchbase-lite-ios/vendor/couchbase-lite-core/vendor/fleece/Fleece/Integration -I/~/SourceControl/CBLite/couchbase-lite-ios/vendor/couchbase-lite-core/vendor/fleece/Fleece/Support -I/~/SourceControl/CBLite/couchbase-lite-ios/vendor/couchbase-lite-core/Replicator/Obj-C -I/~/Library/Developer/Xcode/DerivedData/CouchbaseLite-aachofjoorbscpenmeugkbmxbibu/Build/Intermediates.noindex/CouchbaseLite.build/Release-iphoneos/CBL\ Swift.build/DerivedSources-normal/armv7 -I/~/Library/Developer/Xcode/DerivedData/CouchbaseLite-aachofjoorbscpenmeugkbmxbibu/Build/Intermediates.noindex/CouchbaseLite.build/Release-iphoneos/CBL\ Swift.build/DerivedSources/armv7 -I/~/Library/Developer/Xcode/DerivedData/CouchbaseLite-aachofjoorbscpenmeugkbmxbibu/Build/Intermediates.noindex/CouchbaseLite.build/Release-iphoneos/CBL\ Swift.build/DerivedSources -Wall -Wformat-security -Wmissing-declarations -Woverriding-method-mismatch -Wunguarded-availability -Weffc++ -F/~/Library/Developer/Xcode/DerivedData/CouchbaseLite-aachofjoorbscpenmeugkbmxbibu/Build/Products/Release-iphoneos -include /~/Library/Developer/Xcode/DerivedData/CouchbaseLite-aachofjoorbscpenmeugkbmxbibu/Build/Intermediates.noindex/PrecompiledHeaders/SharedPrecompiledHeaders/10504388347954642879/CBLPrefix.h -MMD -MT dependencies -MF /~/Library/Developer/Xcode/DerivedData/CouchbaseLite-aachofjoorbscpenmeugkbmxbibu/Build/Intermediates.noindex/CouchbaseLite.build/Release-iphoneos/CBL\ Swift.build/Objects-normal/armv7/MYErrorUtils.d --serialize-diagnostics /~/Library/Developer/Xcode/DerivedData/CouchbaseLite-aachofjoorbscpenmeugkbmxbibu/Build/Intermediates.noindex/CouchbaseLite.build/Release-iphoneos/CBL\ Swift.build/Objects-normal/armv7/MYErrorUtils.dia -c /~/SourceControl/CBLite/couchbase-lite-ios/vendor/MYUtilities/MYErrorUtils.m -o /~/Library/Developer/Xcode/DerivedData/CouchbaseLite-aachofjoorbscpenmeugkbmxbibu/Build/Intermediates.noindex/CouchbaseLite.build/Release-iphoneos/CBL\ Swift.build/Objects-normal/armv7/MYErrorUtils.o
fatal error: module file
‘/~/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/14VVTP6OGO0OT/Foundation-29B9L6YRR52B.pcm’
not found: module file not found
note: imported by
‘/~/Library/Developer/Xcode/DerivedData/CouchbaseLite-aachofjoorbscpenmeugkbmxbibu/Build/Intermediates.noindex/PrecompiledHeaders/SharedPrecompiledHeaders/10504388347954642879/CBLPrefix.h.gch’
1 error generated.

** BUILD FAILED **

The following commands produced analyzer issues:
AnalyzeShallow /~/SourceControl/CBLite/couchbase-lite-ios/vendor/couchbase-lite-core/C/c4Document.cc normal arm64
(1 command with analyzer issues)

The following build commands failed:
CompileC /~/Library/Developer/Xcode/DerivedData/CouchbaseLite-aachofjoorbscpenmeugkbmxbibu/Build/Intermediates.noindex/CouchbaseLite.build/Release-iphoneos/CBL\ Swift.build/Objects-normal/armv7/MYURLUtils.o /~/SourceControl/CBLite/couchbase-lite-ios/vendor/MYUtilities/MYURLUtils.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
CompileC /~/Library/Developer/Xcode/DerivedData/CouchbaseLite-aachofjoorbscpenmeugkbmxbibu/Build/Intermediates.noindex/CouchbaseLite.build/Release-iphoneos/CBL\ Swift.build/Objects-normal/armv7/MYLogging.o /~/SourceControl/CBLite/couchbase-lite-ios/vendor/MYUtilities/MYLogging.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
CompileC /~/Library/Developer/Xcode/DerivedData/CouchbaseLite-aachofjoorbscpenmeugkbmxbibu/Build/Intermediates.noindex/CouchbaseLite.build/Release-iphoneos/CBL\ Swift.build/Objects-normal/armv7/Test_Assertions.o /~/SourceControl/CBLite/couchbase-lite-ios/vendor/MYUtilities/Test_Assertions.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
CompileC /~/Library/Developer/Xcode/DerivedData/CouchbaseLite-aachofjoorbscpenmeugkbmxbibu/Build/Intermediates.noindex/CouchbaseLite.build/Release-iphoneos/CBL\ Swift.build/Objects-normal/armv7/MYErrorUtils.o /~/SourceControl/CBLite/couchbase-lite-ios/vendor/MYUtilities/MYErrorUtils.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(4 failures)

tl;dr: Please choose the Build/Clean Build Folder menu command and try the build again.

In general, when looking through a log to figure out what went wrong, you should find the first line that says “error” or “fatal error”. Here it’s:

fatal error: module file
‘/~/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/14VVTP6OGO0OT/Foundation-29B9L6YRR52B.pcm’
not found: module file not found
note: imported by
‘/~/Library/Developer/Xcode/DerivedData/CouchbaseLite-aachofjoorbscpenmeugkbmxbibu/Build/Intermediates.noindex/PrecompiledHeaders/SharedPrecompiledHeaders/10504388347954642879/CBLPrefix.h.gch’

The module file is an internal build artifact, and note that it’s being imported by a precompiled header.

This kind of error can occur when you first build with a new version of Xcode. The build system is supposed to delete obsolete internal build files, but sometimes it doesn’t, and then any changes in the file format or naming will mess up the build.

Thanks for your responsiveness on the issues with the new beta. I encountered a similar problem. Unfortunately cleaning the project did not help.


**** BUILD FAILED ****

The following commands produced analyzer issues:

AnalyzeShallow /Users/xxx/Projects/couchbase-lite-ios/vendor/couchbase-lite-core/C/c4Document.cc normal arm64

(1 command with analyzer issues)

The following build commands failed:

Ld /Users/xxx/Library/Developer/Xcode/DerivedData/CouchbaseLite-gybnakomgqwtozdffsxpzsiabljh/Build/Intermediates.noindex/CouchbaseLite.build/Release-iphoneos/CBL\ Swift.build/Objects-normal/arm64/Binary/CouchbaseLiteSwift normal arm64

(1 failure)

Before the AnalyzeShallow part, the following error occurs:

ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I had tried that with the Xcode IDE. Built fine. But it was with the Couchbase script where the errors show up, even after doing Build > Clean Build Folder from the IDE UI on the same project. Maybe I am missing something obvious.

Guys, you have to look at the actual error messages. c4Document.cc has a minor issue (implicit cast) that’s caught by a new analyzer warning.

No offense, but I suggest you use a supported version of Xcode (10) to build Couchbase Lite, if you’re not prepared to deal with glitches like these. We’ll have support for Xcode 11 by the time it ships (September?)

Makes sense, Jens. Thanks for the help.

I was trying to demo live SwiftUI sourced from data on Couchbase Server. But that can wait till September.

Sounds like the Xcode CLI tools might correspond to a different version than the IDE you’re running. Try running xcode-select -p to make sure.