Skip to content

Commit 054ca78

Browse files
committed
1 parent 6f79e4c commit 054ca78

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

swift-ci/sdks/android/scripts/build.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,22 @@ header "Swift Android SDK build script"
208208
swift_dir=$(realpath $(dirname "$swiftc")/..)
209209
HOST=linux-x86_64
210210
#HOST=$(uname -s -m | tr '[:upper:]' '[:lower:]' | tr ' ' '-')
211+
212+
# in a Docker container, the pre-installed NDK is read-only,
213+
# but the build script needs to write to it to work around
214+
# https://github.com/swiftlang/swift-driver/pull/1822
215+
# so we copy it to a read-write location for the purposes of the build
216+
# this can all be removed once that PR lands
217+
mkdir -p ${build_dir}/ndk/
218+
ndk_home_tmp=${build_dir}/ndk/$(basename $ndk_home)
219+
cp -a $ndk_home $ndk_home_tmp
220+
ndk_home=$ndk_home_tmp
221+
211222
ndk_installation=$ndk_home/toolchains/llvm/prebuilt/$HOST
212223

213224
# ANDROID_NDK env needed by the swift-android.patch for:
214225
# call ln -sf "${SWIFT_BUILD_PATH}/lib/swift" "${ANDROID_NDK}/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib"
226+
export ANDROID_NDK_HOME=$ndk_home
215227
export ANDROID_NDK=$ndk_home
216228

217229
echo "Swift found at ${swift_dir}"

0 commit comments

Comments
 (0)