swift-lispkit
swift-lispkit copied to clipboard
Build fails: error: redefinition of module
'swift-lispkit': error: invalidManifestFormat("/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/clang/include/module.modulemap:10:8: error: redefinition of module '_Builtin_intrinsics'\nmodule _Builtin_intrinsics [system] [extern_c] {\n ^\n/usr/local/Cellar/llvm/13.0.1_1/lib/clang/13.0.1/include/module.modulemap:10:8: note: previously defined here\nmodule _Builtin_intrinsics [system] [extern_c] {\n ^\n/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/clang/include/module.modulemap:156:8: error: redefinition of module '_Builtin_stddef_max_align_t'\nmodule _Builtin_stddef_max_align_t [system] [extern_c] {\n ^\n/usr/local/Cellar/llvm/13.0.1_1/lib/clang/13.0.1/include/module.modulemap:156:8: note: previously defined here\nmodule _Builtin_stddef_max_align_t [system] [extern_c] {\n ^\n/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/clang/include/module.modulemap:160:8: error: redefinition of module 'opencl_c'\nmodule opencl_c {\n ^\n/usr/local/Cellar/llvm/13.0.1_1/lib/clang/13.0.1/include/module.modulemap:160:8: note: previously defined here\nmodule opencl_c {\n ^\n/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/clang/include/module.modulemap:10:8: error: redefinition of module '_Builtin_intrinsics'\nmodule _Builtin_intrinsics [system] [extern_c] {\n ^\n/usr/local/Cellar/llvm/13.0.1_1/lib/clang/13.0.1/include/module.modulemap:10:8: note: previously defined here\nmodule _Builtin_intrinsics [system] [extern_c] {\n ^\n/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/clang/include/module.modulemap:156:8: error: redefinition of module '_Builtin_stddef_max_align_t'\nmodule _Builtin_stddef_max_align_t [system] [extern_c] {\n ^\n/usr/local/Cellar/llvm/13.0.1_1/lib/clang/13.0.1/include/module.modulemap:156:8: note: previously defined here\nmodule _Builtin_stddef_max_align_t [system] [extern_c] {\n ^\n/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/clang/include/module.modulemap:160:8: error: redefinition of module 'opencl_c'\nmodule opencl_c {\n ^\n/usr/local/Cellar/llvm/13.0.1_1/lib/clang/13.0.1/include/module.modulemap:160:8: note: previously defined here\nmodule opencl_c {\n ^\n
Thanks for the bug report. Unfortunately, I am unable to reproduce it. Can you let me know what Xcode version you use, how you built LispKit, for what platform (iOS/macOS), etc.
BTW, I noticed that there's a reference to Atomics. swift-atomics is a framework (from Apple) that is needed since earlier this year. I needs to be added explicitly to all projects that make use of the LispKit framework.
Here is some hopefully useful information about my specific environment
First the reproducible steps:
git clone https://github.com/objecthub/swift-lispkit
cd swift-lispkit/
make
Specs: XCode Version:
/usr/bin/xcodebuild -version
Xcode 13.4
Build version 13F17a
Swift Version:
xcrun swift -version
swift-driver version: 1.45.2 Apple Swift version 5.6.1 (swiftlang-5.6.0.323.66 clang-1316.0.20.12)
Target: x86_64-apple-macosx12.0
Version of Clang compiler
clang --version
Homebrew clang version 13.0.1
Target: x86_64-apple-darwin21.5.0
Thread model: posix
InstalledDir: /usr/local/opt/llvm/bin
I followed your instructions closely and could not reproduce the issue (see the transcript below). Both on an Intel and an M1-based MacBook Pro I could compile LispKit without problems. One difference I noticed is that you seem to use a clang installation that does not come from Xcode (as it was installed via Homebrew). My guess is that this is what causes the problem.
[Development/Scratch] git clone https://github.com/objecthub/swift-lispkit
Cloning into 'swift-lispkit'...
remote: Enumerating objects: 8377, done.
remote: Counting objects: 100% (1756/1756), done.
remote: Compressing objects: 100% (740/740), done.
remote: Total 8377 (delta 1119), reused 1609 (delta 975), pack-reused 6621
Receiving objects: 100% (8377/8377), 12.59 MiB | 1.17 MiB/s, done.
Resolving deltas: 100% (5772/5772), done.
[Development/Scratch] cd swift-lispkit/
[Scratch/swift-lispkit] make
swift build -Xswiftc "-D" -Xswiftc "SPM"
warning: Usage of /Users/zenger/Library/org.swift.swiftpm/collections.json has been deprecated. Please delete it and use the new /Users/zenger/Library/org.swift.swiftpm/configuration/collections.json instead.
Fetching https://github.com/objecthub/swift-commandlinekit.git from cache
Fetching https://github.com/objecthub/swift-markdownkit.git from cache
Fetching https://github.com/weichsel/ZIPFoundation.git
[4283/4283] Fetching objects
Fetched https://github.com/weichsel/ZIPFoundation.git (8.34s)
Fetched https://github.com/objecthub/swift-commandlinekit.git (8.34s)
Fetching https://github.com/objecthub/swift-sqliteexpress.git from cache
Fetching https://github.com/objecthub/swift-numberkit.git from cache
Fetched https://github.com/objecthub/swift-markdownkit.git (8.37s)
Fetching https://github.com/apple/swift-atomics.git from cache
Fetched https://github.com/objecthub/swift-sqliteexpress.git (0.54s)
Fetched https://github.com/objecthub/swift-numberkit.git (0.55s)
Fetched https://github.com/apple/swift-atomics.git (0.54s)
Computing version for https://github.com/apple/swift-atomics.git
Computed https://github.com/apple/swift-atomics.git at 1.0.2 (0.32s)
Computing version for https://github.com/weichsel/ZIPFoundation.git
Computed https://github.com/weichsel/ZIPFoundation.git at 0.9.14 (0.50s)
Computing version for https://github.com/objecthub/swift-sqliteexpress.git
Computed https://github.com/objecthub/swift-sqliteexpress.git at 1.0.3 (0.51s)
Computing version for https://github.com/objecthub/swift-commandlinekit.git
Computed https://github.com/objecthub/swift-commandlinekit.git at 0.3.4 (0.52s)
Computing version for https://github.com/objecthub/swift-markdownkit.git
Computed https://github.com/objecthub/swift-markdownkit.git at 1.1.5 (0.53s)
Computing version for https://github.com/objecthub/swift-numberkit.git
Computed https://github.com/objecthub/swift-numberkit.git at 2.4.1 (0.52s)
Creating working copy for https://github.com/apple/swift-atomics.git
Working copy of https://github.com/apple/swift-atomics.git resolved at 1.0.2
Creating working copy for https://github.com/objecthub/swift-markdownkit.git
Working copy of https://github.com/objecthub/swift-markdownkit.git resolved at 1.1.5
Creating working copy for https://github.com/objecthub/swift-numberkit.git
Working copy of https://github.com/objecthub/swift-numberkit.git resolved at 2.4.1
Creating working copy for https://github.com/objecthub/swift-commandlinekit.git
Working copy of https://github.com/objecthub/swift-commandlinekit.git resolved at 0.3.4
Creating working copy for https://github.com/objecthub/swift-sqliteexpress.git
Working copy of https://github.com/objecthub/swift-sqliteexpress.git resolved at 1.0.3
Creating working copy for https://github.com/weichsel/ZIPFoundation.git
Working copy of https://github.com/weichsel/ZIPFoundation.git resolved at 0.9.14
Building for debugging...
[220/220] Linking LispKitRepl
Build complete! (28.68s)
.build/debug/LispKitRepl -r Sources/LispKit/Resources -d LispKit
LispKit Shell 2.2.6
Copyright © 2016–2022 Matthias Zenger. All rights reserved.
> (exit)
[Scratch/swift-lispkit] /usr/bin/xcodebuild -version
Xcode 13.4.1
Build version 13F100
[Scratch/swift-lispkit] xcrun swift -version
swift-driver version: 1.45.2 Apple Swift version 5.6.1 (swiftlang-5.6.0.323.66 clang-1316.0.20.12)
Target: arm64-apple-macosx12.0
[Scratch/swift-lispkit] clang --version
Apple clang version 13.1.6 (clang-1316.0.21.2.5)
Target: arm64-apple-darwin21.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
Hi, A few weeks and few system environment changes later I'm no longer able to reproduce the error.
One difference I noticed is that you seem to use a clang installation that does not come from Xcode (as it was installed via Homebrew). My guess is that this is what causes the problem.
On the one hand I agree that this could , since this a common root of such problems on the other hand in this case I'm still using the homebrew clang, and it successfully builds the project...
So for now I'm closing this.