Issue 31934: Failure to build out of source from a not clean source (original) (raw)

Created on 2017-11-03 14:10 by xdegaye, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 4255 merged xdegaye,2017-11-03 14:24
PR 4340 merged xdegaye,2017-11-08 15:31
PR 4342 merged xdegaye,2017-11-08 15:52
Messages (12)
msg305486 - (view) Author: Xavier de Gaye (xdegaye) * (Python triager) Date: 2017-11-03 14:10
The error message when building out of a not clean source tree: renaming build/scripts-3.7/2to3 to build/scripts-3.7/2to3-3.7 renaming build/scripts-3.7/pyvenv to build/scripts-3.7/pyvenv-3.7 gcc -pthread -Xlinker -export-dynamic -o Programs/_testembed Programs/_testembed.o libpython3.7m.a -lpthread -ldl -lutil -lm gcc: error: Programs/_testembed.o: No such file or directory make[1]: *** [Makefile:707: Programs/_testembed] Error 1
msg305492 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2017-11-03 18:03
What's "unclean" in this case? I mean you can always re-run Make after making changes and the build succeeds, so I'm not quite sure what leads to this state.
msg305521 - (view) Author: Xavier de Gaye (xdegaye) * (Python triager) Date: 2017-11-03 23:11
When you build out of the source tree and this source tree has been built previously (by running 'make' in the source tree), then you get the error msg printed in when you try to build *out* of this not clean source tree. The solution is to run 'make clean' in the source tree first. The reason that one must use a clean source tree is that otherwise 'make' finds an existing Programs/_testembed.o file in the source tree as the prerequisite to the Programs/_testembed target, but cannot build this target since Programs/_testembed.o does not exist locally. It is not obvious from the error message to understand the reason for the build failure and one can waste quite some time finding the solution.
msg305524 - (view) Author: Xavier de Gaye (xdegaye) * (Python triager) Date: 2017-11-03 23:24
To build out of the 'src' source tree (a subdirectory of the current directory) in a 'build' subdirectory: $ ls -ld src drwxr-xr-x 21 xavier xavier 4.0K Nov 3 23:50 src/ $ mkdir build $ cd build $ $(cd ../src && pwd)/configure && make This is useful when you build for multiple platform configurations. For example on Android one can build for multiple API versions and multiple architectures (x86_64, armv7, aarch64, ...).
msg305655 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-11-06 16:51
Note for myself: Xavier proposed PR 4255 fix :-)
msg305853 - (view) Author: Xavier de Gaye (xdegaye) * (Python triager) Date: 2017-11-08 15:04
New changeset 0de92859caf25e65fc968d4bb68626e9ba21b851 by xdegaye in branch 'master': bpo-31934: Abort when building out of a not clean source tree (GH-4255) https://github.com/python/cpython/commit/0de92859caf25e65fc968d4bb68626e9ba21b851
msg305862 - (view) Author: Xavier de Gaye (xdegaye) * (Python triager) Date: 2017-11-08 15:54
New changeset 0c4785bf39b4e86dea3a70b651e5d5db2f2cf017 by xdegaye in branch '3.6': [3.6] bpo-31934: Abort when building out of a not clean source tree (GH-4255). (#4340) https://github.com/python/cpython/commit/0c4785bf39b4e86dea3a70b651e5d5db2f2cf017
msg305864 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-11-08 15:57
I tested manually the commit 0c4785bf39b4e86dea3a70b651e5d5db2f2cf017 merged into Python 3.6: it works as expected ;-)
msg305870 - (view) Author: Xavier de Gaye (xdegaye) * (Python triager) Date: 2017-11-08 16:01
I also tested the 2.7 and 3.6 PRs before submitting them. Thanks for testing and for your reviews Victor :-)
msg305871 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-11-08 16:02
> I also tested the 2.7 and 3.6 PRs before submitting them. Oh, I don't trust anyone, including myself :-) Since there is no automated, I chose to ("double") test manually your PRs.
msg305874 - (view) Author: Xavier de Gaye (xdegaye) * (Python triager) Date: 2017-11-08 16:05
Oh I understand, there is no practical way to test that feature except manually.
msg305875 - (view) Author: Xavier de Gaye (xdegaye) * (Python triager) Date: 2017-11-08 16:10
New changeset fbdd3eeba3e526e162f2eb54d224cf36ed8cfea1 by xdegaye in branch '2.7': [2.7] bpo-31934: Abort when building out of a not clean source tree (GH-4255). (#4342) https://github.com/python/cpython/commit/fbdd3eeba3e526e162f2eb54d224cf36ed8cfea1
History
Date User Action Args
2022-04-11 14:58:54 admin set github: 76115
2017-11-08 16:25:49 vstinner set status: open -> closedresolution: fixedstage: patch review -> resolved
2017-11-08 16:10:19 xdegaye set messages: +
2017-11-08 16:05:47 xdegaye set messages: +
2017-11-08 16:02:27 vstinner set messages: +
2017-11-08 16:01:07 xdegaye set messages: +
2017-11-08 15:57:35 vstinner set messages: +
2017-11-08 15:54:09 xdegaye set messages: +
2017-11-08 15:52:14 xdegaye set pull_requests: + <pull%5Frequest4298>
2017-11-08 15:31:21 xdegaye set pull_requests: + <pull%5Frequest4294>
2017-11-08 15:04:02 xdegaye set messages: +
2017-11-06 16:51:21 vstinner set nosy: + vstinnermessages: +
2017-11-03 23:24:09 xdegaye set messages: +
2017-11-03 23:11:14 xdegaye set messages: +
2017-11-03 18:03:02 brett.cannon set nosy: + brett.cannonmessages: +
2017-11-03 14:24:41 xdegaye set keywords: + patchstage: patch reviewpull_requests: + <pull%5Frequest4217>
2017-11-03 14:10:57 xdegaye create