Merged
Conversation
This was referenced Feb 11, 2020
ghost
pushed a commit
that referenced
this pull request
Feb 17, 2020
Currently it supports only on-device builds. #4895 How to build: cp -a ./disabled-packages/swift ./packages/ pkg install clang binutils-gold file patch python cmake ninja python2 perl rsync libandroid-spawn libcurl libicu libsqlite libuuid libxml2 llbuild pkg-config TERMUX_MAKE_PROCESSES=7 ./build-package.sh swift
|
Moved to |
Member
Author
|
Thanks, I'll look into getting the compiler and stdlib cross-compiled next. |
This was referenced Feb 27, 2020
This pull request was closed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is for anyone who wants to try building the Swift 5.1.4 toolchain on an Android AArch64 device using the scripts in this repository. The following commands should do, you will need 5 GBs of free space and I estimate about an hour and a half with a Snapdragon 855:
Maybe one of the maintainers can build it and add the package to bintray.com. Getting all this cross-compiling from linux x86_64 like all the other Termux packages will require more work, since the Swift build scripts don't fully support building all this, other than cross-compiling the compiler and stdlib.
Most of these patches have been upstreamed and will be part of the upcoming 5.2 release next month. Only around 10 tests fail from the Swift compiler test suite of 10,000+ tests, with a couple more testing-related patches backported to this release. Where I used somebody else's patches from upstream, I included the full git commit info.
Once built, you can test it out by downloading a Swift package that has support for the Swift package manager and running
swift build. I have tried it on a couple Swift packages and it worked well, as long as the package didn't import a bunch of C headers, which can sometimes vary for Bionic,or you didn't need toIndexStore added now.--enable-test-discoverywhen runningswift test, which requiresInstall the resulting deb package with
dpkg -i debs/swift_5.1.4_aarch64.debto make uninstalling the compiler withpkg uninstall swifteasy later. I have not tried building with this pull on Android 7 or 8, let me know if you try it and that has any problems.