gecko-dev/python/mozbuild
Nick Alexander 4161679514 Bug 1368699 - Write .purgecaches sentinels every |mach build|. r=gps
This adds a new `post_build` step to each `BuildBackend`
implementation, and uses it to write .purgecaches after every |mach
build| invocation -- including after |mach build TARGET| invocations.
This approach should be more robust than the existing recursive-Make
based solution, which seems to not write the .purgecaches files in
some situations.

In addition, the recursive-Make solution does not generalize to other
backends, in particular Tup.  It is possible that the Tup backend will
handle writing the .purgecaches sentinel as part of its regular build
process, but discussions with mshal suggest that there's no convenient
way for Tup to write .purgecaches only when something *changes* during
the build.  That is, Tup can achieve the behaviour implemented by this
patch, but it's not easier to do better by not writing .purgecaches
when the caches do not in fact need to be purged.

I elected to bake in the special knowledge of
--enable-application=browser and macOS here since this whole process
is special.  If we need to generalize, we could add a moz.configure
option specifying the purgecaches directories, but it doesn't seem
worth it right now.

The ideal approach would be to determine FINAL_TARGET from the
application directory, but that is determined by DIST_SUBDIR.  In
addition, it's not clear how to present that information to the
post-build step in a build-backend agnostic manner.

This will require tweaking as we migrate the macOS bundle handling to
moz.build, especially in browser/app.  See
https://bugzilla.mozilla.org/show_bug.cgi?id=1223748, which could
improve this significantly.

MozReview-Commit-ID: 63KZy18D23i

--HG--
extra : rebase_source : e973d065cd91e965f4103ed2732858e2e7a9c546
2018-01-31 09:25:12 -08:00
..
dumbmake Bug 1317970 - Use manifestparser manifests for python unit tests, r=chmanchester 2016-11-16 09:59:22 -05:00
mozbuild Bug 1368699 - Write .purgecaches sentinels every |mach build|. r=gps 2018-01-31 09:25:12 -08:00
mozpack Bug 1429815 - Fix InstallManifest::add_entries_from with non-trivial base. r=gps 2018-01-18 16:58:07 -08:00
setup.py
TODO