finagolfin / swift-android-sdk

Android SDKs for Swift
Apache License 2.0
153 stars 15 forks source link

Is this working with M1 computers? #124

Closed fjtrujy closed 8 months ago

fjtrujy commented 1 year ago

Hello, I'm trying to follow your guideline but I'm having some issues. I have tried using nativelly from the MacOS system and I have tried as well from docker using a ubuntu image.

When using the ubuntu docker image it fails during linking phase:

error: link command failed with exit code 255 (use -v to see invocation)
qemu-x86_64: Could not open '/lib64/ld-linux-x86-64.so.2': No such file or directory
error: fatalError

Trying it natively in MacOS:

Building for debugging...
warning: Could not read SDKSettings.json for SDK at: /Users/fjtrujy/Projects/swift-android-sdk/toolchain/NDK/toolchains/llvm/prebuilt/darwin-x86_64/sysroot
error: unableToFind(tool: "swift-autolink-extract")

Not sure if I miss something or it is not possible at all.

Cheers.

finagolfin commented 1 year ago

When using the ubuntu docker image it fails during linking phase

You are using the Ubuntu x86_64 Docker image? That is quite a strange error: try building in verbose mode with -v as it says, and we can get a better idea of where it's going off the rails.

Trying it natively in MacOS

What Swift version is that with? That cross-compilation issue was fixed in 5.8 earlier this year, apple/swift#60023, so you shouldn't be seeing it anymore.

Not sure if I miss something or it is not possible at all

I only test on linux, so it might not have been tried on an M1 Mac. The Android NDK is not available for M1 yet, but this Swift cross-compilation config tries to use the clang compiler and lld linker from there, so you'd need to have Rosetta set up to run those in x86_64 mode also.

If you are willing to try it out, we can probably get it to work, as others do appear to build on macOS, #109.

fjtrujy commented 1 year ago

So giving to you more context. I have been able to make it work using the Ubuntu x86_64 Docker image, by default docker is pulling the same architecture as the computer arm64/v8 in this case.

Regarding NDK in M1 computers, looks to be "ready" https://github.com/android/ndk/issues/1299 just something regarding yaml is missing but I think it doesn't matter for our purpose.

Let me again to retry using natively in MacOS, and I will post it here.

Cheers

fjtrujy commented 1 year ago

This is how I have tried using M1 and MacOS natively.

  1. Download the artifacts of the projects
  2. Download the NDK for MacOS (it just has support to darwin-x86_64, /NDK/toolchains/llvm/prebuilt/darwin-x86_64/)
  3. Link system clang to swift-5.9-android-24-sdk clang:
    ln -sf /usr/bin/clang /Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-5.9-android-24-sdk/usr/lib/swift/clang
  4. Modify specific JSON file (for now just using aarch64):
    {
    "version": 1,
    "target": "aarch64-unknown-linux-android24",
    "toolchain-bin-dir": "/usr/bin",
    "sdk": "/Users/fjtrujy/Projects/swiftCInterop/toolchain/android-ndk-r25c/toolchains/llvm/prebuilt/darwin-x86_64/sysroot",
    "extra-cc-flags": [ "-fPIC", "-I/Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-5.9-android-24-sdk/usr/include" ],
    "extra-swiftc-flags": [
    "-resource-dir", "/Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-5.9-android-24-sdk/usr/lib/swift",
    "-tools-directory", "/Users/fjtrujy/Projects/swiftCInterop/toolchain/NDK/toolchains/llvm/prebuilt/darwin-x86_64/bin",
    "-Xcc", "-I/Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-5.9-android-24-sdk/usr/include",
    "-L/Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-5.9-android-24-sdk/usr/lib/aarch64-linux-android"
    ],
    "extra-cpp-flags": [ "-lstdc++" ]
    }
  5. Compiling the swift package:
    swift build \
    --build-tests \ 
    --destination /Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-5.9-android-24-sdk/usr/swiftpm-android-aarch64.json -Xlinker -rpath -Xlinker /Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-5.9-android-24-sdk/usr/lib/aarch64-linux-android/ 
    --verbose

And this is the output:

➜  swiftCInterop git:(main) ✗ swift build --build-tests --destination /Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-5.9-android-24-sdk/usr/swiftpm-android-aarch64.json -Xlinker -rpath -Xlinker /Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-5.9-android-24-sdk/usr/lib/aarch64-linux-android/ --verbose
Planning build
warning: 'swiftcinterop': /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-frontend -frontend -c -primary-file /Users/fjtrujy/Projects/swiftCInterop/Package.swift -target arm64-apple-macosx13.0 -Xllvm -aarch64-use-tbi -enable-objc-interop -stack-check -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk -I /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib -I /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/pm/ManifestAPI -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -vfsoverlay /var/folders/zx/7w07tq_d26gc0z8fdl4s2zz00000gn/T/TemporaryDirectory.oiBwfR/vfs.yaml -swift-version 5 -package-description-version 5.9.0 -new-driver-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-driver -disable-implicit-concurrency-module-import -disable-implicit-string-processing-module-import -empty-abi-descriptor -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift -module-name main -disable-clang-spi -target-sdk-version 14.0 -target-sdk-name macosx14.0 -external-plugin-path '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/bin/swift-plugin-server' -external-plugin-path '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/local/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/bin/swift-plugin-server' -external-plugin-path '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server' -external-plugin-path '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/local/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server' -plugin-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/plugins -plugin-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/local/lib/swift/host/plugins -o /var/folders/zx/7w07tq_d26gc0z8fdl4s2zz00000gn/T/TemporaryDirectory.0XgsYE/Package-1.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang /var/folders/zx/7w07tq_d26gc0z8fdl4s2zz00000gn/T/TemporaryDirectory.0XgsYE/Package-1.o -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks --sysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk --target=arm64-apple-macosx13.0 -force_load /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/libswiftCompatibilityPacks.a -L /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx -L /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/lib/swift -L /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/pm/ManifestAPI -L /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib -lPackageDescription -Xlinker -rpath -Xlinker /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/pm/ManifestAPI -o /var/folders/zx/7w07tq_d26gc0z8fdl4s2zz00000gn/T/TemporaryDirectory.b2GgWk/swiftcinterop-manifest
Apple Swift version 5.9 (swiftlang-5.9.0.128.108 clang-1500.0.40.1)
Target: arm64-apple-macosx13.0
Building for debugging...
/usr/bin/swiftc -module-name swiftCInterop -incremental -emit-dependencies -emit-module -emit-module-path /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/swiftCInterop.swiftmodule -output-file-map /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/swiftCInterop.build/output-file-map.json -parse-as-library -c /Users/fjtrujy/Projects/swiftCInterop/Sources/swiftCInterop/swiftCInterop.swift -I /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug -target aarch64-unknown-linux-android24 -swift-version 5 -v -enable-batch-mode -index-store-path /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/index/store -Onone -enable-testing -g -j10 -DSWIFT_PACKAGE -DDEBUG -module-cache-path /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/ModuleCache -parseable-output -parse-as-library -color-diagnostics -sdk /Users/fjtrujy/Projects/swiftCInterop/toolchain/android-ndk-r25c/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -resource-dir /Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-5.9-android-24-sdk/usr/lib/swift -tools-directory /Users/fjtrujy/Projects/swiftCInterop/toolchain/NDK/toolchains/llvm/prebuilt/darwin-x86_64/bin -Xcc -I/Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-5.9-android-24-sdk/usr/include -L/Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-5.9-android-24-sdk/usr/lib/aarch64-linux-android -Xcc --sysroot -Xcc /Users/fjtrujy/Projects/swiftCInterop/toolchain/android-ndk-r25c/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -Xcc -fPIC -Xcc -I/Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-5.9-android-24-sdk/usr/include -package-name swiftcinterop
warning: no such SDK: /Users/fjtrujy/Projects/swiftCInterop/toolchain/android-ndk-r25c/toolchains/llvm/prebuilt/darwin-x86_64/sysroot
error: unableToFind(tool: "swift-autolink-extract")

Taking a look at the swift-autolink-extract is not on the /usr/bin I think that swift toolchain for MacOS doesn't contains all the tools that Linux version has.

MacOS:

ls -l /usr/bin/swift*
-rwxr-xr-x  76 root  wheel   167136 Sep  2 09:35 /usr/bin/swift
-rwxr-xr-x   1 root  wheel  1775936 Sep  2 09:35 /usr/bin/swift-inspect
-rwxr-xr-x  76 root  wheel   167136 Sep  2 09:35 /usr/bin/swiftc

Linux:

root@08a3cb28b4d9:/code# ls -l /code/toolchain/swift-5.9-RELEASE-ubuntu22.04/usr/bin/swift*
lrwxr-xr-x 1 root root        14 Sep  9 07:42 /code/toolchain/swift-5.9-RELEASE-ubuntu22.04/usr/bin/swift -> swift-frontend
-rwxr-xr-x 1 root root     11865 Sep  9 06:19 /code/toolchain/swift-5.9-RELEASE-ubuntu22.04/usr/bin/swift-api-checker.py
lrwxr-xr-x 1 root root        14 Sep  9 07:42 /code/toolchain/swift-5.9-RELEASE-ubuntu22.04/usr/bin/swift-api-digester -> swift-frontend
lrwxr-xr-x 1 root root        14 Sep  9 07:42 /code/toolchain/swift-5.9-RELEASE-ubuntu22.04/usr/bin/swift-api-extract -> swift-frontend
lrwxr-xr-x 1 root root        14 Sep  9 07:42 /code/toolchain/swift-5.9-RELEASE-ubuntu22.04/usr/bin/swift-autolink-extract -> swift-frontend
lrwxr-xr-x 1 root root        13 Sep  9 07:58 /code/toolchain/swift-5.9-RELEASE-ubuntu22.04/usr/bin/swift-build -> swift-package
-rwxr-xr-x 1 root root  37815024 Sep  9 08:22 /code/toolchain/swift-5.9-RELEASE-ubuntu22.04/usr/bin/swift-build-sdk-interfaces
-rwxr-xr-x 1 root root   1401648 Sep  9 07:43 /code/toolchain/swift-5.9-RELEASE-ubuntu22.04/usr/bin/swift-build-tool
-rwxr-xr-x 1 root root   1707976 Sep  9 06:36 /code/toolchain/swift-5.9-RELEASE-ubuntu22.04/usr/bin/swift-demangle
-rwxr-xr-x 1 root root  37781144 Sep  9 08:22 /code/toolchain/swift-5.9-RELEASE-ubuntu22.04/usr/bin/swift-driver
lrwxr-xr-x 1 root root        13 Sep  9 07:58 /code/toolchain/swift-5.9-RELEASE-ubuntu22.04/usr/bin/swift-experimental-sdk -> swift-package
-rwxr-xr-x 1 root root 167249272 Sep  9 06:42 /code/toolchain/swift-5.9-RELEASE-ubuntu22.04/usr/bin/swift-frontend
-rwxr-xr-x 1 root root  11257088 Sep  9 08:21 /code/toolchain/swift-5.9-RELEASE-ubuntu22.04/usr/bin/swift-help
-rwxr-xr-x 1 root root 100702656 Sep  9 07:58 /code/toolchain/swift-5.9-RELEASE-ubuntu22.04/usr/bin/swift-package
lrwxr-xr-x 1 root root        13 Sep  9 07:58 /code/toolchain/swift-5.9-RELEASE-ubuntu22.04/usr/bin/swift-package-collection -> swift-package
lrwxr-xr-x 1 root root        13 Sep  9 07:58 /code/toolchain/swift-5.9-RELEASE-ubuntu22.04/usr/bin/swift-package-registry -> swift-package
-rwxr-xr-x 1 root root   1871336 Sep  9 06:37 /code/toolchain/swift-5.9-RELEASE-ubuntu22.04/usr/bin/swift-plugin-server
lrwxr-xr-x 1 root root        13 Sep  9 07:58 /code/toolchain/swift-5.9-RELEASE-ubuntu22.04/usr/bin/swift-run -> swift-package
lrwxr-xr-x 1 root root        14 Sep  9 07:42 /code/toolchain/swift-5.9-RELEASE-ubuntu22.04/usr/bin/swift-symbolgraph-extract -> swift-frontend
lrwxr-xr-x 1 root root        13 Sep  9 07:58 /code/toolchain/swift-5.9-RELEASE-ubuntu22.04/usr/bin/swift-test -> swift-package
lrwxr-xr-x 1 root root        14 Sep  9 07:42 /code/toolchain/swift-5.9-RELEASE-ubuntu22.04/usr/bin/swiftc -> swift-frontend

Here we clearly see the amount of missing tools...

I hope this help

finagolfin commented 1 year ago

Link system clang to swift-5.9-android-24-sdk clang

This is wrong: you're supposed to link the clang resource directory, not the clang executable. See my doc example for what I mean.

Modify specific JSON file

Ah, I see what's going wrong: don't set "toolchain-bin-dir": "/usr/bin", instead specify the actual path, /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin, which should have swift-autolink-extract. You may also need to set the environment variables shown in #109.

-Xlinker -rpath -Xlinker /Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-5.9-android-24-sdk/usr/lib/aarch64-linux-android/

This command-line flag is wrong. This is a runpath, which tells the Android dynamic linker where to look for shared libraries that your test runner depends on in Android, so use the same $ORIGIN-based runpath that's in my doc. This macOS path you're using won't be there at runtime on an Android device or emulator.

fjtrujy commented 1 year ago

Thanks for the update.

This is wrong: you're supposed to link the clang resource directory, not the clang executable. See my doc example for what I mean.

I know, but I think that in the installed toolchain in MacOS natively there is no folder for clang as it happens in Linux.

Ah, I see what's going wrong: don't set "toolchain-bin-dir": "/usr/bin", instead specify the actual path, /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin, which should have swift-autolink-extract. You may also need to set the environment variables shown in https://github.com/finagolfin/swift-android-sdk/issues/109.

I have done that change and I have needed to define also the AR variable (as you recommended), because it is called ar in native toolchain rather than llvm-ar as it happens in Linux.

However the swift-autolink-extract looks still missing:

➜  swiftCInterop git:(main) ✗ ls -l /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
total 1534368
-rwxr-xr-x  1 root  wheel     237584 Oct  6 08:24 air-ar
-rwxr-xr-x  1 root  wheel     237600 Oct  6 08:24 air-arch
-rwxr-xr-x  1 root  wheel     237584 Oct  6 08:24 air-as
-rwxr-xr-x  1 root  wheel     237600 Oct  6 08:24 air-config
-rwxr-xr-x  1 root  wheel     237600 Oct  6 08:24 air-dsymutil
-rwxr-xr-x  1 root  wheel     237600 Oct  6 08:24 air-libtool
-rwxr-xr-x  1 root  wheel     237600 Oct  6 08:24 air-link
-rwxr-xr-x  1 root  wheel     237600 Oct  6 08:24 air-lipo
-rwxr-xr-x  1 root  wheel     237600 Oct  6 08:24 air-lld
-rwxr-xr-x  1 root  wheel     237584 Oct  6 08:24 air-nm
-rwxr-xr-x  1 root  wheel     237584 Oct  6 08:24 air-nt
-rwxr-xr-x  1 root  wheel     237600 Oct  6 08:24 air-objdump
-rwxr-xr-x  1 root  wheel     237600 Oct  6 08:24 air-opt
-rwxr-xr-x  1 root  wheel     237600 Oct  6 08:24 air-pack
lrwxr-xr-x  1 root  wheel          6 Oct 23 08:42 air-ranlib -> air-ar
-rwxr-xr-x  1 root  wheel     237600 Oct  6 08:24 air-readobj
-rwxr-xr-x  1 root  wheel     237600 Oct  6 08:24 air-size
-rwxr-xr-x  1 root  wheel     237600 Oct  6 08:24 air-strip
-rwxr-xr-x  1 root  wheel     237584 Oct  6 08:24 air-tt
-rwxr-xr-x  1 root  wheel     237600 Oct  6 08:24 air-vtool
lrwxr-xr-x  1 root  wheel          6 Oct 23 08:42 amdgpu-nt -> air-nt
-rwxr-xr-x  1 root  wheel     502048 Oct  6 08:24 appintentsmetadataprocessor
-rwxr-xr-x  1 root  wheel     426608 Oct  6 08:24 appintentsnltrainingprocessor
lrwxr-xr-x  1 root  wheel          6 Oct 23 08:42 applegpu-nt -> air-nt
-rwxr-xr-x  1 root  wheel     399440 Oct  6 08:24 appshortcutstringsprocessor
-rwxr-xr-x  1 root  wheel     171760 Oct  6 08:24 ar
-rwxr-xr-x  1 root  wheel     169984 Oct  6 08:24 as
-rwxr-xr-x  1 root  wheel     133856 Oct  6 08:24 asa
-rwxr-xr-x  1 root  wheel     532528 Oct  6 08:24 bison
-rwxr-xr-x  1 root  wheel     476480 Oct  6 08:24 bitcode_strip
lrwxr-xr-x  1 root  wheel          5 Oct 23 08:42 c++ -> clang
lrwxr-xr-x  1 root  wheel         12 Oct 23 08:42 c++filt -> llvm-cxxfilt
-rwxr-xr-x  1 root  wheel     134720 Oct  6 08:24 c89
-rwxr-xr-x  1 root  wheel     134752 Oct  6 08:24 c99
-rwxr-xr-x  1 root  wheel     947760 Oct  6 08:24 cache-build-session
lrwxr-xr-x  1 root  wheel          5 Oct 23 08:42 cc -> clang
-rwxr-xr-x  1 root  wheel  279862832 Oct  6 08:24 clang
lrwxr-xr-x  1 root  wheel          5 Oct 23 08:42 clang++ -> clang
lrwxr-xr-x  1 root  wheel          5 Oct 23 08:42 clang-cache -> clang
-rwxr-xr-x  1 root  wheel     947872 Oct  6 08:24 clang-stat-cache
-rwxr-xr-x  1 root  wheel  113047600 Oct  6 08:24 clangd
-rwxr-xr-x  1 root  wheel     374512 Oct  6 08:24 cmpdylib
-rwxr-xr-x  1 root  wheel     407024 Oct  6 08:24 codesign_allocate
lrwxr-xr-x  1 root  wheel         17 Oct 23 08:42 codesign_allocate-p -> codesign_allocate
lrwxr-xr-x  1 root  wheel         14 Oct 23 08:42 coremlc -> coremlcompiler
-rwxr-xr-x  1 root  wheel   26132464 Oct  6 08:24 coremlcompiler
-rwxr-xr-x  1 root  wheel       3344 Aug 11 19:44 cpp
-rwxr-xr-x  1 root  wheel     168736 Oct  6 08:24 ctags
-rwxr-xr-x  1 root  wheel     459488 Oct  6 08:24 ctf_insert
-rwxr-xr-x  1 root  wheel   21825728 Oct  6 08:24 docc
-rwxr-xr-x  1 root  wheel   87282592 Oct  6 08:24 dsymutil
lrwxr-xr-x  1 root  wheel         14 Oct 23 08:42 dwarfdump -> llvm-dwarfdump
-rwxr-xr-x  2 root  wheel     696720 Oct  6 08:24 flex
-rwxr-xr-x  2 root  wheel     696720 Oct  6 08:24 flex++
lrwxr-xr-x  1 root  wheel          8 Oct 23 08:42 gcov -> llvm-cov
-rwxr-xr-x  2 root  wheel     401088 Oct  6 08:24 gm4
-rwxr-xr-x  1 root  wheel     300704 Oct  6 08:24 gperf
-rwxr-xr-x  1 root  wheel     273456 Oct  6 08:24 iig
-rwxr-xr-x  1 root  wheel     234336 Oct  6 08:24 indent
-rwxr-xr-x  1 root  wheel     459728 Oct  6 08:24 install_name_tool
lrwxr-xr-x  1 root  wheel          6 Oct 23 08:42 intelgpu-nt -> air-nt
-rwxr-xr-x  1 root  wheel    3199408 Oct  6 08:24 ld
-rwxr-xr-x  1 root  wheel    8349104 Oct  6 08:24 ld-classic
-rwxr-xr-x  1 root  wheel        230 Oct  2 02:01 lex
-rwxr-xr-x  1 root  wheel     460208 Oct  6 08:24 libtool
-rwxr-xr-x  1 root  wheel     275520 Oct  6 08:24 lipo
-rwxr-xr-x  1 root  wheel   12755136 Oct  6 08:24 llvm-cov
-rwxr-xr-x  1 root  wheel    1150320 Oct  6 08:24 llvm-cxxfilt
-rwxr-xr-x  1 root  wheel   24455904 Oct  6 08:24 llvm-dwarfdump
-rwxr-xr-x  1 root  wheel   28837712 Oct  6 08:24 llvm-nm
-rwxr-xr-x  1 root  wheel   32162400 Oct  6 08:24 llvm-objdump
-rwxr-xr-x  1 root  wheel     170368 Oct  6 08:24 llvm-otool
-rwxr-xr-x  1 root  wheel   14117168 Oct  6 08:24 llvm-profdata
-rwxr-xr-x  1 root  wheel   10559856 Oct  6 08:24 llvm-size
-rwxr-xr-x  1 root  wheel       3567 Oct  2 02:02 lorder
-rwxr-xr-x  2 root  wheel     401088 Oct  6 08:24 m4
-rwxr-xr-x  1 root  wheel     237584 Oct  6 08:24 metal
lrwxr-xr-x  1 root  wheel          6 Oct 23 08:42 metal-ar -> air-ar
lrwxr-xr-x  1 root  wheel          8 Oct 23 08:42 metal-arch -> air-arch
lrwxr-xr-x  1 root  wheel          6 Oct 23 08:42 metal-as -> air-as
lrwxr-xr-x  1 root  wheel         10 Oct 23 08:42 metal-config -> air-config
lrwxr-xr-x  1 root  wheel         12 Oct 23 08:42 metal-dsymutil -> air-dsymutil
lrwxr-xr-x  1 root  wheel         11 Oct 23 08:42 metal-libtool -> air-libtool
lrwxr-xr-x  1 root  wheel          8 Oct 23 08:42 metal-link -> air-link
lrwxr-xr-x  1 root  wheel          8 Oct 23 08:42 metal-lipo -> air-lipo
lrwxr-xr-x  1 root  wheel          7 Oct 23 08:42 metal-lld -> air-lld
lrwxr-xr-x  1 root  wheel          6 Oct 23 08:42 metal-nm -> air-nm
lrwxr-xr-x  1 root  wheel          6 Oct 23 08:42 metal-nt -> air-nt
lrwxr-xr-x  1 root  wheel         11 Oct 23 08:42 metal-objdump -> air-objdump
lrwxr-xr-x  1 root  wheel          7 Oct 23 08:42 metal-opt -> air-opt
lrwxr-xr-x  1 root  wheel          8 Oct 23 08:42 metal-pack -> air-pack
lrwxr-xr-x  1 root  wheel         10 Oct 23 08:42 metal-ranlib -> air-ranlib
lrwxr-xr-x  1 root  wheel         11 Oct 23 08:42 metal-readobj -> air-readobj
lrwxr-xr-x  1 root  wheel          8 Oct 23 08:42 metal-size -> air-size
-rwxr-xr-x  1 root  wheel     237600 Oct  6 08:24 metal-source
lrwxr-xr-x  1 root  wheel          9 Oct 23 08:42 metal-strip -> air-strip
lrwxr-xr-x  1 root  wheel          6 Oct 23 08:42 metal-tt -> air-tt
lrwxr-xr-x  1 root  wheel          9 Oct 23 08:42 metal-vtool -> air-vtool
lrwxr-xr-x  1 root  wheel          7 Oct 23 08:42 metallib -> air-lld
-rwxr-xr-x  1 root  wheel       7837 Oct  2 02:04 mig
-rwxr-xr-x  1 root  wheel    2155488 Oct  6 08:24 modules-verifier
lrwxr-xr-x  1 root  wheel          7 Oct 23 08:42 nm -> llvm-nm
-rwxr-xr-x  1 root  wheel     408768 Oct  6 08:24 nm-classic
-rwxr-xr-x  1 root  wheel     494464 Oct  6 08:24 nmedit
lrwxr-xr-x  1 root  wheel         12 Oct 23 08:42 objdump -> llvm-objdump
lrwxr-xr-x  1 root  wheel         10 Oct 23 08:42 otool -> llvm-otool
-rwxr-xr-x  1 root  wheel    1461040 Oct  6 08:24 otool-classic
-rwxr-xr-x  1 root  wheel     407792 Oct  6 08:24 pagestuff
lrwxr-xr-x  1 root  wheel          7 Oct 23 08:42 ranlib -> libtool
-rwxr-xr-x  1 root  wheel     267216 Oct  6 08:24 rpcgen
-rwxr-xr-x  1 root  wheel     206416 Oct  6 08:24 segedit
lrwxr-xr-x  1 root  wheel         12 Oct 23 08:42 size -> size-classic
-rwxr-xr-x  1 root  wheel     374080 Oct  6 08:24 size-classic
-rwxr-xr-x  1 root  wheel    1627152 Oct  6 08:24 snippet-extract
-rwxr-xr-x  1 root  wheel   59273184 Oct  6 08:24 sourcekit-lsp
-rwxr-xr-x  1 root  wheel     374752 Oct  6 08:24 strings
-rwxr-xr-x  1 root  wheel     570544 Oct  6 08:24 strip
lrwxr-xr-x  1 root  wheel         14 Oct 23 08:42 swift -> swift-frontend
lrwxr-xr-x  1 root  wheel         14 Oct 23 08:42 swift-api-digester -> swift-frontend
lrwxr-xr-x  1 root  wheel         14 Oct 23 08:42 swift-api-extract -> swift-frontend
lrwxr-xr-x  1 root  wheel         13 Oct 23 08:42 swift-build -> swift-package
-rwxr-xr-x  1 root  wheel    1541664 Oct  6 08:24 swift-build-tool
-rwxr-xr-x  1 root  wheel    1959872 Oct  6 08:24 swift-demangle
-rwxr-xr-x  1 root  wheel   10390864 Oct  6 08:24 swift-driver
lrwxr-xr-x  1 root  wheel         13 Oct 23 08:42 swift-experimental-sdk -> swift-package
-rwxr-xr-x  1 root  wheel  302387648 Oct  6 08:24 swift-frontend
-rwxr-xr-x  1 root  wheel    5682304 Oct  6 08:24 swift-help
-rwxr-xr-x  1 root  wheel   36770400 Oct  6 08:24 swift-package
lrwxr-xr-x  1 root  wheel         13 Oct 23 08:42 swift-package-collection -> swift-package
lrwxr-xr-x  1 root  wheel         13 Oct 23 08:42 swift-package-registry -> swift-package
-rwxr-xr-x  1 root  wheel    1217792 Oct  6 08:24 swift-plugin-server
lrwxr-xr-x  1 root  wheel         13 Oct 23 08:42 swift-run -> swift-package
-rwxr-xr-x  1 root  wheel     225152 Oct  6 08:24 swift-stdlib-tool
lrwxr-xr-x  1 root  wheel         14 Oct 23 08:42 swift-symbolgraph-extract -> swift-frontend
lrwxr-xr-x  1 root  wheel         13 Oct 23 08:42 swift-test -> swift-package
lrwxr-xr-x  1 root  wheel         14 Oct 23 08:42 swiftc -> swift-frontend
-rwxr-xr-x  1 root  wheel   44653312 Oct  6 08:24 tapi
-rwxr-xr-x  1 root  wheel    4439904 Oct  6 08:24 tapi-analyze
-rwxr-xr-x  1 root  wheel     135488 Oct  6 08:24 unifdef
-rwxr-xr-x  1 root  wheel       2946 Oct  2 02:02 unifdefall
-rwxr-xr-x  1 root  wheel     250720 Oct  6 08:24 unwinddump
-rwxr-xr-x  1 root  wheel     241056 Oct  6 08:24 vtool
-rwxr-xr-x  1 root  wheel        135 Oct  2 02:00 yacc

This is the JSON config:

{
  "version": 1,
  "target": "aarch64-unknown-linux-android24",
  "toolchain-bin-dir": "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin",
  "sdk": "/Users/fjtrujy/Projects/swiftCInterop/toolchain/android-ndk-r25c/toolchains/llvm/prebuilt/darwin-x86_64/sysroot",
  "extra-cc-flags": [ "-fPIC", "-I/Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-5.9-android-24-sdk/usr/include" ],
  "extra-swiftc-flags": [
    "-resource-dir", "/Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-5.9-android-24-sdk/usr/lib/swift",
    "-tools-directory", "/Users/fjtrujy/Projects/swiftCInterop/toolchain/NDK/toolchains/llvm/prebuilt/darwin-x86_64/bin",
    "-Xcc", "-I/Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-5.9-android-24-sdk/usr/include",
    "-L/Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-5.9-android-24-sdk/usr/lib/aarch64-linux-android"
  ],
  "extra-cpp-flags": [ "-lstdc++" ]
}

This is the compilation output:

swift build --build-tests --destination /Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-5.9-android-24-sdk/usr/swiftpm-android-aarch64.json -Xlinker -rpath -Xlinker \$ORIGIN/swift-5.9-android-24-sdk/usr/lib/aarch64-linux-android/
warning: 'swiftcinterop': /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-frontend -frontend -c -primary-file /Users/fjtrujy/Projects/swiftCInterop/Package.swift -target arm64-apple-macosx13.0 -Xllvm -aarch64-use-tbi -enable-objc-interop -stack-check -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk -I /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib -I /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/pm/ManifestAPI -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -vfsoverlay /var/folders/zx/7w07tq_d26gc0z8fdl4s2zz00000gn/T/TemporaryDirectory.E8FODD/vfs.yaml -swift-version 5 -package-description-version 5.8.0 -new-driver-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-driver -disable-implicit-concurrency-module-import -disable-implicit-string-processing-module-import -empty-abi-descriptor -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift -module-name main -disable-clang-spi -target-sdk-version 14.0 -target-sdk-name macosx14.0 -external-plugin-path '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/bin/swift-plugin-server' -external-plugin-path '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/local/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/bin/swift-plugin-server' -external-plugin-path '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server' -external-plugin-path '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/local/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server' -plugin-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/plugins -plugin-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/local/lib/swift/host/plugins -o /var/folders/zx/7w07tq_d26gc0z8fdl4s2zz00000gn/T/TemporaryDirectory.sy6kfJ/Package-1.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang /var/folders/zx/7w07tq_d26gc0z8fdl4s2zz00000gn/T/TemporaryDirectory.sy6kfJ/Package-1.o -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks --sysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk --target=arm64-apple-macosx13.0 -force_load /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/libswiftCompatibilityPacks.a -L /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx -L /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/lib/swift -L /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/pm/ManifestAPI -L /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib -lPackageDescription -Xlinker -rpath -Xlinker /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/pm/ManifestAPI -o /var/folders/zx/7w07tq_d26gc0z8fdl4s2zz00000gn/T/TemporaryDirectory.Iqeu67/swiftcinterop-manifest
Apple Swift version 5.9 (swiftlang-5.9.0.128.108 clang-1500.0.40.1)
Target: arm64-apple-macosx13.0
Building for debugging...
warning: no such SDK: /Users/fjtrujy/Projects/swiftCInterop/toolchain/android-ndk-r25c/toolchains/llvm/prebuilt/darwin-x86_64/sysroot
error: unableToFind(tool: "swift-autolink-extract")

Cheers.

fjtrujy commented 1 year ago

Adding some more info here.

At the end swift-autolink-extract looks to be another "alias/link" to swift-frontend, so I have created manually in my system this swift-autolink-extract.

Then the error that I have when compiling:

<unknown>:0: error: compiled module was created by a different version of the compiler ''; rebuild 'Swift' and try again: /Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-5.9-android-24-sdk/usr/lib/swift/android/Swift.swiftmodule/aarch64-unknown-linux-android.swiftmodule
<unknown>:0: error: compiled module was created by a different version of the compiler ''; rebuild 'Swift' and try again: /Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-5.9-android-24-sdk/usr/lib/swift/android/Swift.swiftmodule/aarch64-unknown-linux-android.swiftmodule
error: fatalError

Which I think that most probably is related to what this user is suffering here.

So now, looks like we just must assure that generated artefacts match with the installed toolchain.

I know that this is a different topic, how you're heavily relaying to the GHA for generating the artefacts and also checking that everything is working as expected, why don't try to generate the artefacts on the CI using macos-latest as well (IIRC you said that you just use linux)?

I see that you already are using macos-latest to run unit tests within the Android emulator, but we can't assure that at least we are able to compile a swift package using MacOS.

Additionally GHA recently released as well the usage of their M1 computers, you can find more info here: https://github.blog/2023-10-02-introducing-the-new-apple-silicon-powered-m1-macos-larger-runner-for-github-actions/

So now we could check first if it works for macOS intel and later on for macOS M1 computers.

Cheers

finagolfin commented 1 year ago

So now, looks like we just must assure that generated artefacts match with the installed toolchain.

What happens if you use the latest 5.9.1 SDK for AArch64 available on the CI as sdk-tests-release-aarch64?

fjtrujy commented 1 year ago

So now, looks like we just must assure that generated artefacts match with the installed toolchain.

What happens if you use the latest 5.9.1 SDK for AArch64 available on the CI as sdk-tests-release-aarch64?

Doesn't it need to fit with the same toolchain installed in the machine? Latest one is going to be more modern that the one installed.

finagolfin commented 1 year ago

Doesn't it need to fit with the same toolchain installed in the machine? Latest one is going to be more modern that the one installed.

Oh, I thought that you were using the Swift 5.9.1 compiler on macOS and that was complaining about the older Swift 5.9 SDK, forgot that 5.9.1 was not for macOS. That is too bad that even an SDK built from Swift 5.9 on linux doesn't work with the official Swift 5.9 compiler on macOS, as that used to work before.

why don't try to generate the artefacts on the CI using macos-latest as well (IIRC you said that you just use linux)?

I have no interest in getting that working on macOS, I haven't used macOS in almost 15 years. If people like @johnburkey or you reported that you got it working, I was simply going to add the steps you used to my doc and call it a day.

You said that it worked for you in the linux Docker, any reason you're also trying to build on macOS? Given that is a Swift compiler with proprietary additions and an OS I don't use, I'm not interested in investigating why it's not working.

If you want to try the Homebrew Swift toolchain when they get that updated to 5.9, Homebrew/homebrew-core#143762, I suspect that would work.

fjtrujy commented 1 year ago

You said that it worked for you in the linux Docker, any reason you're also trying to build on macOS? Given that is a Swift compiler with proprietary additions and an OS I don't use, I'm not interested in investigating why it's not working.

Yeah I made "somehow" to work, using docker with a ubuntu amd64 image, however docker is not stable when using amd64 images in a M1 computer, and it crashes a lot, producing qemu: uncaught target signal 4 (Illegal instruction) - core dumped errors. More info here

So currently having a M1 computer is almost impossible to make Swift code to compile for Android.

  1. Natively. These are the current issues we are suffering.
  2. Using ARM64 docker image. Not working because there is no NDK for Linux arm64 architecture
  3. Using AMD64 docker image. Somehow working but it crashes randomly (almost every time if you use something more complex than a dummy Swift package).

If you want to try the Homebrew Swift toolchain when they get that updated to 5.9, https://github.com/Homebrew/homebrew-core/pull/143762, I suspect that would work.

I will try it...

fjtrujy commented 1 year ago

I have tried using latest Xcode version 15.0.1 which comes with:

swift-driver version: 1.87.1 Apple Swift version 5.9 (swiftlang-5.9.0.128.108 clang-1500.0.40.1)
Target: arm64-apple-macosx13.0

And also using the artefacts from releases that belong to Release 5.9.0 and I still suffering the same error:

error: emit-module command failed with exit code 1 (use -v to see invocation)
<unknown>:0: error: compiled module was created by a different version of the compiler ''; rebuild 'Swift' and try again: /Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-5.9-android-24-sdk/usr/lib/swift/android/Swift.swiftmodule/aarch64-unknown-linux-android.swiftmodule
<unknown>:0: error: compiled module was created by a different version of the compiler ''; rebuild 'Swift' and try again: /Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-5.9-android-24-sdk/usr/lib/swift/android/Swift.swiftmodule/aarch64-unknown-linux-android.swiftmodule
error: fatalError

I will try to create a dummy project to see if you can find something wrong

finagolfin commented 1 year ago

Do you set the TOOLCHAINS environment variable also, as shown in #109? I think that may be required on macOS.

fjtrujy commented 1 year ago

Do you set the TOOLCHAINS environment variable also, as shown in #109? I think that may be required on macOS.

Yes I did it.

This is the summary: The project that I'm using it is called swiftCInterop (in the path /Users/fjtrujy/Projects/swiftCInterop/), it is a Swift package with a single file called swiftCInterop.swift and content:

@_cdecl("swiftC_add")
func swiftC_add(_ a1: Int, _ a2: Int) -> Int {
    print("Executing \(#function)")
    return a1 + a2
}

All the needed files for compiling Swift for Android are within the swiftCInterop in the toolchain subfolder:

➜  swiftCInterop git:(main) ✗ pwd
/Users/fjtrujy/Projects/swiftCInterop
➜  swiftCInterop git:(main) ✗ ls -la toolchain
total 24
drwxr-xr-x   8 fjtrujy  staff   256 Oct 20 08:28 .
drwxr-xr-x  12 fjtrujy  staff   384 Oct 25 08:44 ..
drwxr-xr-x@ 21 fjtrujy  staff   672 Jan 24  2023 NDK
drwx------@  4 fjtrujy  staff   128 Oct 20 09:01 swift-5.9-android-24-sdk

The NDK version is the one available for Darwin https://dl.google.com/android/repository/android-ndk-r25c-darwin.dmg which only have /toolchains/llvm/prebuilt/darwin-x86_64 inside.

The installed toolchain is coming from the Xcode 15.0.1 which currently it is on the path /Applications/Xcode_15.01.app.

This is the JSON config file for aarch64

{
  "version": 1,
  "target": "aarch64-unknown-linux-android24",
  "toolchain-bin-dir": "/Applications/Xcode_15.01.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin",
  "sdk": "/Users/fjtrujy/Projects/swiftCInterop/toolchain/NDK/toolchains/llvm/prebuilt/darwin-x86_64/sysroot",
  "extra-cc-flags": [ "-fPIC", "-I/Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-5.9-android-24-sdk/usr/include" ],
  "extra-swiftc-flags": [
    "-resource-dir", "/Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-5.9-android-24-sdk/usr/lib/swift",
    "-tools-directory", "/Users/fjtrujy/Projects/swiftCInterop/toolchain/NDK/toolchains/llvm/prebuilt/darwin-x86_64/bin",
    "-Xcc", "-I/Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-5.9-android-24-sdk/usr/include",
    "-L/Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-5.9-android-24-sdk/usr/lib/aarch64-linux-android"
  ],
  "extra-cpp-flags": [ "-lstdc++" ]
}

Installed swift version locally

➜  swiftCInterop git:(main) ✗ /Applications/Xcode_15.01.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift --version
swift-driver version: 1.87.1 Apple Swift version 5.9 (swiftlang-5.9.0.128.108 clang-1500.0.40.1)
Target: arm64-apple-macosx13.0

Link clang (just to highlight that local installed clang version is 15)

ln -sf /Applications/Xcode_15.01.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang /Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-5.9-android-24-sdk/usr/lib/swift/clang

Export AR and TOOLCHAINS

export AR=/Applications/Xcode_15.01.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar
export TOOLCHAINS=org.swift.5.9.0.128.108

Additionally I have created a hyperlink for the missing swift-autolink-extract: /Applications/Xcode_15.01.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-autolink-extract to /Applications/Xcode_15.01.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-frontend

Finally here you have the current execution:

➜  swiftCInterop git:(main) ✗ /Applications/Xcode_15.01.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift build --build-tests --destination /Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-5.9-android-24-sdk/usr/swiftpm-android-aarch64.json -Xlinker -rpath -Xlinker \$ORIGIN/swift-5.9-android-24-sdk/usr/lib/aarch64-linux-android --verbose
warning: 'swiftcinterop': /Applications/Xcode_15.01.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-frontend -frontend -c -primary-file /Users/fjtrujy/Projects/swiftCInterop/Package.swift -target arm64-apple-macosx13.0 -Xllvm -aarch64-use-tbi -enable-objc-interop -stack-check -sdk /Applications/Xcode_15.01.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk -I /Applications/Xcode_15.01.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib -I /Applications/Xcode_15.01.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/pm/ManifestAPI -F /Applications/Xcode_15.01.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -vfsoverlay /var/folders/zx/7w07tq_d26gc0z8fdl4s2zz00000gn/T/TemporaryDirectory.j1DE8O/vfs.yaml -swift-version 5 -package-description-version 5.8.0 -new-driver-path /Applications/Xcode_15.01.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-driver -disable-implicit-concurrency-module-import -disable-implicit-string-processing-module-import -empty-abi-descriptor -resource-dir /Applications/Xcode_15.01.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift -module-name main -disable-clang-spi -target-sdk-version 14.0 -target-sdk-name macosx14.0 -external-plugin-path '/Applications/Xcode_15.01.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/lib/swift/host/plugins#/Applications/Xcode_15.01.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/bin/swift-plugin-server' -external-plugin-path '/Applications/Xcode_15.01.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/local/lib/swift/host/plugins#/Applications/Xcode_15.01.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/bin/swift-plugin-server' -external-plugin-path '/Applications/Xcode_15.01.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib/swift/host/plugins#/Applications/Xcode_15.01.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server' -external-plugin-path '/Applications/Xcode_15.01.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/local/lib/swift/host/plugins#/Applications/Xcode_15.01.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server' -plugin-path /Applications/Xcode_15.01.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/plugins -plugin-path /Applications/Xcode_15.01.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/local/lib/swift/host/plugins -o /var/folders/zx/7w07tq_d26gc0z8fdl4s2zz00000gn/T/TemporaryDirectory.2AZvVV/Package-1.o
/Applications/Xcode_15.01.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang /var/folders/zx/7w07tq_d26gc0z8fdl4s2zz00000gn/T/TemporaryDirectory.2AZvVV/Package-1.o -F /Applications/Xcode_15.01.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks --sysroot /Applications/Xcode_15.01.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk --target=arm64-apple-macosx13.0 -force_load /Applications/Xcode_15.01.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/libswiftCompatibilityPacks.a -L /Applications/Xcode_15.01.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx -L /Applications/Xcode_15.01.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/lib/swift -L /Applications/Xcode_15.01.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/pm/ManifestAPI -L /Applications/Xcode_15.01.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib -lPackageDescription -Xlinker -rpath -Xlinker /Applications/Xcode_15.01.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/pm/ManifestAPI -o /var/folders/zx/7w07tq_d26gc0z8fdl4s2zz00000gn/T/TemporaryDirectory.rfSUKp/swiftcinterop-manifest
Apple Swift version 5.9 (swiftlang-5.9.0.128.108 clang-1500.0.40.1)
Target: arm64-apple-macosx13.0
Building for debugging...
/Applications/Xcode_15.01.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc -module-name swiftCInterop -incremental -emit-dependencies -emit-module -emit-module-path /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/swiftCInterop.swiftmodule -output-file-map /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/swiftCInterop.build/output-file-map.json -parse-as-library -c /Users/fjtrujy/Projects/swiftCInterop/Sources/swiftCInterop/swiftCInterop.swift -I /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug -target aarch64-unknown-linux-android24 -swift-version 5 -v -enable-batch-mode -index-store-path /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/index/store -Onone -enable-testing -g -j10 -DSWIFT_PACKAGE -DDEBUG -module-cache-path /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/ModuleCache -parseable-output -parse-as-library -color-diagnostics -sdk /Users/fjtrujy/Projects/swiftCInterop/toolchain/NDK/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -resource-dir /Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-5.9-android-24-sdk/usr/lib/swift -tools-directory /Users/fjtrujy/Projects/swiftCInterop/toolchain/NDK/toolchains/llvm/prebuilt/darwin-x86_64/bin -Xcc -I/Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-5.9-android-24-sdk/usr/include -L/Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-5.9-android-24-sdk/usr/lib/aarch64-linux-android -Xcc --sysroot -Xcc /Users/fjtrujy/Projects/swiftCInterop/toolchain/NDK/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -Xcc -fPIC -Xcc -I/Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-5.9-android-24-sdk/usr/include
warning: Could not read SDKSettings.json for SDK at: /Users/fjtrujy/Projects/swiftCInterop/toolchain/NDK/toolchains/llvm/prebuilt/darwin-x86_64/sysroot
Apple Swift version 5.9 (swiftlang-5.9.0.128.108 clang-1500.0.40.1)
Target: aarch64-unknown-linux-android24
/Applications/Xcode_15.01.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-frontend -frontend -emit-module -experimental-skip-non-inlinable-function-bodies-without-types /Users/fjtrujy/Projects/swiftCInterop/Sources/swiftCInterop/swiftCInterop.swift -target aarch64-unknown-linux-android24 -Xllvm -aarch64-use-tbi -disable-objc-interop -sdk /Users/fjtrujy/Projects/swiftCInterop/toolchain/NDK/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -I /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug -color-diagnostics -enable-testing -g -module-cache-path /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/ModuleCache -swift-version 5 -Onone -D SWIFT_PACKAGE -D DEBUG -new-driver-path /Applications/Xcode_15.01.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-driver -empty-abi-descriptor -resource-dir /Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-5.9-android-24-sdk/usr/lib/swift -enable-anonymous-context-mangled-names -Xcc -I/Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-5.9-android-24-sdk/usr/include -Xcc --sysroot -Xcc /Users/fjtrujy/Projects/swiftCInterop/toolchain/NDK/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -Xcc -fPIC -Xcc -I/Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-5.9-android-24-sdk/usr/include -module-name swiftCInterop -disable-clang-spi -plugin-path /Applications/Xcode_15.01.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/plugins -plugin-path /Applications/Xcode_15.01.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/local/lib/swift/host/plugins -emit-module-doc-path /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/swiftCInterop.swiftdoc -emit-module-source-info-path /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/swiftCInterop.swiftsourceinfo -emit-dependencies-path /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/swiftCInterop.build/swiftCInterop.emit-module.d -parse-as-library -o /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/swiftCInterop.swiftmodule
/Applications/Xcode_15.01.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-frontend -frontend -c -primary-file /Users/fjtrujy/Projects/swiftCInterop/Sources/swiftCInterop/swiftCInterop.swift -emit-dependencies-path /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/swiftCInterop.build/swiftCInterop.d -emit-reference-dependencies-path /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/swiftCInterop.build/swiftCInterop.swiftdeps -target aarch64-unknown-linux-android24 -Xllvm -aarch64-use-tbi -disable-objc-interop -sdk /Users/fjtrujy/Projects/swiftCInterop/toolchain/NDK/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -I /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug -color-diagnostics -enable-testing -g -module-cache-path /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/ModuleCache -swift-version 5 -Onone -D SWIFT_PACKAGE -D DEBUG -new-driver-path /Applications/Xcode_15.01.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-driver -empty-abi-descriptor -resource-dir /Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-5.9-android-24-sdk/usr/lib/swift -enable-anonymous-context-mangled-names -Xcc -I/Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-5.9-android-24-sdk/usr/include -Xcc --sysroot -Xcc /Users/fjtrujy/Projects/swiftCInterop/toolchain/NDK/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -Xcc -fPIC -Xcc -I/Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-5.9-android-24-sdk/usr/include -module-name swiftCInterop -disable-clang-spi -plugin-path /Applications/Xcode_15.01.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/plugins -plugin-path /Applications/Xcode_15.01.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/local/lib/swift/host/plugins -parse-as-library -o /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/swiftCInterop.build/swiftCInterop.swift.o -index-store-path /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/index/store -index-system-modules
error: emit-module command failed with exit code 1 (use -v to see invocation)
<unknown>:0: error: compiled module was created by a different version of the compiler ''; rebuild 'Swift' and try again: /Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-5.9-android-24-sdk/usr/lib/swift/android/Swift.swiftmodule/aarch64-unknown-linux-android.swiftmodule
<unknown>:0: error: compiled module was created by a different version of the compiler ''; rebuild 'Swift' and try again: /Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-5.9-android-24-sdk/usr/lib/swift/android/Swift.swiftmodule/aarch64-unknown-linux-android.swiftmodule
error: fatalError

Anyway are you sure that TOOLCHAINS var need to be defined? from where have you gotten that requirement (besides this https://github.com/finagolfin/swift-android-sdk/issues/109)?

I hope this help.

fjtrujy commented 1 year ago

Adding some more extra info about swift-compiler-version. Not sure if this is the reason, but maybe....

As you can see they are EXACTLY THE SAME, however the version that I have installed natively in the computer...

If you see even if they use the same 5.9 version, they aren't exactly the same (string comparing).

This info I have extracted from the swiftModule folder in the files called *.swiftInterface, for instance swift-5.9-RELEASE-ubuntu22.04/usr/lib/swift/linux/Swift.swiftmodule/x86_64-unknown-linux-gnu.swiftinterface

Not sure if this is the root of the issue, but I'm pretty sure that this is related, what do you think?

Cheers

finagolfin commented 1 year ago

Since Homebrew is still on 5.8.1, can you try it with the sdk-tests-release-aarch64 Swift 5.8.1 SDK built by the CI and see if that works? That will give us more info.

finagolfin commented 1 year ago

Ping @fjtrujy, any luck?

fjtrujy commented 1 year ago

I didn’t try it yet, I’ll let you know as soon as I try it

fjtrujy commented 1 year ago

Hello again. Let me post my last try using Swift 5.8.1 installed from brew.

/opt/homebrew/Cellar/swift/5.8.1_1/Swift-5.8.xctoolchain/usr/bin/swift --version                                                                                                                                                                                                                                       
Swift version 5.8.1 (swift-5.8.1-RELEASE)
Target: arm64-apple-macosx13.0

First of all, I would like to indicate that I'm following the same folder and project structure as I commented in my last reply, and still using an M1 computer (I will try later with an Intel MacOS).

I have downloaded the file you indicated here:

Since Homebrew is still on 5.8.1, can you try it with the sdk-tests-release-aarch64 Swift 5.8.1 SDK built by the CI and see if that works? That will give us more info.

This is the JSON config file for aarch64

{
  "version": 1,
  "target": "aarch64-unknown-linux-android24",
  "toolchain-bin-dir": "/opt/homebrew/Cellar/swift/5.8.1_1/Swift-5.8.xctoolchain/usr/bin",
  "sdk": "/Users/fjtrujy/Projects/swiftCInterop/toolchain/NDK/toolchains/llvm/prebuilt/darwin-x86_64/sysroot",
  "extra-cc-flags": [ "-fPIC", "-I/Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-release-android-aarch64-24-sdk/usr/include" ],
  "extra-swiftc-flags": [
    "-resource-dir", "/Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-release-android-aarch64-24-sdk/usr/lib/swift",
    "-tools-directory", "/Users/fjtrujy/Projects/swiftCInterop/toolchain/NDK/toolchains/llvm/prebuilt/darwin-x86_64/bin",
    "-Xcc", "-I/Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-release-android-aarch64-24-sdk/usr/include",
    "-L/Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-release-android-aarch64-24-sdk/usr/lib"
  ],
  "extra-cpp-flags": [ "-lstdc++" ]
}

Link clang

ln -sf /opt/homebrew/Cellar/swift/5.8.1_1/Swift-5.8.xctoolchain/usr/bin/clang /Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-release-android-aarch64-24-sdk/usr/lib/swift/clang

And then finally execute:

swiftCInterop git:(main) ✗ /opt/homebrew/Cellar/swift/5.8.1_1/Swift-5.8.xctoolchain/usr/bin/swift build --build-tests --destination /Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-release-android-aarch64-24-sdk/usr/swiftpm-android-aarch64.json -Xlinker -rpath -Xlinker \$ORIGIN/swift-release-android-aarch64-24-sdk/usr/lib --verbose
Planning build
warning: 'swiftcinterop': /opt/homebrew/Cellar/swift/5.8.1_1/Swift-5.8.xctoolchain/usr/bin/swift-frontend -frontend -c -primary-file /Users/fjtrujy/Projects/swiftCInterop/Package.swift -target arm64-apple-macosx11.0 -Xllvm -aarch64-use-tbi -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk -I /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib -I /opt/homebrew/Cellar/swift/5.8.1_1/Swift-5.8.xctoolchain/usr/lib/swift/pm/ManifestAPI -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -vfsoverlay /var/folders/zx/7w07tq_d26gc0z8fdl4s2zz00000gn/T/TemporaryDirectory.OG0Bo2/vfs.yaml -swift-version 5 -package-description-version 5.8.0 -new-driver-path /opt/homebrew/Cellar/swift/5.8.1_1/Swift-5.8.xctoolchain/usr/bin/swift-driver -disable-implicit-concurrency-module-import -disable-implicit-string-processing-module-import -empty-abi-descriptor -resource-dir /opt/homebrew/opt/swift/Swift-5.8.xctoolchain/usr/lib/swift -module-name main -target-sdk-version 13.3 -target-sdk-name macosx13.3 -o /var/folders/zx/7w07tq_d26gc0z8fdl4s2zz00000gn/T/TemporaryDirectory.YVlutc/Package-1.o
/opt/homebrew/Cellar/swift/5.8.1_1/Swift-5.8.xctoolchain/usr/bin/clang /var/folders/zx/7w07tq_d26gc0z8fdl4s2zz00000gn/T/TemporaryDirectory.YVlutc/Package-1.o -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks --sysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk -lSystem --target=arm64-apple-macosx11.0 -force_load /opt/homebrew/opt/swift/Swift-5.8.xctoolchain/usr/lib/swift/macosx/libswiftCompatibilityConcurrency.a -force_load /opt/homebrew/opt/swift/Swift-5.8.xctoolchain/usr/lib/swift/macosx/libswiftCompatibility56.a -L /opt/homebrew/opt/swift/Swift-5.8.xctoolchain/usr/lib/swift/macosx -L /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/swift -rpath /usr/lib/swift -L /opt/homebrew/Cellar/swift/5.8.1_1/Swift-5.8.xctoolchain/usr/lib/swift/pm/ManifestAPI -L /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib -lPackageDescription -Xlinker -rpath -Xlinker /opt/homebrew/Cellar/swift/5.8.1_1/Swift-5.8.xctoolchain/usr/lib/swift/pm/ManifestAPI -o /var/folders/zx/7w07tq_d26gc0z8fdl4s2zz00000gn/T/TemporaryDirectory.l75XXh/swiftcinterop-manifest
Swift version 5.8.1 (swift-5.8.1-RELEASE)
Target: arm64-apple-macosx11.0
Building for debugging...
/opt/homebrew/Cellar/swift/5.8.1_1/Swift-5.8.xctoolchain/usr/bin/swiftc -module-name swiftCInterop -incremental -emit-dependencies -emit-module -emit-module-path /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/swiftCInterop.swiftmodule -output-file-map /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/swiftCInterop.build/output-file-map.json -parse-as-library -c /Users/fjtrujy/Projects/swiftCInterop/Sources/swiftCInterop/swiftCInterop.swift -I /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug -target aarch64-unknown-linux-android24 -swift-version 5 -enable-batch-mode -index-store-path /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/index/store -Onone -enable-testing -g -j10 -DSWIFT_PACKAGE -DDEBUG -module-cache-path /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/ModuleCache -parseable-output -parse-as-library -color-diagnostics -sdk /Users/fjtrujy/Projects/swiftCInterop/toolchain/NDK/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -resource-dir /Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-release-android-aarch64-24-sdk/usr/lib/swift -tools-directory /Users/fjtrujy/Projects/swiftCInterop/toolchain/NDK/toolchains/llvm/prebuilt/darwin-x86_64/bin -Xcc -I/Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-release-android-aarch64-24-sdk/usr/include -L/Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-release-android-aarch64-24-sdk/usr/lib -v
warning: Could not read SDKSettings.json for SDK at: /Users/fjtrujy/Projects/swiftCInterop/toolchain/NDK/toolchains/llvm/prebuilt/darwin-x86_64/sysroot
Swift version 5.8.1 (swift-5.8.1-RELEASE)
Target: aarch64-unknown-linux-android24
/opt/homebrew/Cellar/swift/5.8.1_1/Swift-5.8.xctoolchain/usr/bin/swift-frontend -frontend -emit-module -experimental-skip-non-inlinable-function-bodies-without-types /Users/fjtrujy/Projects/swiftCInterop/Sources/swiftCInterop/swiftCInterop.swift -target aarch64-unknown-linux-android24 -Xllvm -aarch64-use-tbi -disable-objc-interop -sdk /Users/fjtrujy/Projects/swiftCInterop/toolchain/NDK/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -I /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug -color-diagnostics -enable-testing -g -module-cache-path /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/ModuleCache -swift-version 5 -Onone -D SWIFT_PACKAGE -D DEBUG -new-driver-path /opt/homebrew/Cellar/swift/5.8.1_1/Swift-5.8.xctoolchain/usr/bin/swift-driver -empty-abi-descriptor -resource-dir /Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-release-android-aarch64-24-sdk/usr/lib/swift -enable-anonymous-context-mangled-names -Xcc -I/Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-release-android-aarch64-24-sdk/usr/include -module-name swiftCInterop -emit-module-doc-path /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/swiftCInterop.swiftdoc -emit-module-source-info-path /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/swiftCInterop.swiftsourceinfo -emit-dependencies-path /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/swiftCInterop.build/swiftCInterop.emit-module.d -parse-as-library -o /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/swiftCInterop.swiftmodule
/opt/homebrew/Cellar/swift/5.8.1_1/Swift-5.8.xctoolchain/usr/bin/swift-frontend -frontend -c -primary-file /Users/fjtrujy/Projects/swiftCInterop/Sources/swiftCInterop/swiftCInterop.swift -emit-dependencies-path /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/swiftCInterop.build/swiftCInterop.d -emit-reference-dependencies-path /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/swiftCInterop.build/swiftCInterop.swiftdeps -target aarch64-unknown-linux-android24 -Xllvm -aarch64-use-tbi -disable-objc-interop -sdk /Users/fjtrujy/Projects/swiftCInterop/toolchain/NDK/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -I /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug -color-diagnostics -enable-testing -g -module-cache-path /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/ModuleCache -swift-version 5 -Onone -D SWIFT_PACKAGE -D DEBUG -new-driver-path /opt/homebrew/Cellar/swift/5.8.1_1/Swift-5.8.xctoolchain/usr/bin/swift-driver -empty-abi-descriptor -resource-dir /Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-release-android-aarch64-24-sdk/usr/lib/swift -enable-anonymous-context-mangled-names -Xcc -I/Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-release-android-aarch64-24-sdk/usr/include -module-name swiftCInterop -parse-as-library -o /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/swiftCInterop.build/swiftCInterop.swift.o -index-store-path /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/index/store -index-system-modules
/opt/homebrew/Cellar/swift/5.8.1_1/Swift-5.8.xctoolchain/usr/bin/swift-frontend -modulewrap /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/swiftCInterop.swiftmodule -target aarch64-unknown-linux-android24 -o /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/swiftCInterop.o
<unknown>:0: warning: glibc not found for 'aarch64-unknown-linux-android24'; C stdlib may be unavailable
/opt/homebrew/Cellar/swift/5.8.1_1/Swift-5.8.xctoolchain/usr/bin/swift-autolink-extract /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/swiftCInterop.o /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/swiftCInterop.build/swiftCInterop.swift.o -o /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/swiftCInterop.autolink
/opt/homebrew/Cellar/swift/5.8.1_1/Swift-5.8.xctoolchain/usr/bin/swiftc -modulewrap /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/swiftCInterop.swiftmodule -o /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/swiftCInterop.build/swiftCInterop.swiftmodule.o -target aarch64-unknown-linux-android24
/opt/homebrew/Cellar/swift/5.8.1_1/Swift-5.8.xctoolchain/usr/bin/swiftc -module-name swiftCInteropTests -incremental -emit-dependencies -emit-module -emit-module-path /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/swiftCInteropTests.swiftmodule -output-file-map /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/swiftCInteropTests.build/output-file-map.json -parse-as-library -c /Users/fjtrujy/Projects/swiftCInterop/Tests/swiftCInteropTests/swiftCInteropTests.swift -I /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug -target aarch64-unknown-linux-android24 -swift-version 5 -enable-batch-mode -index-store-path /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/index/store -Onone -enable-testing -g -j10 -DSWIFT_PACKAGE -DDEBUG -module-cache-path /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/ModuleCache -parseable-output -parse-as-library -color-diagnostics -sdk /Users/fjtrujy/Projects/swiftCInterop/toolchain/NDK/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -resource-dir /Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-release-android-aarch64-24-sdk/usr/lib/swift -tools-directory /Users/fjtrujy/Projects/swiftCInterop/toolchain/NDK/toolchains/llvm/prebuilt/darwin-x86_64/bin -Xcc -I/Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-release-android-aarch64-24-sdk/usr/include -L/Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-release-android-aarch64-24-sdk/usr/lib -v
<unknown>:0: warning: glibc not found for 'aarch64-unknown-linux-android24'; C stdlib may be unavailable
/opt/homebrew/Cellar/swift/5.8.1_1/Swift-5.8.xctoolchain/usr/bin/swiftc -L /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug -o /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/libswiftCInterop.so -module-name swiftCInterop -emit-library -Xlinker '-rpath=$ORIGIN' @/Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/swiftCInterop.product/Objects.LinkFileList -target aarch64-unknown-linux-android24 -sdk /Users/fjtrujy/Projects/swiftCInterop/toolchain/NDK/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -resource-dir /Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-release-android-aarch64-24-sdk/usr/lib/swift -tools-directory /Users/fjtrujy/Projects/swiftCInterop/toolchain/NDK/toolchains/llvm/prebuilt/darwin-x86_64/bin -Xcc -I/Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-release-android-aarch64-24-sdk/usr/include -L/Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-release-android-aarch64-24-sdk/usr/lib -Xlinker -rpath -Xlinker '$ORIGIN/swift-release-android-aarch64-24-sdk/usr/lib' -v -L /opt/homebrew/Cellar/swift/5.8.1_1/Swift-5.8.xctoolchain/usr/lib
warning: Could not read SDKSettings.json for SDK at: /Users/fjtrujy/Projects/swiftCInterop/toolchain/NDK/toolchains/llvm/prebuilt/darwin-x86_64/sysroot
Swift version 5.8.1 (swift-5.8.1-RELEASE)
Target: aarch64-unknown-linux-android24
/opt/homebrew/Cellar/swift/5.8.1_1/Swift-5.8.xctoolchain/usr/bin/swift-frontend -frontend -emit-module -experimental-skip-non-inlinable-function-bodies-without-types /Users/fjtrujy/Projects/swiftCInterop/Tests/swiftCInteropTests/swiftCInteropTests.swift -target aarch64-unknown-linux-android24 -Xllvm -aarch64-use-tbi -disable-objc-interop -sdk /Users/fjtrujy/Projects/swiftCInterop/toolchain/NDK/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -I /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug -color-diagnostics -enable-testing -g -module-cache-path /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/ModuleCache -swift-version 5 -Onone -D SWIFT_PACKAGE -D DEBUG -new-driver-path /opt/homebrew/Cellar/swift/5.8.1_1/Swift-5.8.xctoolchain/usr/bin/swift-driver -empty-abi-descriptor -resource-dir /Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-release-android-aarch64-24-sdk/usr/lib/swift -enable-anonymous-context-mangled-names -Xcc -I/Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-release-android-aarch64-24-sdk/usr/include -module-name swiftCInteropTests -emit-module-doc-path /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/swiftCInteropTests.swiftdoc -emit-module-source-info-path /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/swiftCInteropTests.swiftsourceinfo -emit-dependencies-path /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/swiftCInteropTests.build/swiftCInteropTests.emit-module.d -parse-as-library -o /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/swiftCInteropTests.swiftmodule
/opt/homebrew/Cellar/swift/5.8.1_1/Swift-5.8.xctoolchain/usr/bin/swift-frontend -frontend -c -primary-file /Users/fjtrujy/Projects/swiftCInterop/Tests/swiftCInteropTests/swiftCInteropTests.swift -emit-dependencies-path /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/swiftCInteropTests.build/swiftCInteropTests.d -emit-reference-dependencies-path /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/swiftCInteropTests.build/swiftCInteropTests.swiftdeps -target aarch64-unknown-linux-android24 -Xllvm -aarch64-use-tbi -disable-objc-interop -sdk /Users/fjtrujy/Projects/swiftCInterop/toolchain/NDK/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -I /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug -color-diagnostics -enable-testing -g -module-cache-path /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/ModuleCache -swift-version 5 -Onone -D SWIFT_PACKAGE -D DEBUG -new-driver-path /opt/homebrew/Cellar/swift/5.8.1_1/Swift-5.8.xctoolchain/usr/bin/swift-driver -empty-abi-descriptor -resource-dir /Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-release-android-aarch64-24-sdk/usr/lib/swift -enable-anonymous-context-mangled-names -Xcc -I/Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-release-android-aarch64-24-sdk/usr/include -module-name swiftCInteropTests -parse-as-library -o /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/swiftCInteropTests.build/swiftCInteropTests.swift.o -index-store-path /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/index/store -index-system-modules
error: emit-module command failed with exit code 1 (use -v to see invocation)
<module-includes>:1:10: note: in file included from <module-includes>:1:
#include "dispatch.h"
         ^
/Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-release-android-aarch64-24-sdk/usr/lib/swift/dispatch/dispatch.h:32:10: note: in file included from /Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-release-android-aarch64-24-sdk/usr/lib/swift/dispatch/dispatch.h:32:
#include <os/generic_unix_base.h>
         ^
/Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-release-android-aarch64-24-sdk/usr/lib/swift/os/generic_unix_base.h:24:10: note: in file included from /Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-release-android-aarch64-24-sdk/usr/lib/swift/os/generic_unix_base.h:24:
#include <sys/param.h>
         ^
/Users/fjtrujy/Projects/swiftCInterop/toolchain/NDK/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/sys/param.h:36:10: note: in file included from /Users/fjtrujy/Projects/swiftCInterop/toolchain/NDK/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/sys/param.h:36:
#include <endian.h>
         ^
/Users/fjtrujy/Projects/swiftCInterop/toolchain/NDK/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/endian.h:10:10: note: in file included from /Users/fjtrujy/Projects/swiftCInterop/toolchain/NDK/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/endian.h:10:
#include <sys/endian.h>
         ^
/Users/fjtrujy/Projects/swiftCInterop/toolchain/NDK/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/sys/endian.h:30:10: note: in file included from /Users/fjtrujy/Projects/swiftCInterop/toolchain/NDK/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/sys/endian.h:30:
#include <stdint.h>
         ^
/Users/fjtrujy/Projects/swiftCInterop/toolchain/NDK/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/stdint.h:33:10: error: 'stddef.h' file not found
#include <stddef.h>
         ^
<unknown>:0: error: could not build C module 'CDispatch'
<module-includes>:1:10: note: in file included from <module-includes>:1:
#include "dispatch.h"
         ^
/Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-release-android-aarch64-24-sdk/usr/lib/swift/dispatch/dispatch.h:32:10: note: in file included from /Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-release-android-aarch64-24-sdk/usr/lib/swift/dispatch/dispatch.h:32:
#include <os/generic_unix_base.h>
         ^
/Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-release-android-aarch64-24-sdk/usr/lib/swift/os/generic_unix_base.h:24:10: note: in file included from /Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-release-android-aarch64-24-sdk/usr/lib/swift/os/generic_unix_base.h:24:
#include <sys/param.h>
         ^
/Users/fjtrujy/Projects/swiftCInterop/toolchain/NDK/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/sys/param.h:36:10: note: in file included from /Users/fjtrujy/Projects/swiftCInterop/toolchain/NDK/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/sys/param.h:36:
#include <endian.h>
         ^
/Users/fjtrujy/Projects/swiftCInterop/toolchain/NDK/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/endian.h:10:10: note: in file included from /Users/fjtrujy/Projects/swiftCInterop/toolchain/NDK/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/endian.h:10:
#include <sys/endian.h>
         ^
/Users/fjtrujy/Projects/swiftCInterop/toolchain/NDK/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/sys/endian.h:30:10: note: in file included from /Users/fjtrujy/Projects/swiftCInterop/toolchain/NDK/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/sys/endian.h:30:
#include <stdint.h>
         ^
/Users/fjtrujy/Projects/swiftCInterop/toolchain/NDK/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/stdint.h:33:10: error: 'stddef.h' file not found
#include <stddef.h>
         ^
<unknown>:0: error: could not build C module 'CDispatch'
warning: Could not read SDKSettings.json for SDK at: /Users/fjtrujy/Projects/swiftCInterop/toolchain/NDK/toolchains/llvm/prebuilt/darwin-x86_64/sysroot
Swift version 5.8.1 (swift-5.8.1-RELEASE)
Target: aarch64-unknown-linux-android24
/opt/homebrew/Cellar/swift/5.8.1_1/Swift-5.8.xctoolchain/usr/bin/swift-autolink-extract /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/swiftCInterop.build/swiftCInterop.swift.o /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/swiftCInterop.build/swiftCInterop.swiftmodule.o -o /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/swiftCInterop.build/swiftCInterop.autolink
/Users/fjtrujy/Projects/swiftCInterop/toolchain/NDK/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang -shared -fuse-ld=lld -Xlinker -z -Xlinker nostart-stop-gc -B /Users/fjtrujy/Projects/swiftCInterop/toolchain/NDK/toolchains/llvm/prebuilt/darwin-x86_64/bin /Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-release-android-aarch64-24-sdk/usr/lib/swift/android/aarch64/swiftrt.o /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/swiftCInterop.build/swiftCInterop.swift.o /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/swiftCInterop.build/swiftCInterop.swiftmodule.o @/Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/swiftCInterop.build/swiftCInterop.autolink --sysroot /Users/fjtrujy/Projects/swiftCInterop/toolchain/NDK/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -L /Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-release-android-aarch64-24-sdk/usr/lib/swift/android -L /Users/fjtrujy/Projects/swiftCInterop/toolchain/NDK/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/swift -lswiftCore --target=aarch64-unknown-linux-android24 -v -L /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug -L /Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-release-android-aarch64-24-sdk/usr/lib -L /opt/homebrew/Cellar/swift/5.8.1_1/Swift-5.8.xctoolchain/usr/lib -Xlinker '-rpath=$ORIGIN' -Xlinker -rpath -Xlinker '$ORIGIN/swift-release-android-aarch64-24-sdk/usr/lib' -o /Users/fjtrujy/Projects/swiftCInterop/.build/aarch64-unknown-linux-android24/debug/libswiftCInterop.so

Probably I forgot something....

fjtrujy commented 1 year ago

The issue now looks to be that brew swift installed version doesn't have the clang folder as the Linux one has... and it is there where we miss all the headers, is that right?

Cheers

finagolfin commented 1 year ago

Your clang must have a stddef.h installed somewhere: try adding a symlink from the Android SDK to whatever clang resource directory your clang is using, as shown in my doc for linux.

fjtrujy commented 1 year ago

Your clang must have a stddef.h installed somewhere: try adding a symlink from the Android SDK to whatever clang resource directory your clang is using, as shown in my doc for linux.

Here you have the whole content of the brew Swift toolchain, let me know what do you want to link and how, include and binaries for clang looks to be in separate folders:

➜  swiftCInterop git:(main) ✗ tree /opt/homebrew/Cellar/swift/5.8.1_1/Swift-5.8.xctoolchain
/opt/homebrew/Cellar/swift/5.8.1_1/Swift-5.8.xctoolchain
├── System
│   └── Library
│       └── PrivateFrameworks
│           └── LLDB.framework
│               ├── Headers -> Versions/Current/Headers
│               ├── LLDB -> Versions/Current/LLDB
│               ├── Resources -> Versions/Current/Resources
│               └── Versions
│                   ├── A
│                   │   ├── Headers
│                   │   │   ├── LLDB.h
│                   │   │   ├── SBAddress.h
│                   │   │   ├── SBAttachInfo.h
│                   │   │   ├── SBBlock.h
│                   │   │   ├── SBBreakpoint.h
│                   │   │   ├── SBBreakpointLocation.h
│                   │   │   ├── SBBreakpointName.h
│                   │   │   ├── SBBroadcaster.h
│                   │   │   ├── SBCommandInterpreter.h
│                   │   │   ├── SBCommandInterpreterRunOptions.h
│                   │   │   ├── SBCommandReturnObject.h
│                   │   │   ├── SBCommunication.h
│                   │   │   ├── SBCompileUnit.h
│                   │   │   ├── SBData.h
│                   │   │   ├── SBDebugger.h
│                   │   │   ├── SBDeclaration.h
│                   │   │   ├── SBDefines.h
│                   │   │   ├── SBEnvironment.h
│                   │   │   ├── SBError.h
│                   │   │   ├── SBEvent.h
│                   │   │   ├── SBExecutionContext.h
│                   │   │   ├── SBExpressionOptions.h
│                   │   │   ├── SBFile.h
│                   │   │   ├── SBFileSpec.h
│                   │   │   ├── SBFileSpecList.h
│                   │   │   ├── SBFrame.h
│                   │   │   ├── SBFunction.h
│                   │   │   ├── SBHostOS.h
│                   │   │   ├── SBInstruction.h
│                   │   │   ├── SBInstructionList.h
│                   │   │   ├── SBLanguageRuntime.h
│                   │   │   ├── SBLaunchInfo.h
│                   │   │   ├── SBLineEntry.h
│                   │   │   ├── SBListener.h
│                   │   │   ├── SBMemoryRegionInfo.h
│                   │   │   ├── SBMemoryRegionInfoList.h
│                   │   │   ├── SBModule.h
│                   │   │   ├── SBModuleSpec.h
│                   │   │   ├── SBPlatform.h
│                   │   │   ├── SBProcess.h
│                   │   │   ├── SBProcessInfo.h
│                   │   │   ├── SBQueue.h
│                   │   │   ├── SBQueueItem.h
│                   │   │   ├── SBReproducer.h
│                   │   │   ├── SBSection.h
│                   │   │   ├── SBSourceManager.h
│                   │   │   ├── SBStream.h
│                   │   │   ├── SBStringList.h
│                   │   │   ├── SBStructuredData.h
│                   │   │   ├── SBSymbol.h
│                   │   │   ├── SBSymbolContext.h
│                   │   │   ├── SBSymbolContextList.h
│                   │   │   ├── SBTarget.h
│                   │   │   ├── SBThread.h
│                   │   │   ├── SBThreadCollection.h
│                   │   │   ├── SBThreadPlan.h
│                   │   │   ├── SBTrace.h
│                   │   │   ├── SBType.h
│                   │   │   ├── SBTypeCategory.h
│                   │   │   ├── SBTypeEnumMember.h
│                   │   │   ├── SBTypeFilter.h
│                   │   │   ├── SBTypeFormat.h
│                   │   │   ├── SBTypeNameSpecifier.h
│                   │   │   ├── SBTypeSummary.h
│                   │   │   ├── SBTypeSynthetic.h
│                   │   │   ├── SBUnixSignals.h
│                   │   │   ├── SBValue.h
│                   │   │   ├── SBValueList.h
│                   │   │   ├── SBVariablesOptions.h
│                   │   │   ├── SBWatchpoint.h
│                   │   │   ├── lldb-defines.h
│                   │   │   ├── lldb-enumerations.h
│                   │   │   ├── lldb-forward.h
│                   │   │   ├── lldb-public.h
│                   │   │   ├── lldb-types.h
│                   │   │   └── lldb-versioning.h
│                   │   ├── LLDB
│                   │   ├── Resources
│                   │   │   ├── Clang
│                   │   │   │   └── include
│                   │   │   │       ├── __clang_cuda_builtin_vars.h
│                   │   │   │       ├── __clang_cuda_cmath.h
│                   │   │   │       ├── __clang_cuda_complex_builtins.h
│                   │   │   │       ├── __clang_cuda_device_functions.h
│                   │   │   │       ├── __clang_cuda_intrinsics.h
│                   │   │   │       ├── __clang_cuda_libdevice_declares.h
│                   │   │   │       ├── __clang_cuda_math.h
│                   │   │   │       ├── __clang_cuda_math_forward_declares.h
│                   │   │   │       ├── __clang_cuda_runtime_wrapper.h
│                   │   │   │       ├── __clang_cuda_texture_intrinsics.h
│                   │   │   │       ├── __clang_hip_cmath.h
│                   │   │   │       ├── __clang_hip_libdevice_declares.h
│                   │   │   │       ├── __clang_hip_math.h
│                   │   │   │       ├── __clang_hip_runtime_wrapper.h
│                   │   │   │       ├── __stddef_max_align_t.h
│                   │   │   │       ├── __wmmintrin_aes.h
│                   │   │   │       ├── __wmmintrin_pclmul.h
│                   │   │   │       ├── adxintrin.h
│                   │   │   │       ├── altivec.h
│                   │   │   │       ├── ammintrin.h
│                   │   │   │       ├── amxintrin.h
│                   │   │   │       ├── arm64intr.h
│                   │   │   │       ├── arm_acle.h
│                   │   │   │       ├── arm_bf16.h
│                   │   │   │       ├── arm_cde.h
│                   │   │   │       ├── arm_cmse.h
│                   │   │   │       ├── arm_fp16.h
│                   │   │   │       ├── arm_mve.h
│                   │   │   │       ├── arm_neon.h
│                   │   │   │       ├── arm_neon_sve_bridge.h
│                   │   │   │       ├── arm_sve.h
│                   │   │   │       ├── armintr.h
│                   │   │   │       ├── avx2intrin.h
│                   │   │   │       ├── avx512bf16intrin.h
│                   │   │   │       ├── avx512bitalgintrin.h
│                   │   │   │       ├── avx512bwintrin.h
│                   │   │   │       ├── avx512cdintrin.h
│                   │   │   │       ├── avx512dqintrin.h
│                   │   │   │       ├── avx512erintrin.h
│                   │   │   │       ├── avx512fintrin.h
│                   │   │   │       ├── avx512fp16intrin.h
│                   │   │   │       ├── avx512ifmaintrin.h
│                   │   │   │       ├── avx512ifmavlintrin.h
│                   │   │   │       ├── avx512pfintrin.h
│                   │   │   │       ├── avx512vbmi2intrin.h
│                   │   │   │       ├── avx512vbmiintrin.h
│                   │   │   │       ├── avx512vbmivlintrin.h
│                   │   │   │       ├── avx512vlbf16intrin.h
│                   │   │   │       ├── avx512vlbitalgintrin.h
│                   │   │   │       ├── avx512vlbwintrin.h
│                   │   │   │       ├── avx512vlcdintrin.h
│                   │   │   │       ├── avx512vldqintrin.h
│                   │   │   │       ├── avx512vlfp16intrin.h
│                   │   │   │       ├── avx512vlintrin.h
│                   │   │   │       ├── avx512vlvbmi2intrin.h
│                   │   │   │       ├── avx512vlvnniintrin.h
│                   │   │   │       ├── avx512vlvp2intersectintrin.h
│                   │   │   │       ├── avx512vnniintrin.h
│                   │   │   │       ├── avx512vp2intersectintrin.h
│                   │   │   │       ├── avx512vpopcntdqintrin.h
│                   │   │   │       ├── avx512vpopcntdqvlintrin.h
│                   │   │   │       ├── avxintrin.h
│                   │   │   │       ├── avxvnniintrin.h
│                   │   │   │       ├── bmi2intrin.h
│                   │   │   │       ├── bmiintrin.h
│                   │   │   │       ├── builtins.h
│                   │   │   │       ├── cet.h
│                   │   │   │       ├── cetintrin.h
│                   │   │   │       ├── cldemoteintrin.h
│                   │   │   │       ├── clflushoptintrin.h
│                   │   │   │       ├── clwbintrin.h
│                   │   │   │       ├── clzerointrin.h
│                   │   │   │       ├── cpuid.h
│                   │   │   │       ├── crc32intrin.h
│                   │   │   │       ├── cuda_wrappers
│                   │   │   │       │   ├── algorithm
│                   │   │   │       │   ├── complex
│                   │   │   │       │   └── new
│                   │   │   │       ├── emmintrin.h
│                   │   │   │       ├── enqcmdintrin.h
│                   │   │   │       ├── f16cintrin.h
│                   │   │   │       ├── float.h
│                   │   │   │       ├── fma4intrin.h
│                   │   │   │       ├── fmaintrin.h
│                   │   │   │       ├── fuzzer
│                   │   │   │       │   └── FuzzedDataProvider.h
│                   │   │   │       ├── fxsrintrin.h
│                   │   │   │       ├── gfniintrin.h
│                   │   │   │       ├── hexagon_circ_brev_intrinsics.h
│                   │   │   │       ├── hexagon_protos.h
│                   │   │   │       ├── hexagon_types.h
│                   │   │   │       ├── hresetintrin.h
│                   │   │   │       ├── htmintrin.h
│                   │   │   │       ├── htmxlintrin.h
│                   │   │   │       ├── hvx_hexagon_protos.h
│                   │   │   │       ├── ia32intrin.h
│                   │   │   │       ├── immintrin.h
│                   │   │   │       ├── intrin.h
│                   │   │   │       ├── inttypes.h
│                   │   │   │       ├── invpcidintrin.h
│                   │   │   │       ├── iso646.h
│                   │   │   │       ├── keylockerintrin.h
│                   │   │   │       ├── limits.h
│                   │   │   │       ├── lwpintrin.h
│                   │   │   │       ├── lzcntintrin.h
│                   │   │   │       ├── mm3dnow.h
│                   │   │   │       ├── mm_malloc.h
│                   │   │   │       ├── mmintrin.h
│                   │   │   │       ├── module.modulemap
│                   │   │   │       ├── movdirintrin.h
│                   │   │   │       ├── msa.h
│                   │   │   │       ├── mwaitxintrin.h
│                   │   │   │       ├── nmmintrin.h
│                   │   │   │       ├── opencl-c-base.h
│                   │   │   │       ├── opencl-c.h
│                   │   │   │       ├── openmp_wrappers
│                   │   │   │       │   ├── __clang_openmp_device_functions.h
│                   │   │   │       │   ├── cmath
│                   │   │   │       │   ├── complex
│                   │   │   │       │   ├── complex.h
│                   │   │   │       │   ├── complex_cmath.h
│                   │   │   │       │   ├── math.h
│                   │   │   │       │   └── new
│                   │   │   │       ├── pconfigintrin.h
│                   │   │   │       ├── pkuintrin.h
│                   │   │   │       ├── pmmintrin.h
│                   │   │   │       ├── popcntintrin.h
│                   │   │   │       ├── ppc_wrappers
│                   │   │   │       │   ├── bmi2intrin.h
│                   │   │   │       │   ├── bmiintrin.h
│                   │   │   │       │   ├── emmintrin.h
│                   │   │   │       │   ├── immintrin.h
│                   │   │   │       │   ├── mm_malloc.h
│                   │   │   │       │   ├── mmintrin.h
│                   │   │   │       │   ├── pmmintrin.h
│                   │   │   │       │   ├── smmintrin.h
│                   │   │   │       │   ├── tmmintrin.h
│                   │   │   │       │   ├── x86gprintrin.h
│                   │   │   │       │   ├── x86intrin.h
│                   │   │   │       │   └── xmmintrin.h
│                   │   │   │       ├── prfchwintrin.h
│                   │   │   │       ├── profile
│                   │   │   │       │   ├── InstrProfData.inc
│                   │   │   │       │   └── MemProfData.inc
│                   │   │   │       ├── ptrauth.h
│                   │   │   │       ├── ptwriteintrin.h
│                   │   │   │       ├── rdseedintrin.h
│                   │   │   │       ├── rtmintrin.h
│                   │   │   │       ├── s390intrin.h
│                   │   │   │       ├── sanitizer
│                   │   │   │       │   ├── allocator_interface.h
│                   │   │   │       │   ├── asan_interface.h
│                   │   │   │       │   ├── common_interface_defs.h
│                   │   │   │       │   ├── coverage_interface.h
│                   │   │   │       │   ├── dfsan_interface.h
│                   │   │   │       │   ├── hwasan_interface.h
│                   │   │   │       │   ├── linux_syscall_hooks.h
│                   │   │   │       │   ├── lsan_interface.h
│                   │   │   │       │   ├── memprof_interface.h
│                   │   │   │       │   ├── msan_interface.h
│                   │   │   │       │   ├── netbsd_syscall_hooks.h
│                   │   │   │       │   ├── scudo_interface.h
│                   │   │   │       │   ├── tsan_interface.h
│                   │   │   │       │   ├── tsan_interface_atomic.h
│                   │   │   │       │   └── ubsan_interface.h
│                   │   │   │       ├── serializeintrin.h
│                   │   │   │       ├── sgxintrin.h
│                   │   │   │       ├── shaintrin.h
│                   │   │   │       ├── smmintrin.h
│                   │   │   │       ├── stdalign.h
│                   │   │   │       ├── stdarg.h
│                   │   │   │       ├── stdatomic.h
│                   │   │   │       ├── stdbool.h
│                   │   │   │       ├── stddef.h
│                   │   │   │       ├── stdint.h
│                   │   │   │       ├── stdnoreturn.h
│                   │   │   │       ├── tbmintrin.h
│                   │   │   │       ├── tgmath.h
│                   │   │   │       ├── tmmintrin.h
│                   │   │   │       ├── tsxldtrkintrin.h
│                   │   │   │       ├── uintrintrin.h
│                   │   │   │       ├── unwind.h
│                   │   │   │       ├── vadefs.h
│                   │   │   │       ├── vaesintrin.h
│                   │   │   │       ├── varargs.h
│                   │   │   │       ├── vecintrin.h
│                   │   │   │       ├── velintrin.h
│                   │   │   │       ├── velintrin_approx.h
│                   │   │   │       ├── velintrin_gen.h
│                   │   │   │       ├── vpclmulqdqintrin.h
│                   │   │   │       ├── waitpkgintrin.h
│                   │   │   │       ├── wasm_simd128.h
│                   │   │   │       ├── wbnoinvdintrin.h
│                   │   │   │       ├── wmmintrin.h
│                   │   │   │       ├── x86gprintrin.h
│                   │   │   │       ├── x86intrin.h
│                   │   │   │       ├── xmmintrin.h
│                   │   │   │       ├── xopintrin.h
│                   │   │   │       ├── xray
│                   │   │   │       │   ├── xray_interface.h
│                   │   │   │       │   ├── xray_log_interface.h
│                   │   │   │       │   └── xray_records.h
│                   │   │   │       ├── xsavecintrin.h
│                   │   │   │       ├── xsaveintrin.h
│                   │   │   │       ├── xsaveoptintrin.h
│                   │   │   │       ├── xsavesintrin.h
│                   │   │   │       └── xtestintrin.h
│                   │   │   ├── Info.plist
│                   │   │   ├── Python
│                   │   │   │   ├── lldb
│                   │   │   │   │   ├── __init__.py
│                   │   │   │   │   ├── _lldb.cpython-311-darwin.so -> ../../../LLDB
│                   │   │   │   │   ├── diagnose
│                   │   │   │   │   │   ├── __init__.py
│                   │   │   │   │   │   ├── diagnose_nsstring.py
│                   │   │   │   │   │   └── diagnose_unwind.py
│                   │   │   │   │   ├── embedded_interpreter.py
│                   │   │   │   │   ├── formatters
│                   │   │   │   │   │   ├── Logger.py
│                   │   │   │   │   │   ├── __init__.py
│                   │   │   │   │   │   ├── attrib_fromdict.py
│                   │   │   │   │   │   ├── cache.py
│                   │   │   │   │   │   ├── cpp
│                   │   │   │   │   │   │   ├── __init__.py
│                   │   │   │   │   │   │   ├── gnu_libstdcpp.py
│                   │   │   │   │   │   │   └── libcxx.py
│                   │   │   │   │   │   ├── metrics.py
│                   │   │   │   │   │   └── synth.py
│                   │   │   │   │   ├── macosx
│                   │   │   │   │   │   ├── __init__.py
│                   │   │   │   │   │   ├── crashlog.py
│                   │   │   │   │   │   ├── crashlog_scripted_process.py
│                   │   │   │   │   │   ├── heap
│                   │   │   │   │   │   │   ├── Makefile
│                   │   │   │   │   │   │   └── heap_find.cpp
│                   │   │   │   │   │   └── heap.py
│                   │   │   │   │   ├── plugins
│                   │   │   │   │   │   ├── __init__.py
│                   │   │   │   │   │   └── scripted_process.py
│                   │   │   │   │   └── utils
│                   │   │   │   │       ├── __init__.py
│                   │   │   │   │       ├── in_call_stack.py
│                   │   │   │   │       └── symbolication.py
│                   │   │   │   └── six.py
│                   │   │   ├── darwin-debug
│                   │   │   ├── lldb-argdumper
│                   │   │   └── repl_swift
│                   │   └── _CodeSignature
│                   │       └── CodeResources
│                   └── Current -> A
└── usr
    ├── bin
    │   ├── clang -> clang-13
    │   ├── clang++ -> clang
    │   ├── clang-13
    │   ├── clang-cache -> clang
    │   ├── clang-cl -> clang
    │   ├── clang-cpp -> clang
    │   ├── clangd
    │   ├── complete-test
    │   ├── docc
    │   ├── dsymutil
    │   ├── lldb
    │   ├── llvm-ar
    │   ├── llvm-cov
    │   ├── llvm-profdata
    │   ├── sdk-module-lists
    │   │   ├── create-module-lists.sh
    │   │   ├── fixed-clang-modules-appletvos.txt
    │   │   ├── fixed-clang-modules-common.txt
    │   │   ├── fixed-clang-modules-iosmac.txt
    │   │   ├── fixed-clang-modules-iphoneos.txt
    │   │   ├── fixed-clang-modules-macosx.txt
    │   │   ├── fixed-clang-modules-watchos.txt
    │   │   ├── fixed-swift-modules-appletvos.txt
    │   │   ├── fixed-swift-modules-common.txt
    │   │   ├── fixed-swift-modules-iosmac.txt
    │   │   ├── fixed-swift-modules-iphoneos.txt
    │   │   ├── fixed-swift-modules-macosx.txt
    │   │   ├── fixed-swift-modules-watchos.txt
    │   │   └── infer-imports.py
    │   ├── sil-func-extractor
    │   ├── sil-llvm-gen
    │   ├── sil-nm
    │   ├── sil-opt
    │   ├── sourcekit-lsp
    │   ├── sourcekitd-repl
    │   ├── sourcekitd-test
    │   ├── swift -> swift-frontend
    │   ├── swift-api-checker.py
    │   ├── swift-api-digester -> swift-frontend
    │   ├── swift-api-dump.py
    │   ├── swift-api-extract -> swift-frontend
    │   ├── swift-ast-script
    │   ├── swift-autolink-extract -> swift-frontend
    │   ├── swift-build -> swift-package
    │   ├── swift-build-sdk-interfaces
    │   ├── swift-build-tool
    │   ├── swift-compatibility-symbols
    │   ├── swift-def-to-strings-converter
    │   ├── swift-demangle
    │   ├── swift-dependency-tool
    │   ├── swift-driver
    │   ├── swift-experimental-destination -> swift-package
    │   ├── swift-frontend
    │   ├── swift-help
    │   ├── swift-ide-test
    │   ├── swift-indent -> swift-frontend
    │   ├── swift-llvm-opt
    │   ├── swift-package
    │   ├── swift-package-collection -> swift-package
    │   ├── swift-package-registry -> swift-package
    │   ├── swift-refactor
    │   ├── swift-reflection-dump
    │   ├── swift-run -> swift-package
    │   ├── swift-serialize-diagnostics
    │   ├── swift-stdlib-tool
    │   ├── swift-symbolgraph-extract -> swift-frontend
    │   ├── swift-test -> swift-package
    │   └── swiftc -> swift-frontend
    ├── include
    │   └── swift
    │       ├── SwiftRemoteMirror
    │       │   ├── MemoryReaderInterface.h
    │       │   ├── Platform.h
    │       │   ├── SwiftRemoteMirror.h
    │       │   ├── SwiftRemoteMirrorTypes.h
    │       │   └── module.modulemap
    │       └── TSCclibc
    │           ├── TSCclibc.h
    │           ├── indexstore_functions.h
    │           ├── module.modulemap
    │           └── process.h
    ├── lib
    │   ├── clang
    │   │   └── 13.0.0
    │   │       ├── include
    │   │       │   ├── __clang_cuda_builtin_vars.h
    │   │       │   ├── __clang_cuda_cmath.h
    │   │       │   ├── __clang_cuda_complex_builtins.h
    │   │       │   ├── __clang_cuda_device_functions.h
    │   │       │   ├── __clang_cuda_intrinsics.h
    │   │       │   ├── __clang_cuda_libdevice_declares.h
    │   │       │   ├── __clang_cuda_math.h
    │   │       │   ├── __clang_cuda_math_forward_declares.h
    │   │       │   ├── __clang_cuda_runtime_wrapper.h
    │   │       │   ├── __clang_cuda_texture_intrinsics.h
    │   │       │   ├── __clang_hip_cmath.h
    │   │       │   ├── __clang_hip_libdevice_declares.h
    │   │       │   ├── __clang_hip_math.h
    │   │       │   ├── __clang_hip_runtime_wrapper.h
    │   │       │   ├── __stddef_max_align_t.h
    │   │       │   ├── __wmmintrin_aes.h
    │   │       │   ├── __wmmintrin_pclmul.h
    │   │       │   ├── adxintrin.h
    │   │       │   ├── altivec.h
    │   │       │   ├── ammintrin.h
    │   │       │   ├── amxintrin.h
    │   │       │   ├── arm64intr.h
    │   │       │   ├── arm_acle.h
    │   │       │   ├── arm_bf16.h
    │   │       │   ├── arm_cde.h
    │   │       │   ├── arm_cmse.h
    │   │       │   ├── arm_fp16.h
    │   │       │   ├── arm_mve.h
    │   │       │   ├── arm_neon.h
    │   │       │   ├── arm_sve.h
    │   │       │   ├── armintr.h
    │   │       │   ├── avx2intrin.h
    │   │       │   ├── avx512bf16intrin.h
    │   │       │   ├── avx512bitalgintrin.h
    │   │       │   ├── avx512bwintrin.h
    │   │       │   ├── avx512cdintrin.h
    │   │       │   ├── avx512dqintrin.h
    │   │       │   ├── avx512erintrin.h
    │   │       │   ├── avx512fintrin.h
    │   │       │   ├── avx512fp16intrin.h
    │   │       │   ├── avx512ifmaintrin.h
    │   │       │   ├── avx512ifmavlintrin.h
    │   │       │   ├── avx512pfintrin.h
    │   │       │   ├── avx512vbmi2intrin.h
    │   │       │   ├── avx512vbmiintrin.h
    │   │       │   ├── avx512vbmivlintrin.h
    │   │       │   ├── avx512vlbf16intrin.h
    │   │       │   ├── avx512vlbitalgintrin.h
    │   │       │   ├── avx512vlbwintrin.h
    │   │       │   ├── avx512vlcdintrin.h
    │   │       │   ├── avx512vldqintrin.h
    │   │       │   ├── avx512vlfp16intrin.h
    │   │       │   ├── avx512vlintrin.h
    │   │       │   ├── avx512vlvbmi2intrin.h
    │   │       │   ├── avx512vlvnniintrin.h
    │   │       │   ├── avx512vlvp2intersectintrin.h
    │   │       │   ├── avx512vnniintrin.h
    │   │       │   ├── avx512vp2intersectintrin.h
    │   │       │   ├── avx512vpopcntdqintrin.h
    │   │       │   ├── avx512vpopcntdqvlintrin.h
    │   │       │   ├── avxintrin.h
    │   │       │   ├── avxvnniintrin.h
    │   │       │   ├── bmi2intrin.h
    │   │       │   ├── bmiintrin.h
    │   │       │   ├── builtins.h
    │   │       │   ├── cet.h
    │   │       │   ├── cetintrin.h
    │   │       │   ├── cldemoteintrin.h
    │   │       │   ├── clflushoptintrin.h
    │   │       │   ├── clwbintrin.h
    │   │       │   ├── clzerointrin.h
    │   │       │   ├── cpuid.h
    │   │       │   ├── crc32intrin.h
    │   │       │   ├── cuda_wrappers
    │   │       │   │   ├── algorithm
    │   │       │   │   ├── complex
    │   │       │   │   └── new
    │   │       │   ├── emmintrin.h
    │   │       │   ├── enqcmdintrin.h
    │   │       │   ├── f16cintrin.h
    │   │       │   ├── float.h
    │   │       │   ├── fma4intrin.h
    │   │       │   ├── fmaintrin.h
    │   │       │   ├── fuzzer
    │   │       │   │   └── FuzzedDataProvider.h
    │   │       │   ├── fxsrintrin.h
    │   │       │   ├── gfniintrin.h
    │   │       │   ├── hexagon_circ_brev_intrinsics.h
    │   │       │   ├── hexagon_protos.h
    │   │       │   ├── hexagon_types.h
    │   │       │   ├── hresetintrin.h
    │   │       │   ├── htmintrin.h
    │   │       │   ├── htmxlintrin.h
    │   │       │   ├── hvx_hexagon_protos.h
    │   │       │   ├── ia32intrin.h
    │   │       │   ├── immintrin.h
    │   │       │   ├── intrin.h
    │   │       │   ├── inttypes.h
    │   │       │   ├── invpcidintrin.h
    │   │       │   ├── iso646.h
    │   │       │   ├── keylockerintrin.h
    │   │       │   ├── limits.h
    │   │       │   ├── lwpintrin.h
    │   │       │   ├── lzcntintrin.h
    │   │       │   ├── mm3dnow.h
    │   │       │   ├── mm_malloc.h
    │   │       │   ├── mmintrin.h
    │   │       │   ├── module.modulemap
    │   │       │   ├── movdirintrin.h
    │   │       │   ├── msa.h
    │   │       │   ├── mwaitxintrin.h
    │   │       │   ├── nmmintrin.h
    │   │       │   ├── opencl-c-base.h
    │   │       │   ├── opencl-c.h
    │   │       │   ├── openmp_wrappers
    │   │       │   │   ├── __clang_openmp_device_functions.h
    │   │       │   │   ├── cmath
    │   │       │   │   ├── complex
    │   │       │   │   ├── complex.h
    │   │       │   │   ├── complex_cmath.h
    │   │       │   │   ├── math.h
    │   │       │   │   └── new
    │   │       │   ├── pconfigintrin.h
    │   │       │   ├── pkuintrin.h
    │   │       │   ├── pmmintrin.h
    │   │       │   ├── popcntintrin.h
    │   │       │   ├── ppc_wrappers
    │   │       │   │   ├── bmi2intrin.h
    │   │       │   │   ├── bmiintrin.h
    │   │       │   │   ├── emmintrin.h
    │   │       │   │   ├── immintrin.h
    │   │       │   │   ├── mm_malloc.h
    │   │       │   │   ├── mmintrin.h
    │   │       │   │   ├── pmmintrin.h
    │   │       │   │   ├── smmintrin.h
    │   │       │   │   ├── tmmintrin.h
    │   │       │   │   ├── x86gprintrin.h
    │   │       │   │   ├── x86intrin.h
    │   │       │   │   └── xmmintrin.h
    │   │       │   ├── prfchwintrin.h
    │   │       │   ├── profile
    │   │       │   │   └── InstrProfData.inc
    │   │       │   ├── ptrauth.h
    │   │       │   ├── ptwriteintrin.h
    │   │       │   ├── rdseedintrin.h
    │   │       │   ├── rtmintrin.h
    │   │       │   ├── s390intrin.h
    │   │       │   ├── sanitizer
    │   │       │   │   ├── allocator_interface.h
    │   │       │   │   ├── asan_interface.h
    │   │       │   │   ├── common_interface_defs.h
    │   │       │   │   ├── coverage_interface.h
    │   │       │   │   ├── dfsan_interface.h
    │   │       │   │   ├── hwasan_interface.h
    │   │       │   │   ├── linux_syscall_hooks.h
    │   │       │   │   ├── lsan_interface.h
    │   │       │   │   ├── msan_interface.h
    │   │       │   │   ├── netbsd_syscall_hooks.h
    │   │       │   │   ├── scudo_interface.h
    │   │       │   │   ├── tsan_interface.h
    │   │       │   │   ├── tsan_interface_atomic.h
    │   │       │   │   └── ubsan_interface.h
    │   │       │   ├── serializeintrin.h
    │   │       │   ├── sgxintrin.h
    │   │       │   ├── shaintrin.h
    │   │       │   ├── smmintrin.h
    │   │       │   ├── stdalign.h
    │   │       │   ├── stdarg.h
    │   │       │   ├── stdatomic.h
    │   │       │   ├── stdbool.h
    │   │       │   ├── stddef.h
    │   │       │   ├── stdint.h
    │   │       │   ├── stdnoreturn.h
    │   │       │   ├── tbmintrin.h
    │   │       │   ├── tgmath.h
    │   │       │   ├── tmmintrin.h
    │   │       │   ├── tsxldtrkintrin.h
    │   │       │   ├── uintrintrin.h
    │   │       │   ├── unwind.h
    │   │       │   ├── vadefs.h
    │   │       │   ├── vaesintrin.h
    │   │       │   ├── varargs.h
    │   │       │   ├── vecintrin.h
    │   │       │   ├── velintrin.h
    │   │       │   ├── velintrin_approx.h
    │   │       │   ├── velintrin_gen.h
    │   │       │   ├── vpclmulqdqintrin.h
    │   │       │   ├── waitpkgintrin.h
    │   │       │   ├── wasm_simd128.h
    │   │       │   ├── wbnoinvdintrin.h
    │   │       │   ├── wmmintrin.h
    │   │       │   ├── x86gprintrin.h
    │   │       │   ├── x86intrin.h
    │   │       │   ├── xmmintrin.h
    │   │       │   ├── xopintrin.h
    │   │       │   ├── xray
    │   │       │   │   ├── xray_interface.h
    │   │       │   │   ├── xray_log_interface.h
    │   │       │   │   └── xray_records.h
    │   │       │   ├── xsavecintrin.h
    │   │       │   ├── xsaveintrin.h
    │   │       │   ├── xsaveoptintrin.h
    │   │       │   ├── xsavesintrin.h
    │   │       │   └── xtestintrin.h
    │   │       ├── lib
    │   │       │   └── darwin
    │   │       │       ├── libclang_rt.asan_osx_dynamic.dylib
    │   │       │       ├── libclang_rt.cc_kext.a
    │   │       │       ├── libclang_rt.fuzzer_interceptors_osx.a
    │   │       │       ├── libclang_rt.fuzzer_no_main_osx.a
    │   │       │       ├── libclang_rt.fuzzer_osx.a
    │   │       │       ├── libclang_rt.lsan_osx_dynamic.dylib
    │   │       │       ├── libclang_rt.orc_osx.a
    │   │       │       ├── libclang_rt.osx.a
    │   │       │       ├── libclang_rt.profile_osx.a
    │   │       │       ├── libclang_rt.stats_client_osx.a
    │   │       │       ├── libclang_rt.stats_osx_dynamic.dylib
    │   │       │       ├── libclang_rt.tsan_osx_dynamic.dylib
    │   │       │       ├── libclang_rt.ubsan_minimal_osx.a
    │   │       │       ├── libclang_rt.ubsan_minimal_osx_dynamic.dylib
    │   │       │       ├── libclang_rt.ubsan_osx.a
    │   │       │       ├── libclang_rt.ubsan_osx_dynamic.dylib
    │   │       │       ├── libclang_rt.xray-basic_osx.a
    │   │       │       ├── libclang_rt.xray-fdr_osx.a
    │   │       │       ├── libclang_rt.xray-profiling_osx.a
    │   │       │       └── libclang_rt.xray_osx.a
    │   │       └── share
    │   │           ├── asan_ignorelist.txt
    │   │           └── cfi_ignorelist.txt
    │   ├── libIndexStore.dylib
    │   ├── libswiftDemangle.dylib
    │   ├── sourcekitd.framework
    │   │   ├── Headers -> Versions/Current/Headers
    │   │   ├── Modules -> Versions/Current/Modules
    │   │   ├── Resources -> Versions/Current/Resources
    │   │   ├── Versions
    │   │   │   ├── A
    │   │   │   │   ├── Headers
    │   │   │   │   │   └── sourcekitd.h
    │   │   │   │   ├── Modules
    │   │   │   │   │   └── module.modulemap
    │   │   │   │   ├── Resources
    │   │   │   │   │   └── Info.plist
    │   │   │   │   ├── XPCServices
    │   │   │   │   │   └── SourceKitService.xpc
    │   │   │   │   │       └── Contents
    │   │   │   │   │           ├── Info.plist
    │   │   │   │   │           └── MacOS
    │   │   │   │   │               └── SourceKitService
    │   │   │   │   ├── _CodeSignature
    │   │   │   │   │   └── CodeResources
    │   │   │   │   └── sourcekitd
    │   │   │   └── Current -> A
    │   │   ├── XPCServices -> Versions/Current/XPCServices
    │   │   └── sourcekitd -> Versions/Current/sourcekitd
    │   └── swift
    │       ├── FrameworkABIBaseline
    │       │   ├── README
    │       │   ├── Swift
    │       │   │   ├── ABI
    │       │   │   │   └── macos.json
    │       │   │   └── API
    │       │   │       └── macos.json
    │       │   ├── _Concurrency
    │       │   │   └── ABI
    │       │   │       └── macos.json
    │       │   └── nil.json
    │       ├── _InternalSwiftScan
    │       │   ├── DependencyScan.h
    │       │   ├── DependencyScanMacros.h
    │       │   └── module.modulemap
    │       ├── _InternalSwiftStaticMirror
    │       │   ├── BinaryScan.h
    │       │   ├── StaticMirrorMacros.h
    │       │   └── module.modulemap
    │       ├── apinotes
    │       │   ├── Dispatch.apinotes
    │       │   └── os.apinotes
    │       ├── clang -> ../clang/13.0.0
    │       ├── host
    │       │   ├── IDEUtils.swiftmodule
    │       │   │   ├── arm64-apple-macos.private.swiftinterface
    │       │   │   └── arm64-apple-macos.swiftinterface
    │       │   ├── SwiftBasicFormat.swiftmodule
    │       │   │   ├── arm64-apple-macos.private.swiftinterface
    │       │   │   └── arm64-apple-macos.swiftinterface
    │       │   ├── SwiftDiagnostics.swiftmodule
    │       │   │   ├── arm64-apple-macos.private.swiftinterface
    │       │   │   └── arm64-apple-macos.swiftinterface
    │       │   ├── SwiftOperators.swiftmodule
    │       │   │   ├── arm64-apple-macos.private.swiftinterface
    │       │   │   └── arm64-apple-macos.swiftinterface
    │       │   ├── SwiftParser.swiftmodule
    │       │   │   ├── arm64-apple-macos.private.swiftinterface
    │       │   │   └── arm64-apple-macos.swiftinterface
    │       │   ├── SwiftParserDiagnostics.swiftmodule
    │       │   │   ├── arm64-apple-macos.private.swiftinterface
    │       │   │   └── arm64-apple-macos.swiftinterface
    │       │   ├── SwiftSyntax.swiftmodule
    │       │   │   ├── arm64-apple-macos.private.swiftinterface
    │       │   │   └── arm64-apple-macos.swiftinterface
    │       │   ├── SwiftSyntaxBuilder.swiftmodule
    │       │   │   ├── arm64-apple-macos.private.swiftinterface
    │       │   │   └── arm64-apple-macos.swiftinterface
    │       │   ├── _SwiftSyntaxMacros.swiftmodule
    │       │   │   ├── arm64-apple-macos.private.swiftinterface
    │       │   │   └── arm64-apple-macos.swiftinterface
    │       │   ├── libIDEUtils.dylib
    │       │   ├── libSwiftBasicFormat.dylib
    │       │   ├── libSwiftDiagnostics.dylib
    │       │   ├── libSwiftOperators.dylib
    │       │   ├── libSwiftParser.dylib
    │       │   ├── libSwiftParserDiagnostics.dylib
    │       │   ├── libSwiftSyntax.dylib
    │       │   ├── libSwiftSyntaxBuilder.dylib
    │       │   └── lib_SwiftSyntaxMacros.dylib
    │       ├── macosx
    │       │   ├── ArgumentParser.swiftmodule
    │       │   │   ├── arm64-apple-macosx10.15.swiftdoc
    │       │   │   └── arm64-apple-macosx10.15.swiftmodule
    │       │   ├── SwiftDriver.swiftmodule
    │       │   │   ├── arm64-apple-macosx10.15.swiftdoc
    │       │   │   └── arm64-apple-macosx10.15.swiftmodule
    │       │   ├── SwiftOptions.swiftmodule
    │       │   │   ├── arm64-apple-macosx10.15.swiftdoc
    │       │   │   └── arm64-apple-macosx10.15.swiftmodule
    │       │   ├── SystemPackage.swiftmodule
    │       │   │   ├── arm64-apple-macosx10.15.swiftdoc
    │       │   │   └── arm64-apple-macosx10.15.swiftmodule
    │       │   ├── TSCBasic.swiftmodule
    │       │   │   ├── arm64-apple-macosx10.15.swiftdoc
    │       │   │   └── arm64-apple-macosx10.15.swiftmodule
    │       │   ├── TSCLibc.swiftmodule
    │       │   │   ├── arm64-apple-macosx10.15.swiftdoc
    │       │   │   └── arm64-apple-macosx10.15.swiftmodule
    │       │   ├── TSCUtility.swiftmodule
    │       │   │   ├── arm64-apple-macosx10.15.swiftdoc
    │       │   │   └── arm64-apple-macosx10.15.swiftmodule
    │       │   ├── libArgumentParser.dylib
    │       │   ├── libArgumentParserToolInfo.dylib
    │       │   ├── libSwiftDriver.dylib
    │       │   ├── libSwiftDriverExecution.dylib
    │       │   ├── libSwiftOptions.dylib
    │       │   ├── libSystemPackage.dylib
    │       │   ├── libTSCBasic.dylib
    │       │   ├── libTSCLibc.dylib
    │       │   ├── libTSCUtility.dylib
    │       │   ├── lib_InternalSwiftScan.dylib
    │       │   ├── lib_InternalSwiftStaticMirror.dylib
    │       │   ├── libllbuild.dylib
    │       │   ├── libllbuildSwift.dylib
    │       │   ├── libswiftCompatibility50.a
    │       │   ├── libswiftCompatibility51.a
    │       │   ├── libswiftCompatibility56.a
    │       │   ├── libswiftCompatibilityConcurrency.a
    │       │   ├── libswiftCompatibilityDynamicReplacements.a
    │       │   └── prebuilt-modules
    │       │       └── 12.3
    │       │           ├── ARKit.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-ios-macabi.swiftmodule
    │       │           ├── AVFoundation.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── Accelerate.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── Accessibility.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── AppKit.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── AppleArchive.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── AssetsLibrary.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-ios-macabi.swiftmodule
    │       │           ├── CallKit.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── CarPlay.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-ios-macabi.swiftmodule
    │       │           ├── CloudKit.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── Combine.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── Compression.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── Contacts.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── CoreAudio.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── CoreAudioKit.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-ios-macabi.swiftmodule
    │       │           ├── CoreData.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── CoreFoundation.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── CoreGraphics.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── CoreImage.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── CoreLocation.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── CoreMIDI.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── CoreML.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── CoreMedia.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── CoreMediaIO.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── CoreNFC.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-ios-macabi.swiftmodule
    │       │           ├── CreateML.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── CryptoKit.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── CryptoTokenKit.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── Darwin.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── DataDetection.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── DeveloperToolsSupport.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── DeviceActivity.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── Dispatch.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── FamilyControls.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-ios-macabi.swiftmodule
    │       │           ├── FileProvider.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── Foundation.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── GLKit.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── GameplayKit.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── GroupActivities.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── HealthKit.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-ios-macabi.swiftmodule
    │       │           ├── HomeKit.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-ios-macabi.swiftmodule
    │       │           ├── IOKit.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── Intents.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── MLCompute.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── ManagedSettings.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── ManagedSettingsUI.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-ios-macabi.swiftmodule
    │       │           ├── MapKit.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── MediaPlayer.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-ios-macabi.swiftmodule
    │       │           ├── Metal.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── MetalKit.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── MetricKit.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── ModelIO.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── MusicKit.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── NaturalLanguage.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── NearbyInteraction.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── Network.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── OSLog.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── ObjectiveC.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── OpenCL.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── PassKit.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── PencilKit.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── Photos.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── PhotosUI.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-ios-macabi.swiftmodule
    │       │           ├── QuartzCore.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── QuickLook.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-ios-macabi.swiftmodule
    │       │           ├── QuickLookUI.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── RealityFoundation.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── RealityKit.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── SafariServices.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── SceneKit.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── ShazamKit.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── SoundAnalysis.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── Speech.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── SpriteKit.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── StoreKit.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── Swift.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── SwiftOnoneSupport.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── SwiftUI.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── System.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── SystemVersion.plist
    │       │           ├── TabularData.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── UIKit.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-ios-macabi.swiftmodule
    │       │           ├── UniformTypeIdentifiers.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── Virtualization.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── Vision.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── WebKit.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── WidgetKit.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── XPC.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── _AVKit_SwiftUI.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── _AuthenticationServices_SwiftUI.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── _Concurrency.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── _CoreData_CloudKit.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── _CoreLocationUI_SwiftUI.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-ios-macabi.swiftmodule
    │       │           ├── _GroupActivities_AppKit.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── _GroupActivities_UIKit.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-ios-macabi.swiftmodule
    │       │           ├── _MapKit_SwiftUI.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── _MusicKit_SwiftUI.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── _QuickLook_SwiftUI.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── _SceneKit_SwiftUI.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── _SpriteKit_SwiftUI.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── _StoreKit_SwiftUI.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── _System_Foundation.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           ├── os.swiftmodule
    │       │           │   ├── arm64e-apple-ios-macabi.swiftmodule
    │       │           │   ├── arm64e-apple-macos.swiftmodule
    │       │           │   ├── x86_64-apple-ios-macabi.swiftmodule
    │       │           │   └── x86_64-apple-macos.swiftmodule
    │       │           └── simd.swiftmodule
    │       │               ├── arm64e-apple-ios-macabi.swiftmodule
    │       │               ├── arm64e-apple-macos.swiftmodule
    │       │               ├── x86_64-apple-ios-macabi.swiftmodule
    │       │               └── x86_64-apple-macos.swiftmodule
    │       ├── migrator
    │       │   ├── ios4.json
    │       │   ├── ios42.json
    │       │   ├── macos4.json
    │       │   ├── macos42.json
    │       │   ├── overlay4.json
    │       │   ├── overlay42.json
    │       │   ├── tvos4.json
    │       │   ├── tvos42.json
    │       │   ├── watchos4.json
    │       │   └── watchos42.json
    │       ├── pm
    │       │   ├── ManifestAPI
    │       │   │   ├── PackageDescription.swiftdoc
    │       │   │   ├── PackageDescription.swiftinterface
    │       │   │   └── libPackageDescription.dylib
    │       │   ├── PluginAPI
    │       │   │   ├── PackagePlugin.swiftdoc
    │       │   │   ├── PackagePlugin.swiftinterface
    │       │   │   └── libPackagePlugin.dylib
    │       │   └── llbuild
    │       │       ├── libllbuild.dylib
    │       │       └── libllbuildSwift.dylib
    │       ├── shims
    │       │   ├── AssertionReporting.h
    │       │   ├── CoreFoundationShims.h
    │       │   ├── FoundationShims.h
    │       │   ├── GlobalObjects.h
    │       │   ├── HeapObject.h
    │       │   ├── KeyPath.h
    │       │   ├── LibcOverlayShims.h
    │       │   ├── LibcShims.h
    │       │   ├── MetadataSections.h
    │       │   ├── Random.h
    │       │   ├── RefCount.h
    │       │   ├── Reflection.h
    │       │   ├── RuntimeShims.h
    │       │   ├── RuntimeStubs.h
    │       │   ├── SwiftStdbool.h
    │       │   ├── SwiftStddef.h
    │       │   ├── SwiftStdint.h
    │       │   ├── System.h
    │       │   ├── Target.h
    │       │   ├── ThreadLocalStorage.h
    │       │   ├── UnicodeData.h
    │       │   ├── Visibility.h
    │       │   ├── _SwiftConcurrency.h
    │       │   ├── _SwiftDistributed.h
    │       │   └── module.modulemap
    │       └── swiftToCxx
    │           ├── _SwiftCxxInteroperability.h
    │           ├── _SwiftStdlibCxxOverlay.h
    │           └── experimental-interoperability-version.json
    ├── libexec
    │   └── swift
    │       └── pm
    │           └── swiftpm-xctest-helper
    ├── local
    │   └── include
    │       └── indexstore
    │           ├── IndexStoreCXX.h
    │           └── indexstore.h
    └── share
        ├── clang
        │   └── features.json
        ├── doc
        │   └── swift
        │       └── diagnostics
        │           ├── complex-closure-inference.md
        │           ├── dynamic-callable-requirements.md
        │           ├── existential-member-access-limitations.md
        │           ├── multiple-inheritance.md
        │           ├── nominal-types.md
        │           ├── opaque-type-inference.md
        │           ├── property-wrapper-requirements.md
        │           ├── protocol-type-non-conformance.md
        │           ├── result-builder-methods.md
        │           ├── string-interpolation-conformance.md
        │           ├── temporary-pointers.md
        │           └── trailing-closure-matching.md
        ├── docc
        │   └── render
        │       ├── css
        │       │   ├── chunk-384ef189.7ede1ea3.css
        │       │   ├── documentation-topic.29351f99.css
        │       │   ├── documentation-topic~topic.fccbd76c.css
        │       │   ├── documentation-topic~topic~tutorials-overview.1099452b.css
        │       │   ├── index.d5b499b0.css
        │       │   ├── topic.726a35dc.css
        │       │   └── tutorials-overview.2a582c39.css
        │       ├── developer-og-twitter.jpg
        │       ├── developer-og.jpg
        │       ├── favicon.ico
        │       ├── favicon.svg
        │       ├── img
        │       │   ├── added-icon.d6f7e47d.svg
        │       │   ├── deprecated-icon.015b4f17.svg
        │       │   ├── modified-icon.f496e73d.svg
        │       │   └── no-image@2x.df2a0a50.png
        │       ├── index-template.html
        │       ├── index.html
        │       └── js
        │           ├── chunk-2d0d3105.cd72cc8e.js
        │           ├── chunk-384ef189.bb1ed903.js
        │           ├── chunk-vendors.b24b7aaa.js
        │           ├── documentation-topic.2ed269e3.js
        │           ├── documentation-topic~topic.95009191.js
        │           ├── documentation-topic~topic~tutorials-overview.5b27b87b.js
        │           ├── highlight-js-bash.1b52852f.js
        │           ├── highlight-js-c.d1db3f17.js
        │           ├── highlight-js-cpp.eaddddbe.js
        │           ├── highlight-js-css.75eab1fe.js
        │           ├── highlight-js-custom-markdown.7cffc4b3.js
        │           ├── highlight-js-custom-swift.5cda5c20.js
        │           ├── highlight-js-diff.62d66733.js
        │           ├── highlight-js-http.163e45b6.js
        │           ├── highlight-js-java.8326d9d8.js
        │           ├── highlight-js-javascript.acb8a8eb.js
        │           ├── highlight-js-json.471128d2.js
        │           ├── highlight-js-llvm.6100b125.js
        │           ├── highlight-js-markdown.90077643.js
        │           ├── highlight-js-objectivec.bcdf5156.js
        │           ├── highlight-js-perl.757d7b6f.js
        │           ├── highlight-js-php.cc8d6c27.js
        │           ├── highlight-js-python.c214ed92.js
        │           ├── highlight-js-ruby.f889d392.js
        │           ├── highlight-js-scss.62ee18da.js
        │           ├── highlight-js-shell.dd7f411f.js
        │           ├── highlight-js-swift.84f3e88c.js
        │           ├── highlight-js-xml.9c3688c7.js
        │           ├── index.7f587a2a.js
        │           ├── topic.bb695832.js
        │           └── tutorials-overview.2cadc732.js
        ├── emacs
        │   └── site-lisp
        │       └── swift-mode.el
        ├── man
        │   └── man1
        │       └── swift.1
        ├── swift
        │   ├── LICENSE.txt
        │   ├── compatibility-symbols
        │   ├── diagnostics
        │   │   ├── en.db
        │   │   └── en.strings
        │   └── features.json
        └── vim
            └── vim73
                ├── ftdetect
                │   ├── sil.vim
                │   ├── swift.vim
                │   └── swiftgyb.vim
                └── syntax
                    ├── sil.vim
                    ├── swift.vim
                    └── swiftgyb.vim

235 directories, 1183 files
finagolfin commented 1 year ago

lib/clang/13.0.0/ in that tree is the clang resource directory, so you want to link ln -sf /path/to/lib/clang/13.0.0/ /Users/fjtrujy/Projects/swiftCInterop/toolchain/swift-release-android-aarch64-24-sdk/usr/lib/swift/clang, just like I show on linux.

finagolfin commented 10 months ago

@fjtrujy, any luck yet?

finagolfin commented 9 months ago

@fjtrujy, homebrew just updated to Swift 5.9.2, so there's nothing stopping you using that with my latest SDK, after adding the required symbolic link as I said. I will close this soon if you are still not able to try it out.

SimpleApp commented 9 months ago

H @finagolfin : just to let you know : i followed your discussion, trying to build the swift-argument-parser project with "--build-tests" options from a mac M1 computer, and ended in the same state as @fjtrujy (the stderr.h not found error making it impossible to build 'CDispatch' module ). I fixed it adding a symbolic link to the clang/13.0 folder in the sdk/usr/lib/swift folder as you mentionned.

It looks like it's building everything fine, except i now have a super weird error in the source of the project itself that says :

CountLines.swift:62:46: error: value of type 'FileHandle' has no member 'bytes' let lineCount = try await fileHandle.bytes.lines.reduce(0) { count, line in

It's a bit late now so i'll have another look at it tomorrow. But just in case it's something stupid.

note : i also have a lot of those lines, which suggest something else may be wrong with my setup : warning: glibc not found for 'aarch64-unknown-linux-android24'; C stdlib may be unavailable

fjtrujy commented 9 months ago

@fjtrujy, homebrew just updated to Swift 5.9.2, so there's nothing stopping you using that with my latest SDK, after adding the required symbolic link as I said. I will close this soon if you are still not able to try it out.

I’m going to be a couple of weeks out, but once back I will try it for sure. Thanks

finagolfin commented 9 months ago

i now have a super weird error in the source of the project itself that says :

CountLines.swift:62:46: error: value of type 'FileHandle' has no member 'bytes' let lineCount = try await fileHandle.bytes.lines.reduce(0) { count, line in

Huh, I haven't seen that, and this package is cross-compiled for Android on my linux CI and tested regularly.

note : i also have a lot of those lines, which suggest something else may be wrong with my setup : warning: glibc not found for 'aarch64-unknown-linux-android24'; C stdlib may be unavailable

Yes, that means it couldn't find the Bionic libc headers. Make sure you're correctly passing in the path to those by checking your JSON config file for a line like this, "sdk": "/home/finagolfin/android-ndk-r26b/toolchains/llvm/prebuilt/darwin-x86_64/sysroot",.

SimpleApp commented 9 months ago

Following up on my experimentations :

i now have a super weird error in the source of the project itself that says :

CountLines.swift:62:46: error: value of type 'FileHandle' has no member 'bytes' let lineCount = try await fileHandle.bytes.lines.reduce(0) { count, line in

Huh, I haven't seen that, and this package is cross-compiled for Android on my linux CI and tested regularly.

I tried removing that paragraph to see if something else had a problem, and the code compiles fine, then stops at linking step with the error : ld.lld: error: --defsym:1: symbol not found: changelog_authors_main

note : i also have a lot of those lines, which suggest something else may be wrong with my setup : warning: glibc not found for 'aarch64-unknown-linux-android24'; C stdlib may be unavailable

Yes, that means it couldn't find the Bionic libc headers. Make sure you're correctly passing in the path to those by checking your JSON config file for a line like this, "sdk": "/home/finagolfin/android-ndk-r26b/toolchains/llvm/prebuilt/darwin-x86_64/sysroot",.

I did setup that line in my JSON config file. I used the NDK downloaded from android studio, but it doesn't look different from the one provided as a link in your README. What is this folder supposed to look like ?

Note : i also found a lot of this warning spread throughout the build log : warning: Could not read SDKSettings.json for SDK at: …ndk/26.2.11394342/toolchains/llvm/prebuilt/darwin-x86_64/sysroot

For reference here is my swiftpm-android-aarch64.json file :


  "version": 1,
  "target": "aarch64-unknown-linux-android24",
  "toolchain-bin-dir": "/Users/simpleapp/test/swift-5.9.2-RELEASE.xctoolchain/usr/bin",
  "sdk": "/Users/simpleapp/Library/Android/sdk/ndk/26.2.11394342/toolchains/llvm/prebuilt/darwin-x86_64/sysroot",
  "extra-cc-flags": [
    "-fPIC",
    "-I/Users/simpleapp/test/swift-5.9.2-android-24-sdk/usr/include"
  ],
  "extra-swiftc-flags": [
    "-resource-dir",
    "/Users/simpleapp/test/swift-5.9.2-android-24-sdk/usr/lib/swift",
    "-tools-directory",
    "/Users/simpleapp/Library/Android/sdk/ndk/26.2.11394342/toolchains/llvm/prebuilt/darwin-x86_64/bin",
    "-Xcc",
    "-I/Users/simpleapp/test/swift-5.9.2-android-24-sdk/usr/include",
    "-L/Users/simpleapp/test/swift-5.9.2-android-24-sdk/usr/lib/aarch64-linux-android"
  ],
  "extra-cpp-flags": [
    "-lstdc++"
  ]
}```
finagolfin commented 9 months ago

I tried removing that paragraph to see if something else had a problem, and the code compiles fine, then stops at linking step with the error : ld.lld: error: --defsym:1: symbol not found: changelog_authors_main

Huh, looks like that package recently added macOS-only targets in the wrong way, which broke cross-compilation from macOS. Can you comment out that last block too?

What is this folder supposed to look like ?

It's a normal sysroot, with two foldersusr/include/ and usr/lib/, containing the Android headers and libraries.

Note : i also found a lot of this warning spread throughout the build log : warning: Could not read SDKSettings.json for SDK at: …ndk/26.2.11394342/toolchains/llvm/prebuilt/darwin-x86_64/sysroot

That's fine, you will see that in my CI log too. Are you still seeing those glibc not found warnings you mentioned earlier?

For reference here is my swiftpm-android-aarch64.json file

Looks fine, but what Swift toolchain are you using? If it's the official Xcode toolchain and not the OSS Homebrew toolchain, that can cause problems.

SimpleApp commented 9 months ago

I tried removing that paragraph to see if something else had a problem, and the code compiles fine, then stops at linking step with the error : ld.lld: error: --defsym:1: symbol not found: changelog_authors_main

Huh, looks like that package recently added macOS-only targets in the wrong way, which broke cross-compilation from macOS. Can you comment out that last block too?

I commented the whole #if os(macOs) section at the bottom of Package@swift-5.8 and it compiles & link just fine. I'll now try to execute the whole thing on an android simulator and get back to you.

What is this folder supposed to look like ?

It's a normal sysroot, with two foldersusr/include/ and usr/lib/, containing the Android headers and libraries.

Then i really don't understand what's wrong. i tried setting up a bad folder and it creates an error (not just a warning) :

/Users/simpleapp/Library/Android/sdk/ndk/26.2.11394342/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/stdint.h:33:10: error: 'stddef.h' file not found
#include <stddef.h>
         ^
<unknown>:0: error: could not build C module 'CDispatch'
error: fatalError

So my guess is this warning is something different.

Note : i also found a lot of this warning spread throughout the build log : warning: Could not read SDKSettings.json for SDK at: …ndk/26.2.11394342/toolchains/llvm/prebuilt/darwin-x86_64/sysroot

That's fine, you will see that in my CI log too. Are you still seeing those glibc not found warnings you mentioned earlier?

Yes. Even when everything is compiling & linking just fine.

For reference here is my swiftpm-android-aarch64.json file

Looks fine, but what Swift toolchain are you using? If it's the official Xcode toolchain and not the OSS Homebrew toolchain, that can cause problems.

I switched to the homebrew toolchain just to try, but i don't think it makes a lot of difference. Once everything is working fine i'll try reverting to the xcode one just to make sure.

SimpleApp commented 9 months ago

Could it be a problem with the target arch ? I see that the content of the folder in : /Users/simpleapp/Library/Android/sdk/ndk/26.2.11394342/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib is

aarch64-linux-android   i686-linux-android  x86_64-linux-android
arm-linux-androideabi   riscv64-linux-android

Which seems a bit different from the "aarch64-unknown-linux-android24" name given in the swift json config file

finagolfin commented 9 months ago

i tried setting up a bad folder

Bad folder how, what did you change? The glibc warning is triggered if the Swift compiler can't find the Bionic libc headers in one of the C include paths it has. You can check what commands it is running by adding the -v verbose flag to swift build, then choose one of the swiftc commands and run it again manually with -Xcc -v, which gives more info including the header include paths it is looking in.

Could it be a problem with the target arch ?

No, the compiler knows how to translate the two, for example, the swiftmodule files in /Users/simpleapp/test/swift-5.9.2-android-24-sdk/usr/lib/swift/android/Glibc.swiftmodule/ also use a slightly different triple.

finagolfin commented 8 months ago

Closing since I addressed all questions and didn't receive a response. Now that github CI has a free macOS arm64 image, I will try building on there at some point, maybe even Windows too someday.

Feel free to report any further results or ask any more questions.