Travis-CI compiles twice
Hi,
I've noticed that Travis-CI (sometimes?) compiles CPython twice. Example in https://travis-ci.org/python/cpython/jobs/256552880
First compilation in the "./configure && make" step: https://travis-ci.org/python/cpython/jobs/256552880#L1103
Second compilation in "make buildbottest" step: https://travis-ci.org/python/cpython/jobs/256552880#L1622
This probably loses a minute or two.
Regards
Antoine.
If you look at the exact commands it's configure, make, and then make regen-all clinic. My guess is that last command is touching files in such a way that the make bulidbottest is causing make to rebuild some files.
On Sun, Jul 23, 2017, 02:39 Antoine Pitrou, <antoine@python.org> wrote:
Hi,
I've noticed that Travis-CI (sometimes?) compiles CPython twice. Example in https://travis-ci.org/python/cpython/jobs/256552880
First compilation in the "./configure && make" step: https://travis-ci.org/python/cpython/jobs/256552880#L1103
Second compilation in "make buildbottest" step: https://travis-ci.org/python/cpython/jobs/256552880#L1622
This probably loses a minute or two.
Regards
Antoine.
python-committers mailing list python-committers@python.org https://mail.python.org/mailman/listinfo/python-committers Code of Conduct: https://www.python.org/psf/codeofconduct/
23.07.17 19:04, Brett Cannon пише:
If you look at the exact commands it's configure, make, and then make regen-all clinic. My guess is that last command is touching files in such a way that the make bulidbottest is causing make to rebuild some files.
make regen-all
touches header files which are dependencies for all
binaries. I suggest to run make regen-all
before make
.
The more complex way is making all generating scripts generating new content in memory and don't touching the output files if their content matches the generated content.
IMHO everything is fine and we don't have to do anything ;-)
Antoine:
I've noticed that Travis-CI (sometimes?) compiles CPython twice.
"make regen-all" doesn't compiles Python:
- it compiles Parser/pgen
- it compiles Programs/_freeze_importlib
- it runs many commands to regenerate generated files
2017-07-24 9:37 GMT+02:00 Serhiy Storchaka <storchaka@gmail.com>:
make regen-all
touches header files which are dependencies for all binaries. I suggest to runmake regen-all
beforemake
.
Zachary Ware explained me once that "make regen-all" should be run after "make", but I don't recall why :-)
Travis CI makes sure that "make regen-all" doesn't modify generated files (or the build fails), so if we would run "make" a second time after "make regen-all", it would be supposed to do nothing.
Victor
Le 24/07/2017 à 10:55, Victor Stinner a écrit :
IMHO everything is fine and we don't have to do anything ;-)
What do you mean? The fact that all the CPython source code (including C extensions) is compiled twice looks suboptimal to me. We could probably win a minute or two on Travis-CI build times.
Regards
Antoine.
I read again the read and I misunderstood it. I didn't notice that "make buildbottest" recompiles Python. Ok, I confirm the bug.
I see two options:
- move the "make regen-all" check *before* "make"
- move the "make regen-all" check in a different Travis CI. If we move the test in a GCC job, it would allow to check regen and GCC warnings in the same job.
Victor
2017-07-24 12:16 GMT+02:00 Antoine Pitrou <antoine@python.org>:
Le 24/07/2017 à 10:55, Victor Stinner a écrit :
IMHO everything is fine and we don't have to do anything ;-)
What do you mean? The fact that all the CPython source code (including C extensions) is compiled twice looks suboptimal to me. We could probably win a minute or two on Travis-CI build times.
Regards
Antoine.
python-committers mailing list python-committers@python.org https://mail.python.org/mailman/listinfo/python-committers Code of Conduct: https://www.python.org/psf/codeofconduct/
On 24 July 2017 at 18:55, Victor Stinner <victor.stinner@gmail.com> wrote:
2017-07-24 9:37 GMT+02:00 Serhiy Storchaka <storchaka@gmail.com>:
make regen-all
touches header files which are dependencies for all binaries. I suggest to runmake regen-all
beforemake
.Zachary Ware explained me once that "make regen-all" should be run after "make", but I don't recall why :-)
Some of the generators (including Argument Clinic) are themselves written in Python, so building the checked in version first is the only way to be 100% sure you have a compatible version available.
As Serhiy notes, the robust fix is to make sure the generators leave the file modification times unchanged if they don't actually change anything, either by working entirely in memory and only writing the result back out if it changed, or by generating out-of-place and then doing either a rename (if the result changed), or deleting the new one (if it is the same as the original).
Cheers, Nick.
-- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia
Technically, "make regen-all" doesn't use the freshly built Python. It uses PYTHON_FOR_REGEN which is usually "python3".
Victor
2017-07-24 15:48 GMT+02:00 Nick Coghlan <ncoghlan@gmail.com>:
On 24 July 2017 at 18:55, Victor Stinner <victor.stinner@gmail.com> wrote:
2017-07-24 9:37 GMT+02:00 Serhiy Storchaka <storchaka@gmail.com>:
make regen-all
touches header files which are dependencies for all binaries. I suggest to runmake regen-all
beforemake
.Zachary Ware explained me once that "make regen-all" should be run after "make", but I don't recall why :-)
Some of the generators (including Argument Clinic) are themselves written in Python, so building the checked in version first is the only way to be 100% sure you have a compatible version available.
As Serhiy notes, the robust fix is to make sure the generators leave the file modification times unchanged if they don't actually change anything, either by working entirely in memory and only writing the result back out if it changed, or by generating out-of-place and then doing either a rename (if the result changed), or deleting the new one (if it is the same as the original).
Cheers, Nick.
-- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia
On Mon, Jul 24, 2017 at 3:55 AM, Victor Stinner <victor.stinner@gmail.com> wrote:
Zachary Ware explained me once that "make regen-all" should be run after "make", but I don't recall why :-)
The real kicker is make clinic
, which fails unless done after make all
. I'd be all in favor of fixing that (and adding clinic
to
regen-all
), but if that turns into a bigger-than-expected project I
also like Victor's idea of doing make regen-all clinic
in a separate
GCC job.
-- Zach
participants (6)
-
Antoine Pitrou
-
Brett Cannon
-
Nick Coghlan
-
Serhiy Storchaka
-
Victor Stinner
-
Zachary Ware