realm-swift
realm-swift copied to clipboard
fatal error: module map file [...]realm-swift/build/GeneratedModuleMaps-iphoneos/Bid.modulemap' not found
Expected results
compile using Realm with SPM (no pod or carthage).
Actual Results
Compile fails
Steps & Code to Reproduce
I got ride of using carthage in my iOS project. Now I'm trying to use spm to include Realm instead to simplify the build system. (tried both Realm 10.20.0 and 10.22.0). I'm using Xcode (13.2.1) GUI to do this. xcode-select point to the right version of xcode.
it fails when using xcodebuild command to create a framework for simulator instead of building inside xcode.
the command that is run:
xcrun xcodebuild -project myFramework.xcodeproj -configuration Debug -destination platform=iOS Simulator,name=iPhone 8,OS=15.2
- First, I'm getting 2 warnings (no biggy):
/Users/ericlebel/Abbott/mavericks/isas_encryption/iSAS/DerivedData/iSAS/SourcePackages/checkouts/realm-core/src/external/IntelRDFPMathLib20U2/LIBRARY/src/bid128_string.c:216:17: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32] len = ptr - MiDi; ~ ~~~~^~~~~~ /Users/ericlebel/Abbott/mavericks/isas_encryption/iSAS/DerivedData/iSAS/SourcePackages/checkouts/realm-core/src/external/IntelRDFPMathLib20U2/LIBRARY/src/bid128_string.c:225:13: warning: implicit conversion loses integer precision: 'long' to 'unsigned int' [-Wshorten-64-to-32] k = k + (c_ptr - c_ptr_start); ~ ~~^~~~~~~~~~~~~~~~~~~~~~~
- I'm getting errors:
2 warnings generated.
fatal error: module map file '[...]DerivedData/myFramework/SourcePackages/checkouts/realm-swift/build/GeneratedModuleMaps-iphoneos/Bid.modulemap' not found
fatal error: module map file '[...]DerivedData/myFramework/SourcePackages/checkouts/realm-swift/build/GeneratedModuleMaps-iphoneos/Bid.modulemap' not found
fatal error: module map file '[...]DerivedData/myFramework/SourcePackages/checkouts/realm-swift/build/GeneratedModuleMaps-iphoneos/Bid.modulemap' not found
fatal error: module map file '[...]DerivedData/myFramework/SourcePackages/checkouts/realm-swift/build/GeneratedModuleMaps-iphoneos/Bid.modulemap' not found
fatal error: module map file '[...]DerivedData/myFramework/SourcePackages/checkouts/realm-swift/build/GeneratedModuleMaps-iphoneos/Bid.modulemap' not found
1 error generated.
2 errors generated.
fatal error: module map file '[...]DerivedData/myFramework/SourcePackages/checkouts/realm-swift/build/GeneratedModuleMaps-iphoneos/Bid.modulemap' not found
1 error generated.
fatal error: module map file '[...]DerivedData/myFramework/SourcePackages/checkouts/realm-swift/build/GeneratedModuleMaps-iphoneos/Bid.modulemap' not found
fatal error: module map file '[...]DerivedData/myFramework/SourcePackages/checkouts/realm-swift/build/GeneratedModuleMaps-iphoneos/Bid.modulemap' not found
1 error generated.
fatal error: module map file '[...]DerivedData/myFramework/SourcePackages/checkouts/realm-swift/build/GeneratedModuleMaps-iphoneos/Bid.modulemap' not found
1 error generated.
3 errors generated.
7 errors generated.
fatal error: module map file '[...]DerivedData/myFramework/SourcePackages/checkouts/realm-swift/build/GeneratedModuleMaps-iphoneos/Bid.modulemap' not found
1 error generated.
fatal error: module map file '[...]DerivedData/myFramework/SourcePackages/checkouts/realm-swift/build/GeneratedModuleMaps-iphoneos/Bid.modulemap' not found
1 error generated.
fatal error: module map file '[...]DerivedData/myFramework/SourcePackages/checkouts/realm-swift/build/GeneratedModuleMaps-iphoneos/Bid.modulemap' not found
1 error generated.
11 errors generated.
12 errors generated.
note: Using new build system
note: Planning
note: Build preparation complete
warning: Building targets in manual order is deprecated - check "Parallelize build for command-line builds" in the project editor, or set DISABLE_MANUAL_TARGET_ORDER_BUILD_WARNING in any of the targets in the current build to suppress this warning
warning: None of the architectures in ARCHS (arm64) are valid. Consider setting ARCHS to $(ARCHS_STANDARD) or updating it to include at least one value from VALID_ARCHS (arm64, arm64e, armv7, armv7s) which is not in EXCLUDED_ARCHS (i386, arm64). (in target 'myFramework' from project 'myFramework')
** BUILD FAILED **
Core version
Core version: ? Realm 10.20.0
Intersting tidbits: building inside xcode 13.2.1 on Mac OS running Big Sur for simulator: using spm with Realm 10.22.0, xcode manage to compile each target fine (albeit the 2 warnings above).
When doing the same build using xcodebuild, I get the error above. Bid.modulemap is only found in real-core but not in realm-swift.
I reset packages and cleaned DerivedData while xcode down many times...
Bug with spm ?
I'm seeing the same thing. Will keep looking into this more.
I created https://bugs.swift.org/browse/SR-15840.
I'm seeing the same error as well.
I see the same issue when i am building manually(sh build.sh build
) as well with xcode 13.2.1 (realmswift v10.1.4)
@pitoneux this is easily fixable by declaring the schema when using the xcodebuild
command, so you can use the following command instead
xcrun xcodebuild -project myFramework.xcodeproj -schema yourSchema -configuration Debug -destination platform=iOS Simulator,name=iPhone 8,OS=15.2
.
You can get a list of the projects schemas using xcodebuild -list
.
This issue clearly is an xcodebuild issue which we reported to Apple in the above mentioned radar.
@palaniraja sh build.sh build
. is currently working fine for our latest release (10.40.0) and tested on latest Xcode version (14.3.1).