-
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
[WIP] Enhance distribution check when reusing distributions and... #1926
Conversation
Thanks @opacam, I have no immediate objection but I won't have time to look at this properly until at least next week. |
I actually support the idea of forcing clean builds, and adding mechanisms to speed up build in general instead. E.g. separate distribution-independent download caching, promoting the use of ccache more which works fine, and other such stuff. The build just seems too complex to be worth caching if you throw in external packages that may have new releases, change in deps, and other things of the (outside) world changing. So my vote would be to drop all the ways to recognize a distribution as same or different, and just make a fresh one for each build unconditionally (and throw it away right after each build unless some Edit/Additional point: people also often get tripped over when they change |
continue | ||
for recipe in recipes: | ||
if recipe not in dist.recipes: | ||
checked_dist_recipes = set() |
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.
same here for string literals {}
which by the way is slightly faster in Python (because set
would require alias resolution), but who cares 😄
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.
Nevermind ref #1926 (comment)
Thanks @opacam
So we can later check if the dist was created with an different `android api`
Because we already set it in `Context`
So in case that we detect a mismatched value, we will not use that dist. Note: also removed unneeded duplicated check
So we can later check if the dist was created with an old version of p4a
And in case that we detect a mismatch version we will force to delete all the previous build folders to start from scratch Note: In case that we want to export a created dist we will omit the removal, unless we need to rebuild the dist.
This way, we can later check if any recipe has been updated, so we can rebuild it if necessary
And in case that we detect a mismatch version we will force to delete the old build so it can be rebuild
1947491
to
5a2eba4
Compare
So we avoid to overwrite them when arch changes (which is probably what we want)
Now that we reuse the dists as expected, we should be clear about when we reuse a dist or when we build a new one...otherwise we will get confusing messages in our build logs
To avoid conflicts when we reuse a dist with a different arch. The same name convention used for standard recipe builds has been used, but contemplating all the ctx.archs (because ndk builds are supposed to support multi arch builds). So an bootstrap build folder would look like as: - armeabi-v7a_arm64-v8a__ndk_target_21 - arm64-v8a__ndk_target_21 ...
when we detect an updated python recipe, so we make sure that the new one is built and installed. Note: this will remove all the python's site packages...maybe is not the best solution but it will do the job for now...
In case that we detect that the recipe it's a library recipe
So...if we make a new distribution, we will be able to reuse the already built libraries
5a2eba4
to
e563dfe
Compare
Just noting here since I mentioned it on #1716 - I think I'd like to propose some simplifications to this PR before we merge it. In the meantime I'm working on a simpler change to support multiple arch builds for the same dist name, just to make sure this annoyance is resolved in the next release (which I'll make as soon as this change is added). |
I close this for several reasons:
But, I will create a new set of PRs to deal with the problems we have when reusing distributions, which...I hope...it will be easier/faster to review 😉 ¡¡Thanks all for your feedback in here!! 😄 |
...Skip some unneeded rebuilds
The main reason to do this, it's because we usually have to deal with issues related with old cached builds as well as the reuse of a distributions it seems to not work as expected, so this PR is intended to deal with this.
Things made in here:
ndk-build clean
which it seems to remove all bootstrap builds and libraries regarding that which recipe we are targeting...:thinking:...I suppose it's fine for now (it simplifies a little the thing)Implement(removed commit since it's already done at Fix build for case-insensitive FS and add CI test for OSX #1951)GuestPythonRecipe.should_build
so we can skip python rebuildpython-installs
directory (yeah, it's a little drastic this point but it would do the job and simplifies the code)Things to consider...I may forgot something in here:
we never remove recipe's generates libraries fromlibs_collection
when we detected a changed recipe (we only remove the build directory...so this may cause some troubles in case thatRecipe.should_build
checks for the library into that folder)...mmmCloses: #1920 and #1917
I leave this
WIP
because:reverse
order)