-
Couldn't load subscription status.
- Fork 712
Fix the Android CI workflow by adding a post-install step the configure the SDK #3424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
ee8fbc9
7932b35
d99b7dd
1636b5d
987b251
cb85a53
eea2e71
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,6 +25,7 @@ version="${INSTALL_SWIFT_VERSION:=""}" | |
| arch="${INSTALL_SWIFT_ARCH:="aarch64"}" | ||
| os_image="${INSTALL_SWIFT_OS_IMAGE:="ubuntu22.04"}" | ||
| sdk="${INSTALL_SWIFT_SDK:="static-sdk"}" | ||
| android_ndk_version="${INSTALL_ANDROID_NDK:="r27d"}" | ||
|
|
||
| if [[ ! ( -n "$branch" && -z "$version" ) && ! ( -z "$branch" && -n "$version") ]]; then | ||
| fatal "Exactly one of build or version must be defined." | ||
|
|
@@ -127,3 +128,20 @@ swift --version | |
|
|
||
| log "Installing Swift SDK" | ||
| swift sdk install "$sdk_path" | ||
|
|
||
| log "Swift SDK Post-install" | ||
| if [[ "$sdk" == "android-sdk" ]]; then | ||
| # guess some common places where the swift-sdks folder lives | ||
| cd ~/Library/org.swift.swiftpm || cd ~/.config/swiftpm || cd ~/.local/swiftpm || cd ~/.swiftpm || cd /root/.swiftpm || exit 1 | ||
|
|
||
| # download and link the NDK | ||
| android_ndk_url="https://dl.google.com/android/repository/android-ndk-${android_ndk_version}-$(uname -s).zip" | ||
| log "Android Native Development Kit URL: ${android_ndk_url}" | ||
| "$CURL_BIN" -fsSL -o ndk.zip --retry 3 "${android_ndk_url}" | ||
| unzip -q ndk.zip | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we parametrize this like we do with e.g. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suppose also the use of |
||
| rm ndk.zip | ||
| export ANDROID_NDK_HOME="${PWD}/android-ndk-${android_ndk_version}" | ||
| bundledir=$(find . -type d -maxdepth 2 -name '*android*.artifactbundle' | head -n 1) | ||
| "${bundledir}"/swift-android/scripts/setup-android-sdk.sh | ||
| cd - || exit | ||
| fi | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there no way we can know this ahead of time? We control the whole system here from a blank VM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we do need to exit here can we use
fataland explain what the issue is?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we actually need the
cdhere can we just refer to things using longer paths?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We change directories so that the NDK is downloaded adjacent to the artifactbundle, otherwise it is in the current folder, which seems like it might cause confusion and clutter.
The path search is unfortunately because the swiftpm configuration folder varies based on OS and configuration. I observed that for the swift-nio test run that it was
/root/.swiftpm/swift-sdks, but I'm not sure if that will always be the case.Note that we could do this and it would just work, plus it would allow us to avoid needing to change directories:
That's pretty gnarly, but let me know if you think it is preferable and I will implement it.