Skip to content

Conditional recipe build fixes #1382 #1401

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

Merged

Conversation

AndreMiras
Copy link
Member

This is a first iteration addressing recipes conditional build.
In this version all modified recipes are build in batch with no
dependency resolution whatsoever.
Also recipes are only built against python3crystax target and
sdl2 bootstrap.
The list of broken recipes is not fully known, but this script will help
finding out. If a recipe is known to be broken, it should be added in
the BROKEN_RECIPES set to be skipped until it gets fixed.

This is a first iteration addressing recipes conditional build.
In this version all modified recipes are build in batch with no
dependency resolution whatsoever.
Also recipes are only built against `python3crystax` target and
`sdl2` bootstrap.
The list of broken recipes is not fully known, but this script will help
finding out. If a recipe is known to be broken, it should be added in
the `BROKEN_RECIPES` set to be skipped until it gets fixed.
- COMMAND='. venv/bin/activate && cd testapps/ && python setup_testapp_python2.py apk --sdk-dir $ANDROID_SDK_HOME --ndk-dir $ANDROID_NDK_HOME --bootstrap sdl2 --requirements python2,numpy'
- COMMAND='. venv/bin/activate && cd testapps/ && python setup_testapp_python3.py apk --sdk-dir $ANDROID_SDK_HOME --ndk-dir $CRYSTAX_NDK_HOME --requirements python3crystax,setuptools,android,sdl2,pyjnius,kivy'
# builds only the recipes that moved
- COMMAND='. venv/bin/activate && ./ci/rebuild_updated_recipes.py'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's what really changed, the rest is refactoring

@@ -3,7 +3,7 @@

class BabelRecipe(PythonRecipe):
name = 'babel'
version = '2.1.1'
version = '2.2.0'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to demo the feature in the this pull request.
Basically babel was updated so it will be rebuild by the CI script.

@@ -3,6 +3,9 @@


class CffiRecipe(CompiledComponentsPythonRecipe):
"""
Extra system dependencies: autoconf, automake and libtool.
"""
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also demonstrate another feature, this recipe should be rebuilt by the script, however it will be skipped because it's currently known to be broken (see BROKEN_RECIPES global). It's a bit like a flake8 ignore list, once the recipe is fixed it should be removed from the list should never break again.

'six']
install_reqs = ['appdirs', 'colorama>=0.3.3', 'jinja2', 'six', 'enum34']
if os.name != 'nt':
install_reqs.append('sh>=1.10')
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well this has nothing to do with this pull request, but I saw this minor refactor and couldn't help, I had to fix it 😄
I can take it out of the PR if you guys prefer.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice I actually added enum34 I forgot about that and it breaks some recipes builds from Python3.6 e.g. pyjnuis

@AndreMiras
Copy link
Member Author

You can see it running here https://travis-ci.org/kivy/python-for-android/jobs/440200064
Basically in this build checking the raw log you can see what's happening from the debug output:

('recipes modified:', set([u'babel', u'cffi']))
('recipes to build:', set([u'babel']))
('requirements:', u'babel,python3crystax')

So it could detect that both babel and cffi recipes were modified, however only babel is getting compiled because cffi is in the list of known broken recipes.
Next we see the requirement list that is passed to the --requirements argument (babel,python3crystax), currently the script only build recipes on python3crystax target, but it's easy to make the loop to also check on python2. It's currently disabled, because I would prefer to address other issues first.
End of the log simply shows that everything was compiled fine at the end with a exit code of 0.

@AndreMiras AndreMiras merged commit ecd0bf6 into kivy:master Oct 11, 2018
@AndreMiras AndreMiras deleted the feature/ticket1382_conditional_builds branch October 12, 2018 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants