vgorloff / swift-everywhere-toolchain

Automated workflow to compile Swift Toolchain, for making Android apps with Swift.
MIT License
85 stars 25 forks source link

SPM support? #77

Closed johnburkey closed 3 years ago

johnburkey commented 4 years ago

Hey, it looks like you have SPM support pretty close- im able to build our SPM projects with a --destination param and this JSON. But you can't build SwiftNIO because it has a module map to define c functions to call directly from swift. Any idea if anyone knows how to fix that?

{ "version": 1, "sdk": "/Users/johnburkey/Library/Developer/Platforms/Android.platform/Developer/SDKs/Android.sdk", "toolchain-bin-dir": "/Users/johnburkey/Downloads/swift-android-toolchain/usr/bin", "target": "aarch64-unknown-linux-android", "dynamic-library-extension": "so", "extra-cc-flags": [ "-fPIC", ], "extra-swiftc-flags": [ "-use-ld=gold" ], "extra-cpp-flags": ["-lstdc++"] }

johnburkey commented 4 years ago

swift-android-toolchain/usr/bin/android-swift-build -v --android-target aarch64-unknown-linux-android --destination android.json -c release -v

johnburkey commented 4 years ago

Ok, I was able to build SwiftNIO- actually the only issue im running into now is it really doesnt like making SPM debug builds. I have to specify -c release or it dies. (something about a module map flag)

vgorloff commented 3 years ago

Probably the error is "error: unknown argument: '-modulewrap'". I still have to figure out is this issue in build configuration settings (i.e. clang or swiftc) or it is an SPM issue (it passes this flag) to clang.

Full error:

rm -rf "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/Tests/sample-package/build/armv7a"
mkdir -p "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/Tests/sample-package/build/armv7a"
cd "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/Tests/sample-package" && /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/bin/android-swift-build --android-target armv7-none-linux-androideabi -c debug --build-path "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/Tests/sample-package/build/armv7a" -v
SWIFT_EXEC="/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/bin/swiftc-arm-linux-androideabi" swift build -Xswiftc -v -Xswiftc -target -Xswiftc armv7-none-linux-androideabi -Xswiftc -sdk -Xswiftc /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain -c debug --build-path /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/Tests/sample-package/build/armv7a
/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/bin/swiftc -v -Xcc -v -swift-version 5 -target armv7-none-linux-androideabi -tools-directory /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/bin -Xclang-linker --sysroot=/usr/local/ndk/20.1.5948944/platforms/android-24/arch-arm -Xclang-linker --gcc-toolchain=/usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64 -Xcc -I/usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include -Xcc -I/usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/arm-linux-androideabi -L /usr/local/ndk/20.1.5948944/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a -L /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.9.x -L /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/arm-linux-androideabi/24 -L /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/lib/swift/android/armv7 -module-name Lib -incremental -emit-dependencies -emit-module -emit-module-path /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/Tests/sample-package/build/armv7a/armv7-none-linux-android/debug/Lib.swiftmodule -output-file-map /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/Tests/sample-package/build/armv7a/armv7-none-linux-android/debug/Lib.build/output-file-map.json -parse-as-library -c /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/Tests/sample-package/Sources/Lib/HelloMessage.swift -I /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/Tests/sample-package/build/armv7a/armv7-none-linux-android/debug -target armv7-none-linux-android -swift-version 5 -enable-batch-mode -index-store-path /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/Tests/sample-package/build/armv7a/armv7-none-linux-android/debug/index/store -sdk /Volumes/Apps/Developer/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -F /Volumes/Apps/Developer/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -I /Volumes/Apps/Developer/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib -L /Volumes/Apps/Developer/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib -Onone -enable-testing -g -j12 -DSWIFT_PACKAGE -DDEBUG -module-cache-path /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/Tests/sample-package/build/armv7a/armv7-none-linux-android/debug/ModuleCache -parseable-output -color-diagnostics -target armv7-none-linux-androideabi -sdk /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChai/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/bin/swiftc -v -Xcc -v -swift-version 5 -target armv7-none-linux-androideabi -tools-directory /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/bin -Xclang-linker --sysroot=/usr/local/ndk/20.1.5948944/platforms/android-24/arch-arm -Xclang-linker --gcc-toolchain=/usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64 -Xcc -I/usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include -Xcc -I/usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/arm-linux-androideabi -L /usr/local/ndk/20.1.5948944/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a -L /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.9.x -L /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/arm-linux-androideabi/24 -L /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/lib/swift/android/armv7 -module-name Exe -incremental -emit-dependencies -emit-module -emit-module-path /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/Tests/sample-package/build/armv7a/armv7-none-linux-android/debug/Exe.swiftmodule -output-file-map /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/Tests/sample-package/build/armv7a/armv7-none-linux-android/debug/Exe.build/output-file-map.json -c /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/Tests/sample-package/Sources/Exe/main.swift -I /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/Tests/sample-package/build/armv7a/armv7-none-linux-android/debug -target armv7-none-linux-android -swift-version 5 -enable-batch-mode -index-store-path /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/Tests/sample-package/build/armv7a/armv7-none-linux-android/debug/index/store -sdk /Volumes/Apps/Developer/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -F /Volumes/Apps/Developer/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -I /Volumes/Apps/Developer/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib -L /Volumes/Apps/Developer/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib -Onone -enable-testing -g -j12 -DSWIFT_PACKAGE -DDEBUG -module-cache-path /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/Tests/sample-package/build/armv7a/armv7-none-linux-andclang version 10.0.0 (https://github.com/apple/llvm-project.git c39a810ec308dd4a8d93c5011fb73a5c987e8680)
Target: armv7-none-linux-android
Thread model: posix
InstalledDir: 
ignoring nonexistent directory "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/local/include"
ignoring nonexistent directory "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include
 /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/arm-linux-androideabi
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/lib/swift
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/lib/swift/clang/include
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/include
End of search list.
clang -cc1 version 10.0.0 based upon LLVM 10.0.0git default target x86_64-apple-darwin19.6.0
ignoring nonexistent directory "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/local/include"
ignoring nonexistent directory "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include
 /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/arm-linux-androideabi
 /Volumes/Apps/Developer/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks (framework directory)
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/Tests/sample-package/build/armv7a/armv7-none-linux-android/debug
 /Volumes/Apps/Developer/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/lib/swift
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/lib/swift/clang/include
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/include
End of search list.
clang -cc1 version 10.0.0 based upon LLVM 10.0.0git default target x86_64-apple-darwin19.6.0
ignoring nonexistent directory "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/local/include"
ignoring nonexistent directory "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include
 /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/arm-linux-androideabi
 /Volumes/Apps/Developer/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks (framework directory)
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/Tests/sample-package/build/armv7a/armv7-none-linux-android/debug
 /Volumes/Apps/Developer/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/lib/swift
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/lib/swift/clang/include
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/include
End of search list.
clang -cc1 version 10.0.0 based upon LLVM 10.0.0git default target x86_64-apple-darwin19.6.0
ignoring nonexistent directory "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/local/include"
ignoring nonexistent directory "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include
 /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/arm-linux-androideabi
 /Volumes/Apps/Developer/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks (framework directory)
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/Tests/sample-package/build/armv7a/armv7-none-linux-android/debug
 /Volumes/Apps/Developer/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/lib/swift
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/lib/swift/clang/include
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/include
End of search list.
clang -cc1 version 10.0.0 based upon LLVM 10.0.0git default target x86_64-apple-darwin19.6.0
ignoring nonexistent directory "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/local/include"
ignoring nonexistent directory "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include
 /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/arm-linux-androideabi
 /Volumes/Apps/Developer/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks (framework directory)
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/Tests/sample-package/build/armv7a/armv7-none-linux-android/debug
 /Volumes/Apps/Developer/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/lib/swift
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/lib/swift/clang/include
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/include
End of search list.
clang -cc1 version 10.0.0 based upon LLVM 10.0.0git default target x86_64-apple-darwin19.6.0
ignoring nonexistent directory "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/local/include"
ignoring nonexistent directory "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include
 /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/arm-linux-androideabi
 /Volumes/Apps/Developer/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks (framework directory)
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/Tests/sample-package/build/armv7a/armv7-none-linux-android/debug
 /Volumes/Apps/Developer/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/lib/swift
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/lib/swift/clang/include
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/include
End of search list.
clang -cc1 version 10.0.0 based upon LLVM 10.0.0git default target x86_64-apple-darwin19.6.0
ignoring nonexistent directory "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/local/include"
ignoring nonexistent directory "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include
 /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/arm-linux-androideabi
 /Volumes/Apps/Developer/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks (framework directory)
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/Tests/sample-package/build/armv7a/armv7-none-linux-android/debug
 /Volumes/Apps/Developer/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/lib/swift
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/lib/swift/clang/include
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/include
End of search list.
clang -cc1 version 10.0.0 based upon LLVM 10.0.0git default target x86_64-apple-darwin19.6.0
ignoring nonexistent directory "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/local/include"
ignoring nonexistent directory "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include
 /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/arm-linux-androideabi
 /Volumes/Apps/Developer/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks (framework directory)
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/Tests/sample-package/build/armv7a/armv7-none-linux-android/debug
 /Volumes/Apps/Developer/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/lib/swift
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/lib/swift/clang/include
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/include
End of search list.
clang -cc1 version 10.0.0 based upon LLVM 10.0.0git default target x86_64-apple-darwin19.6.0
ignoring nonexistent directory "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/local/include"
ignoring nonexistent directory "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include
 /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/arm-linux-androideabi
 /Volumes/Apps/Developer/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks (framework directory)
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/Tests/sample-package/build/armv7a/armv7-none-linux-android/debug
 /Volumes/Apps/Developer/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/lib/swift
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/lib/swift/clang/include
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/include
End of search list.
clang -cc1 version 10.0.0 based upon LLVM 10.0.0git default target x86_64-apple-darwin19.6.0
ignoring nonexistent directory "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/local/include"
ignoring nonexistent directory "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include
 /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/arm-linux-androideabi
 /Volumes/Apps/Developer/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks (framework directory)
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/Tests/sample-package/build/armv7a/armv7-none-linux-android/debug
 /Volumes/Apps/Developer/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/lib/swift
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/lib/swift/clang/include
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/include
End of search list.
clang version 10.0.0 (https://github.com/apple/llvm-project.git c39a810ec308dd4a8d93c5011fb73a5c987e8680)
Target: armv7-none-linux-android
Thread model: posix
InstalledDir: 
ignoring nonexistent directory "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/local/include"
ignoring nonexistent directory "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include
 /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/arm-linux-androideabi
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/lib/swift
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/lib/swift/clang/include
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/include
End of search list.
clang version 10.0.0 (https://github.com/apple/llvm-project.git c39a810ec308dd4a8d93c5011fb73a5c987e8680)
Target: armv7-none-linux-android
Thread model: posix
InstalledDir: 
ignoring nonexistent directory "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/local/include"
ignoring nonexistent directory "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include
 /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/arm-linux-androideabi
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/lib/swift
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/lib/swift/clang/include
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/include
End of search list.
clang version 10.0.0 (https://github.com/apple/llvm-project.git c39a810ec308dd4a8d93c5011fb73a5c987e8680)
Target: armv7-none-linux-android
Thread model: posix
InstalledDir: 
ignoring nonexistent directory "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/local/include"
ignoring nonexistent directory "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include
 /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/arm-linux-androideabi
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/lib/swift
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/lib/swift/clang/include
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/include
End of search list.
<unknown>:0: error: unknown argument: '-modulewrap'
<unknown>:0: error: unknown argument: '-modulewrap'
[4/8] Wrapping AST for Exe for debugging
Execution of command is failed:
cd "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/Tests/sample-package" && /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/bin/android-swift-build --android-target armv7-none-linux-androideabi -c debug --build-path "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/Tests/sample-package/build/armv7a" -v
Guang1234567 commented 3 years ago

Probably the error is "error: unknown argument: '-modulewrap'". I still have to figure out is this issue in build configuration settings (i.e. clang or swiftc) or it is an SPM issue (it passes this flag) to clang.

Full error:

rm -rf "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/Tests/sample-package/build/armv7a"
mkdir -p "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/Tests/sample-package/build/armv7a"
cd "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/Tests/sample-package" && /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/bin/android-swift-build --android-target armv7-none-linux-androideabi -c debug --build-path "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/Tests/sample-package/build/armv7a" -v
SWIFT_EXEC="/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/bin/swiftc-arm-linux-androideabi" swift build -Xswiftc -v -Xswiftc -target -Xswiftc armv7-none-linux-androideabi -Xswiftc -sdk -Xswiftc /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain -c debug --build-path /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/Tests/sample-package/build/armv7a
/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/bin/swiftc -v -Xcc -v -swift-version 5 -target armv7-none-linux-androideabi -tools-directory /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/bin -Xclang-linker --sysroot=/usr/local/ndk/20.1.5948944/platforms/android-24/arch-arm -Xclang-linker --gcc-toolchain=/usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64 -Xcc -I/usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include -Xcc -I/usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/arm-linux-androideabi -L /usr/local/ndk/20.1.5948944/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a -L /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.9.x -L /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/arm-linux-androideabi/24 -L /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/lib/swift/android/armv7 -module-name Lib -incremental -emit-dependencies -emit-module -emit-module-path /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/Tests/sample-package/build/armv7a/armv7-none-linux-android/debug/Lib.swiftmodule -output-file-map /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/Tests/sample-package/build/armv7a/armv7-none-linux-android/debug/Lib.build/output-file-map.json -parse-as-library -c /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/Tests/sample-package/Sources/Lib/HelloMessage.swift -I /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/Tests/sample-package/build/armv7a/armv7-none-linux-android/debug -target armv7-none-linux-android -swift-version 5 -enable-batch-mode -index-store-path /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/Tests/sample-package/build/armv7a/armv7-none-linux-android/debug/index/store -sdk /Volumes/Apps/Developer/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -F /Volumes/Apps/Developer/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -I /Volumes/Apps/Developer/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib -L /Volumes/Apps/Developer/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib -Onone -enable-testing -g -j12 -DSWIFT_PACKAGE -DDEBUG -module-cache-path /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/Tests/sample-package/build/armv7a/armv7-none-linux-android/debug/ModuleCache -parseable-output -color-diagnostics -target armv7-none-linux-androideabi -sdk /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChai/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/bin/swiftc -v -Xcc -v -swift-version 5 -target armv7-none-linux-androideabi -tools-directory /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/bin -Xclang-linker --sysroot=/usr/local/ndk/20.1.5948944/platforms/android-24/arch-arm -Xclang-linker --gcc-toolchain=/usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64 -Xcc -I/usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include -Xcc -I/usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/arm-linux-androideabi -L /usr/local/ndk/20.1.5948944/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a -L /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.9.x -L /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/arm-linux-androideabi/24 -L /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/lib/swift/android/armv7 -module-name Exe -incremental -emit-dependencies -emit-module -emit-module-path /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/Tests/sample-package/build/armv7a/armv7-none-linux-android/debug/Exe.swiftmodule -output-file-map /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/Tests/sample-package/build/armv7a/armv7-none-linux-android/debug/Exe.build/output-file-map.json -c /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/Tests/sample-package/Sources/Exe/main.swift -I /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/Tests/sample-package/build/armv7a/armv7-none-linux-android/debug -target armv7-none-linux-android -swift-version 5 -enable-batch-mode -index-store-path /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/Tests/sample-package/build/armv7a/armv7-none-linux-android/debug/index/store -sdk /Volumes/Apps/Developer/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -F /Volumes/Apps/Developer/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -I /Volumes/Apps/Developer/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib -L /Volumes/Apps/Developer/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib -Onone -enable-testing -g -j12 -DSWIFT_PACKAGE -DDEBUG -module-cache-path /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/Tests/sample-package/build/armv7a/armv7-none-linux-andclang version 10.0.0 (https://github.com/apple/llvm-project.git c39a810ec308dd4a8d93c5011fb73a5c987e8680)
Target: armv7-none-linux-android
Thread model: posix
InstalledDir: 
ignoring nonexistent directory "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/local/include"
ignoring nonexistent directory "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include
 /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/arm-linux-androideabi
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/lib/swift
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/lib/swift/clang/include
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/include
End of search list.
clang -cc1 version 10.0.0 based upon LLVM 10.0.0git default target x86_64-apple-darwin19.6.0
ignoring nonexistent directory "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/local/include"
ignoring nonexistent directory "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include
 /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/arm-linux-androideabi
 /Volumes/Apps/Developer/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks (framework directory)
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/Tests/sample-package/build/armv7a/armv7-none-linux-android/debug
 /Volumes/Apps/Developer/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/lib/swift
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/lib/swift/clang/include
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/include
End of search list.
clang -cc1 version 10.0.0 based upon LLVM 10.0.0git default target x86_64-apple-darwin19.6.0
ignoring nonexistent directory "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/local/include"
ignoring nonexistent directory "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include
 /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/arm-linux-androideabi
 /Volumes/Apps/Developer/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks (framework directory)
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/Tests/sample-package/build/armv7a/armv7-none-linux-android/debug
 /Volumes/Apps/Developer/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/lib/swift
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/lib/swift/clang/include
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/include
End of search list.
clang -cc1 version 10.0.0 based upon LLVM 10.0.0git default target x86_64-apple-darwin19.6.0
ignoring nonexistent directory "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/local/include"
ignoring nonexistent directory "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include
 /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/arm-linux-androideabi
 /Volumes/Apps/Developer/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks (framework directory)
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/Tests/sample-package/build/armv7a/armv7-none-linux-android/debug
 /Volumes/Apps/Developer/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/lib/swift
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/lib/swift/clang/include
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/include
End of search list.
clang -cc1 version 10.0.0 based upon LLVM 10.0.0git default target x86_64-apple-darwin19.6.0
ignoring nonexistent directory "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/local/include"
ignoring nonexistent directory "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include
 /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/arm-linux-androideabi
 /Volumes/Apps/Developer/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks (framework directory)
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/Tests/sample-package/build/armv7a/armv7-none-linux-android/debug
 /Volumes/Apps/Developer/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/lib/swift
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/lib/swift/clang/include
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/include
End of search list.
clang -cc1 version 10.0.0 based upon LLVM 10.0.0git default target x86_64-apple-darwin19.6.0
ignoring nonexistent directory "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/local/include"
ignoring nonexistent directory "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include
 /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/arm-linux-androideabi
 /Volumes/Apps/Developer/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks (framework directory)
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/Tests/sample-package/build/armv7a/armv7-none-linux-android/debug
 /Volumes/Apps/Developer/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/lib/swift
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/lib/swift/clang/include
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/include
End of search list.
clang -cc1 version 10.0.0 based upon LLVM 10.0.0git default target x86_64-apple-darwin19.6.0
ignoring nonexistent directory "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/local/include"
ignoring nonexistent directory "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include
 /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/arm-linux-androideabi
 /Volumes/Apps/Developer/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks (framework directory)
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/Tests/sample-package/build/armv7a/armv7-none-linux-android/debug
 /Volumes/Apps/Developer/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/lib/swift
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/lib/swift/clang/include
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/include
End of search list.
clang -cc1 version 10.0.0 based upon LLVM 10.0.0git default target x86_64-apple-darwin19.6.0
ignoring nonexistent directory "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/local/include"
ignoring nonexistent directory "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include
 /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/arm-linux-androideabi
 /Volumes/Apps/Developer/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks (framework directory)
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/Tests/sample-package/build/armv7a/armv7-none-linux-android/debug
 /Volumes/Apps/Developer/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/lib/swift
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/lib/swift/clang/include
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/include
End of search list.
clang -cc1 version 10.0.0 based upon LLVM 10.0.0git default target x86_64-apple-darwin19.6.0
ignoring nonexistent directory "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/local/include"
ignoring nonexistent directory "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include
 /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/arm-linux-androideabi
 /Volumes/Apps/Developer/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks (framework directory)
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/Tests/sample-package/build/armv7a/armv7-none-linux-android/debug
 /Volumes/Apps/Developer/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/lib/swift
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/lib/swift/clang/include
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/include
End of search list.
clang -cc1 version 10.0.0 based upon LLVM 10.0.0git default target x86_64-apple-darwin19.6.0
ignoring nonexistent directory "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/local/include"
ignoring nonexistent directory "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include
 /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/arm-linux-androideabi
 /Volumes/Apps/Developer/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks (framework directory)
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/Tests/sample-package/build/armv7a/armv7-none-linux-android/debug
 /Volumes/Apps/Developer/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/lib/swift
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/lib/swift/clang/include
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/include
End of search list.
clang version 10.0.0 (https://github.com/apple/llvm-project.git c39a810ec308dd4a8d93c5011fb73a5c987e8680)
Target: armv7-none-linux-android
Thread model: posix
InstalledDir: 
ignoring nonexistent directory "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/local/include"
ignoring nonexistent directory "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include
 /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/arm-linux-androideabi
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/lib/swift
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/lib/swift/clang/include
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/include
End of search list.
clang version 10.0.0 (https://github.com/apple/llvm-project.git c39a810ec308dd4a8d93c5011fb73a5c987e8680)
Target: armv7-none-linux-android
Thread model: posix
InstalledDir: 
ignoring nonexistent directory "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/local/include"
ignoring nonexistent directory "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include
 /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/arm-linux-androideabi
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/lib/swift
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/lib/swift/clang/include
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/include
End of search list.
clang version 10.0.0 (https://github.com/apple/llvm-project.git c39a810ec308dd4a8d93c5011fb73a5c987e8680)
Target: armv7-none-linux-android
Thread model: posix
InstalledDir: 
ignoring nonexistent directory "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/local/include"
ignoring nonexistent directory "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include
 /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/arm-linux-androideabi
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/lib/swift
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/lib/swift/clang/include
 /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/include
End of search list.
<unknown>:0: error: unknown argument: '-modulewrap'
<unknown>:0: error: unknown argument: '-modulewrap'
[4/8] Wrapping AST for Exe for debugging
Execution of command is failed:
cd "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/Tests/sample-package" && /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/bin/android-swift-build --android-target armv7-none-linux-androideabi -c debug --build-path "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/Tests/sample-package/build/armv7a" -v

I think it is an SPM issue.

My solution:

https://github.com/Guang1234567/swift-everywhere-toolchain/blob/swift-5.2.5-RELEASE/Patches/swiftpm/Sources/Build/BuildPlan.swift.diff

Relative code:

@johnburkey

The toolchain with SPM that compiled by myself:

https://github.com/Guang1234567/swift-android-toolchain_5_2_5_release_ndk_20

vgorloff commented 3 years ago

Ok. The issue with SPM Debug Builds now fixed in https://github.com/vgorloff/swift-everywhere-toolchain/releases/tag/1.0.57. Closing issue.

johnburkey commented 3 years ago

Thanks for this, we've standardized around SPM for our rather massive builds, for all platforms, and this makes it really. The trunk SPM support for Android via linux is still kaput.

Guang1234567 commented 3 years ago

The trunk SPM support for Android via linux is still kaput.

@johnburkey swift-android-linux-toolchain is supported by apple.

Here is the command:

./swift/utils/build-script \
--preset buildbot_linux_crosscompile_android,tools=RA,stdlib=RD,build,aarch64 \
ndk_path=/home/ubuntu/android-ndk-r17 \
arm_dir=/home/ubuntu/libiconv-libicu-android/arm64-v8a \
install_destdir=/home/ubuntu/jenkins/workspace/oss-swift-RA-linux-ubuntu-16.04-android-arm64/swift-nightly-install \
installable_package=/home/ubuntu/jenkins/workspace/oss-swift-RA-linux-ubuntu-16.04-android-arm64/6738-android.tar.gz
johnburkey commented 3 years ago

Great news !

Does that give you a build where you can call "swift build -destination ?” ?

On Nov 16, 2020, at 10:08 PM, GuangGuang notifications@github.com wrote:

The trunk SPM support for Android via linux is still kaput.

@johnburkey https://github.com/johnburkey swift-android-linux-toolchain https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-android-arm64/lastStableBuild/consoleFull is supported by apple.

Here is the command:

./swift/utils/build-script \ --preset buildbot_linux_crosscompile_android,tools=RA,stdlib=RD,build,aarch64 \ ndk_path=/home/ubuntu/android-ndk-r17 \ arm_dir=/home/ubuntu/libiconv-libicu-android/arm64-v8a \ install_destdir=/home/ubuntu/jenkins/workspace/oss-swift-RA-linux-ubuntu-16.04-android-arm64/swift-nightly-install \ installable_package=/home/ubuntu/jenkins/workspace/oss-swift-RA-linux-ubuntu-16.04-android-arm64/6738-android.tar.gz — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/vgorloff/swift-everywhere-toolchain/issues/77#issuecomment-728673542, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC5F3PI2IIMYN4LMG7D4PDDSQHZMJANCNFSM4QALJZKA.

Guang1234567 commented 3 years ago

Does that give you a build where you can call "swift build -destination ?” ?

Some Org like swift-android alreadly provide some Script wrapper for spm to support swift-build --destination= ....

The command preview:

$SWIFT_ANDROID_HOME/toolchain/usr/bin/swift-build --destination=<($SELF_DIR/generate-destination-json.sh) $flags "$@"

More detail:

https://github.com/Guang1234567/swift-android-toolchain_5_3_release_ndk_20/blob/cc2adc16d7e74603f6fdf93bc0a6bf4581e6178e/swift-android-5.3-release/build-tools/1.9.6-swift5/src/bash/swift-build.sh#L92

BTW:

swift-android also provide a gradle plugin named com.readdle.android.swift to integrate swift-build --destination= .... and swift-android-toolchain with Android Studio 4.1 (newest version). More detail look into the example please.

PS: example only test on macOS !!!

Thanks.

johnburkey commented 3 years ago

Sweet thanks 🙏

Moving our builds to AWS , so we will try it there .

John

On Nov 17, 2020, at 8:21 PM, GuangGuang notifications@github.com wrote:

 Does that give you a build where you can call "swift build -destination ?” ?

Some Org like swift-android alreadly provide some Script wrapper for spm to support swift-build --destination= ....

The command preview:

$SWIFT_ANDROID_HOME/toolchain/usr/bin/swift-build --destination=<($SELF_DIR/generate-destination-json.sh) $flags "$@"

More detail:

https://github.com/Guang1234567/swift-android-toolchain_5_3_release_ndk_20/blob/cc2adc16d7e74603f6fdf93bc0a6bf4581e6178e/swift-android-5.3-release/build-tools/1.9.6-swift5/src/bash/swift-build.sh#L92

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

johnburkey commented 3 years ago

Not clear where the artifacts are for the Linux->Android cross compiling stuff is on the CI servers. Where do you guys grab those from?

We have two use cases- local builds using your tools, and AWS hosted build servers.

On Nov 17, 2020, at 8:21 PM, GuangGuang notifications@github.com wrote:

Does that give you a build where you can call "swift build -destination ?” ?

Some Org like swift-android alreadly provide some Script wrapper for spm to support swift-build --destination= ....

The command preview:

$SWIFT_ANDROID_HOME/toolchain/usr/bin/swift-build --destination=<($SELF_DIR/generate-destination-json.sh https://github.com/Guang1234567/swift-android-toolchain_5_3_release_ndk_20/blob/main/swift-android-5.3-release/build-tools/1.9.6-swift5/src/bash/generate-destination-json.sh) $flags "$@"

More detail:

https://github.com/Guang1234567/swift-android-toolchain_5_3_release_ndk_20/blob/cc2adc16d7e74603f6fdf93bc0a6bf4581e6178e/swift-android-5.3-release/build-tools/1.9.6-swift5/src/bash/swift-build.sh#L92 https://github.com/Guang1234567/swift-android-toolchain_5_3_release_ndk_20/blob/cc2adc16d7e74603f6fdf93bc0a6bf4581e6178e/swift-android-5.3-release/build-tools/1.9.6-swift5/src/bash/swift-build.sh#L92 — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/vgorloff/swift-everywhere-toolchain/issues/77#issuecomment-729333406, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC5F3PLMUX4S2IW4JT5FWITSQMVSFANCNFSM4QALJZKA.

johnburkey commented 3 years ago

Going to try these:

https://forums.swift.org/t/swift-for-android-call-for-the-community/32766/33 https://forums.swift.org/t/swift-for-android-call-for-the-community/32766/33

Will also try your latest 5.3!

Thanks guys

On Nov 18, 2020, at 9:13 AM, John Burkey johnburkey@mac.com wrote:

Not clear where the artifacts are for the Linux->Android cross compiling stuff is on the CI servers. Where do you guys grab those from?

We have two use cases- local builds using your tools, and AWS hosted build servers.

  • John

On Nov 17, 2020, at 8:21 PM, GuangGuang <notifications@github.com mailto:notifications@github.com> wrote:

Does that give you a build where you can call "swift build -destination ?” ?

Some Org like swift-android alreadly provide some Script wrapper for spm to support swift-build --destination= ....

The command preview:

$SWIFT_ANDROID_HOME/toolchain/usr/bin/swift-build --destination=<($SELF_DIR/generate-destination-json.sh https://github.com/Guang1234567/swift-android-toolchain_5_3_release_ndk_20/blob/main/swift-android-5.3-release/build-tools/1.9.6-swift5/src/bash/generate-destination-json.sh) $flags "$@"

More detail:

https://github.com/Guang1234567/swift-android-toolchain_5_3_release_ndk_20/blob/cc2adc16d7e74603f6fdf93bc0a6bf4581e6178e/swift-android-5.3-release/build-tools/1.9.6-swift5/src/bash/swift-build.sh#L92 https://github.com/Guang1234567/swift-android-toolchain_5_3_release_ndk_20/blob/cc2adc16d7e74603f6fdf93bc0a6bf4581e6178e/swift-android-5.3-release/build-tools/1.9.6-swift5/src/bash/swift-build.sh#L92 — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/vgorloff/swift-everywhere-toolchain/issues/77#issuecomment-729333406, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC5F3PLMUX4S2IW4JT5FWITSQMVSFANCNFSM4QALJZKA.