-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Introduces pythonforandroid/prerequisites.py (Experimental). This allows a more granular check and install process for dependencies on both CI jobs and users installation. #2591
Conversation
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.
That works for me if we prefer it that way.
One thing I liked about installing it manually was that in a way it documented how to reproduce it from the command line in macOS.
Say that I didn't have a macOS laptop, but I was testing things on a VM 😏
https://github.com/AndreMiras/VagrantBoxes/tree/master/osx-sierra
Then this can be useful because you can up your VM and run the same script
Considering that improving the setup process and docs should be a priority, I got your point and I agree. I will try to investigate an approach that works for both the Currently, during the CI run we're installing the JDK via Just thinking out loud: I imagine that a "prerequisites lookup and install script" that inspects the user / CI runner environment and asks to perform the prerequisites installations may avoid installing an un-needed JDK version for both the users and CI runners? |
Oh right I see thanks for sharing more context. |
54c7a30
to
0847b9c
Compare
…ows a more granular check and install process for dependencies on both CI jobs and users installation.
0847b9c
to
0de9354
Compare
efd6260
to
72e9720
Compare
@AndreMiras I may have found a valid solution, which will allow what we just talked about. Let me know your thoughts. 😄 |
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.
Thanks for giving it a though and providing an implementation.
Looks good to me, that's probably enough for a start.
In future post merge iteration we may want to:
- set the JDK version from a single place
- cover the change via tests
- document the feature for user interested to use it
Yeah, absolutely. I've scheduled a major docs review for Instead, tests will inevitably land in the next related PR, as (now that I can have a clearer idea of which are the needs) I will switch to a TDD approach for the next prerequisites. |
✂️ (partially) from #2586
Instead of installing the JDK frombrew
, we can useactions/setup-java@v3
which correctly handles theJAVA_HOME
asmacos-latest
environment comes with multiple versions of the JDK pre-installed.On our self-hosted runner, the download viaactions/setup-java@v3
seems to be correctly handled (see runs on #2586)During a discussion with @AndreMiras (See below), I decided to propose a different approach for the prerequisites check and related installations, which will allow more granular control over prerequisites, which may lead to potential (unnoticed) issues.
This PR:
Introduces
pythonforandroid/prerequisites.py
(Experimental as it doesn't support all thepython-for-android
prerequisites)Allows handling prerequisites in the same way on
Github Action
and on the developer machine.PYTHONFORANDROID_PREREQUISITES_INSTALL_INTERACTIVE=0
disables the interactivity (which is enabled by default) of the prerequisiteinstall
section.Even if
check_and_install_default_prerequisites()
is called when the toolchain is invoked, ATM we should keep aInstall prerequisites via pythonforandroid/prerequisites.py (Experimental)
step, asinstall_android_ndk_sdk
needs a valid Java installation. This will be changed in future.This will allow, when completed, to simplify the onboarding process of a new
python-for-android
/buildozer
user, aspython-for-android
is expected to run all the checks and (eventually) the needed installations. Lowering the "first-customer" entry barriers will mean fewer support tickets and increasing theKivy
ecosystem fan base 😄 ."Check, even multiple times before installing anything" approach. As an example,
JDKPrerequisite
is checking the availability of a validJDK
over multiple places, installing a new one should be a last resort, and an installation should be done only if the user consents.As a working example, #2586 has been updated to use this approach.
ubuntu-latest
, doesn't have any rule (yet) so just ignores it.macos-latest
have a valid JDK pre-installed, but is not the default one.JDKPrerequisite
notices it and setsJAVA_HOME
to the valid JDK path.apple-silicon-m1
doesn't have a valid JDK installed.JDKPrerequisite
notices it and downloads+installsOpenJDK17U-jdk_aarch64_mac_hotspot_17.0.2_8
, allowing the CI run to complete.