-
Notifications
You must be signed in to change notification settings - Fork 41
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
Fix android builds requiring external (cgo) linking, but cgo is not enabled #56
Fix android builds requiring external (cgo) linking, but cgo is not enabled #56
Conversation
Extension authors will now need to opt-in to building for android targets. When opted-in to building on android, extension authors will also be required to define at least the Android SDK build-tools version. If opted-in to building for android targets, we will attempt to build assuming Go 1.22 or newer. Previous action versions will be required to build for android using Go 1.22 and older.
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.
👍🏻 This would help my use. I have no need of android builds in the first place.
In fact, I'd love it if you could opt-in or opt-out of all the platforms. I only need one.
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.
These changes look good, however I think there's more we need to do here before merging it especially since this will be a breaking change (@v2
)
Add heading to readme for customizing the build process for Go extensions that refers users to "extensions written in other compiled languages" section. This removes duplicating information that is the same for either case.
Slim down the action input description. Lean on the readme to document this in more depth instead.
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.
99% there! everything is looking good with minor suggestions on docs; let me know if you feels strongly and let's knock this out today
Co-authored-by: Andy Feller <[email protected]>
Thank you @andyfeller 🙏 I have committed your suggestions and it's ready for another review pass ✨ |
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.
Sincere thanks for unblocking our Go extension developer community while putting significant efforts to verifying these changes within Android simulator ✨
After merging this PR, I believe the only things that remain are:
-
Tagging the repo with
v2.0.0
tag + release, which will cause our GitHub Actions to create thev2
branch; for more info, see below -
Updating the release notes within the
v2
release to explain the breaking change and how users will get more information to adopt the latest changes
gh-extension-precompile/.github/workflows/release.yml
Lines 11 to 21 in ee3e4e5
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Update major release branch | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
tag="${GITHUB_REF#refs/tags/}" | |
major=${tag%%.*} | |
gh api -X PATCH /repos/"$GITHUB_REPOSITORY"/git/refs/heads/"$major" -f sha="$GITHUB_SHA" |
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.
Seems to work
Picks up fix for cli/gh-extension-precompile#56
Fixes #50
This PR proposes:
gh-extension-precompile
versions.gh
core.gh-extension-precompile
to avoid this new logic.release_android
android_sdk_version
android_ndk_home
gh-extension-precompile
.Building on Android and change details
We will set
CGO_ENABLED=1
andCC=${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android${ANDROID_SDK_VERSION}-clang
for Android architectures, if bothrelease_android
andandroid_sdk_version
action inputs are provided. Ifrelease_android
is enabled butandroid_sdk_version
is not set, the action will fail.The
android_ndk_home
action input is used if theANDROID_NDK_HOME
environment variable is not set. The$ANDROID_NDK_HOME
environment variable will be set automatically on GitHub hosted runners.When
release_android
is not set, the action will not attempt to build for Android targets, avoiding the Android specific requirements completely - this is the proposed default behavior.I just want my extension to continue building for Android - what should I do?
Along with bumping the action version, modify your workflow that calls
gh-extension-precompile
to include at leastrelease_android
andandroid_sdk_version
.Example:
If you are running the workflow on a self-hosted runner, you should confirm that either the
ANDROID_NDK_HOME
environment variable is set or that you provide theandroid_ndk_home
action input.Testing
Build and release no android [email protected]
Build and release with android [email protected]