Now I have several problems with my other tool chia.
Setup
This is the basic setup:
$ git clone https://github.com/JulianKahnert/chia
$ cd chia
Runtime Problem
I have created a build script which uploads the compiled binary (similar to the one from above).
When I download the binary one dynamic lib seems to be missing:
$ ~/Downloads/chia
dyld: Library not loaded: @rpath/lib_InternalSwiftSyntaxParser.dylib
Referenced from: ~/Downloads/chia
Reason: image not found
[1] 95500 abort ~/Downloads/chia
The documentation of swift-syntax gives a hint:
When you do
swift buildSwiftSyntax links and uses the library included in the Swift toolchain. If you are building an application make sure to embed_InternalSwiftSyntaxParseras part of your application's libraries.
But when I have a look at the Makefile of BartyCrouch a tool that also uses SwiftSyntax I can not find any hint of linking _InternalSwiftSyntaxParser manually or am I missing something?
Multiple Architectures Problem
There is another problem during the build process when I choose multiple architectures. I've found this from @0xTim but the problem looks a little different.
Does anyone has a deeper understanding of this problem?
$ swift build --configuration release --arch x86_64 --arch arm64
0%: Compile Swift source files (arm64)
0%: Compile Swift source files (x86_64)
0%: Compile Swift source files (arm64)
0%: Compile Swift source files (x86_64)
0%: Compile Swift source files (x86_64)
0%: Compile Swift source files (arm64)
0%: Compile Swift source files (arm64)
0%: Compile Swift source files (x86_64)
0%: Compile Files.swift (arm64)
0%: Compile Files.swift (x86_64)
15%: Compile Swift source files (arm64)
15%: Compile Swift source files (x86_64)
15%: Compile Swift source files (x86_64)
15%: Compile Swift source files (arm64)
15%: Compile Swift source files (arm64)
15%: Compile Swift source files (x86_64)
~/chia/.build/apple/Intermediates.noindex/GeneratedModuleMaps/macosx/TSCclibc.modulemap:1:8: error: redefinition of module 'TSCclibc'
module TSCclibc {
^
~/chia/.build/checkouts/swift-tools-support-core/Sources/TSCclibc/include/module.modulemap:1:8: note: previously defined here
module TSCclibc {
^
<module-includes>:3:9: error: could not build module 'CSQLite3'
#import "~/chia/.build/checkouts/swift-tools-support-core/Sources/TSCclibc/include/csqlite3.h"
^
~/chia/.build/checkouts/swift-tools-support-core/Sources/TSCBasic/Process.swift:17:29: error: could not build Objective-C module 'TSCclibc'
@_implementationOnly import TSCclibc
^
Build cancelled