Skip to content

Commit 58a6bfb

Browse files
authored
[build][Android] Skip building Swift Syntax into the compiler (#68895)
The community CI doesn't have a prebuilt Swift compiler right now, so this unbreaks the build on there. Also, update the doc with the latest working LTS NDK and trunk snapshot.
1 parent e3b3b47 commit 58a6bfb

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

docs/Android.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ To follow along with this guide, you'll need:
3636
instructions in the Swift project README.
3737
2. The latest build of the Swift compiler for your Linux distro, available at
3838
https://www.swift.org/download/ or sometimes your distro package manager.
39-
3. The latest version of the Android LTS NDK (r25b at the time of this writing),
39+
3. The latest version of the Android LTS NDK (r25c at the time of this writing),
4040
available to download here:
4141
https://developer.android.com/ndk/downloads
4242
4. An Android device with remote debugging enabled or the emulator. We require
@@ -54,9 +54,9 @@ and the prebuilt Swift toolchain (add --skip-early-swift-driver if you already
5454
have a Swift toolchain in your path):
5555

5656
```
57-
$ NDK_PATH=path/to/android-ndk-r25b
58-
$ SWIFT_PATH=path/to/swift-DEVELOPMENT-SNAPSHOT-2022-05-31-a-ubuntu20.04/usr/bin
59-
$ git checkout swift-DEVELOPMENT-SNAPSHOT-2022-05-31-a
57+
$ NDK_PATH=path/to/android-ndk-r25c
58+
$ SWIFT_PATH=path/to/swift-DEVELOPMENT-SNAPSHOT-2023-09-30-a-ubuntu20.04/usr/bin
59+
$ git checkout swift-DEVELOPMENT-SNAPSHOT-2023-09-30-a
6060
$ utils/build-script \
6161
-R \ # Build in ReleaseAssert mode.
6262
--android \ # Build for Android.
@@ -83,8 +83,8 @@ Then use the standalone Swift stdlib from the previous step to compile a Swift
8383
source file, targeting Android:
8484

8585
```
86-
$ NDK_PATH="path/to/android-ndk-r25b"
87-
$ SWIFT_PATH=path/to/swift-DEVELOPMENT-SNAPSHOT-2022-05-31-a-ubuntu20.04/usr/bin
86+
$ NDK_PATH="path/to/android-ndk-r25c"
87+
$ SWIFT_PATH=path/to/swift-DEVELOPMENT-SNAPSHOT-2023-09-30-a-ubuntu20.04/usr/bin
8888
$ $SWIFT_PATH/swiftc \ # The prebuilt Swift compiler you downloaded
8989
# The location of the tools used to build Android binaries
9090
-tools-directory ${NDK_PATH}/toolchains/llvm/prebuilt/linux-x86_64/bin/ \
@@ -133,7 +133,7 @@ $ adb push build/Ninja-ReleaseAssert/swift-linux-x86_64/lib/swift/android/libBlo
133133
In addition, you'll also need to copy the Android NDK's libc++:
134134

135135
```
136-
$ adb push /path/to/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android/libc++_shared.so /data/local/tmp
136+
$ adb push /path/to/android-ndk-r25c/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android/libc++_shared.so /data/local/tmp
137137
```
138138

139139
Finally, you'll need to copy the `hello` executable you built in the
@@ -176,7 +176,7 @@ $ utils/build-script \
176176
-R \ # Build in ReleaseAssert mode.
177177
-T \ # Run all tests, including on the Android device (add --host-test to only run Android tests on the Linux host).
178178
--android \ # Build for Android.
179-
--android-ndk ~/android-ndk-r25b \ # Path to an Android NDK.
179+
--android-ndk ~/android-ndk-r25c \ # Path to an Android NDK.
180180
--android-arch aarch64 \ # Optionally specify Android architecture, alternately armv7
181181
--android-api-level 21
182182
```

utils/build-presets.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -992,6 +992,7 @@ install-swiftsyntax
992992

993993
skip-test-linux
994994
skip-build-benchmarks
995+
skip-early-swiftsyntax
995996

996997
reconfigure
997998

0 commit comments

Comments
 (0)