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
--enable-optimizations makes common build commands always need to compile from scratch #73429
Comments
In 3.6 we get --enable-optimizations. One thing I find annoyed with this flag is that it makes some build commands compile from scratch since it always clears the environment first. For example, with the commands listed at the top of Makefile: ./configure It compiles 3 times and considering the optimized build needs more time every time, it lasts long. I am not sure this is a problem and feel free to close it. |
Since optimizations uses PGO which should do a fresh run, that's why there's the clearing of the state. I'm personally not bothered by it as you really should only being doing an optimized build once when you do the first install and then you're done. But if or anyone else can come up with a way to not clear out the results while not accidentally using stale PGO-collected stats or builds then I don't see why we can't speed it up. |
That's why I want to enable only --with-lto |
Another complaint from bpo-29889. |
I've opened a PR#1478 that I believe fixes the issue. |
I closed my issue bpo-29641 as a duplicate of this one. |
So now we have to run make if we want to trigger the profile procedure since other make commands like make test won't trigger the procedure by itself, right? |
Xiang Zhang added the comment:
I don't think that the patch changes the behaviour of "make": it only To be honest, I don't know if Makefile knows when a rebuild is needed |
I don't mean "make" is changed. I mean the latter. Before, a single "make test" or "make install" will do all things for you, including the profile procedure. Now they seems not. You have to run "make" before them to trigger the profile procedure. Actually I am quite okay with this change. But don't know others. |
Yes, this appears true. I'm okay with it because I've always considered the make, test, and install as different command invocations. The package building automation I am aware of tends to do the same. Our buildbots keep the steps separate. But we need document this requirement somewhere. I think if we wanted test and install to accurately figure out if they need to redo the profile build and profiling run, we'd need make to detect that _any_ of its possible profile build+run input files are more recent than the last profiling run. ugh. |
Oh wait, I expected that "make test" would build Python with PGO, but it doesn't anymore. Would it be possible to change the Makefile to make sure that "make python" (on Linux, "make python.exe" on macOS) would build Python using PGO? I tried to hack something, but I'm lost in dependencies... "make profile-opt" runs "$(MAKE) build_all_generate_profile" which runs "$(MAKE) build_all CFLAGS_NODIST=..." and build_all depends on "$(BUILDPYTHON)". I'm not sure that it's possible to make everything automatic because of the high number of targets and dependencies. To be honest, I'm not excited by ./configure --enable-optimizations. I was happy with an explicit "make profile-opt". |
In addition, profile-opt would have to rewritten to test whether there's It's maybe too radical, but we could change it so that if you run |
To be honest, I'm not excited by ./configure --enable-optimizations. I was happy with an explicit "make profile-opt". The configure flag was added because not everything can be enabled just in the Makefile and so that people have a single flag to set to turn on any and all optimizations that work consistently across OSs (it used to be LTO+PGO until we discovered how universally broken LTO seems to be). |
Is the issue done? Can it be closed? |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: