-
Notifications
You must be signed in to change notification settings - Fork 55
Fix android builds requiring external (cgo) linking, but cgo is not enabled #56
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
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.
CleanCut
left a comment
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.
andyfeller
left a comment
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.
andyfeller
left a comment
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 <andyfeller@github.com>
|
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.0tag + release, which will cause our GitHub Actions to create thev2branch; for more info, see below -
Updating the release notes within the
v2release 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" |
Cinderella252
left a comment
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-precompileversions.ghcore.gh-extension-precompileto avoid this new logic.release_androidandroid_sdk_versionandroid_ndk_homegh-extension-precompile.Building on Android and change details
We will set
CGO_ENABLED=1andCC=${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android${ANDROID_SDK_VERSION}-clangfor Android architectures, if bothrelease_androidandandroid_sdk_versionaction inputs are provided. Ifrelease_androidis enabled butandroid_sdk_versionis not set, the action will fail.The
android_ndk_homeaction input is used if theANDROID_NDK_HOMEenvironment variable is not set. The$ANDROID_NDK_HOMEenvironment variable will be set automatically on GitHub hosted runners.When
release_androidis 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-precompileto include at leastrelease_androidandandroid_sdk_version.Example:
If you are running the workflow on a self-hosted runner, you should confirm that either the
ANDROID_NDK_HOMEenvironment variable is set or that you provide theandroid_ndk_homeaction input.Testing
Build and release no android Go@1.22
Build and release with android Go@1.22