This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Build Python outside the source directory
Type: Stage:
Components: Build Versions: Python 3.3
process
Status: closed Resolution: works for me
Dependencies: Superseder:
Assigned To: Nosy List: eric.araujo, loewis, neologix, pitrou, python-dev, rpetrov, vstinner
Priority: normal Keywords: patch

Created on 2011-10-12 12:06 by vstinner, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
build.patch vstinner, 2011-10-12 12:06 review
Messages (7)
msg145392 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2011-10-12 12:06
It is no more possible to build Python outside its source directory. Try using:

cd <python sources directory>
mkdir release
cd release
../configure
make

Attached patch should fix this issue.
msg145425 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-10-12 20:14
New changeset 1811c4e5527f by Victor Stinner in branch 'default':
Issue #13157: Fix building Python outside its source tree
http://hg.python.org/cpython/rev/1811c4e5527f
msg145434 - (view) Author: Roumen Petrov (rpetrov) * Date: 2011-10-12 21:36
Which is platform with broken VPATH support and/or make ?
msg145436 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2011-10-12 22:01
> Which is platform with broken VPATH support and/or make ?

Well, my commit is maybe useless...

I tried to have two builds at the same time:

- debug in Python source code (e.g. ~/python)
- release in a subdirectory in the Python source code (e.g. ~/python/release)

If I compile in debug mode before building in release mode, the build of the release mode fails because make finds some objects in source tree (and so think that it doesn't need to build them).

I tried to avoid completly VPATH to support this use case, but I'm not sure that it is possible (at least, it doesn't work: it fails to build pgen in the release).
msg145440 - (view) Author: Roumen Petrov (rpetrov) * Date: 2011-10-12 22:33
I wonder why you are not stopped by:
configure: error: source directory already configured; run "make distclean" there first.
(for sure you remove some files but not all)

Applied patch is save but I cannot understand what actually is resolved.
Note that someone already report as bug(?) attempt to build outside when first project is compiled in source.
msg145529 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-10-14 15:15
Building outside of the source directory was supported, if the source directory was clean.  In practice, the source directory could be unclean as long as a few files were not there (Parser/*.o, Modules/_testembed), so it was quite annoying.  If the patch allows people to build inside the source directory and in other directories without cleaning, I’m +1!
msg178897 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2013-01-03 02:04
I don't have this issue anymore (but I also don't build Python outside the source directory anymore), I already applied my patch, so I consider that the issue can be closed. If someone has a similar problem, it's maybe better to open a new issue.
History
Date User Action Args
2022-04-11 14:57:22adminsetgithub: 57366
2021-04-28 21:15:37iritkatriellinkissue18125 superseder
2013-01-03 02:04:49vstinnersetstatus: open -> closed
resolution: works for me
messages: + msg178897
2011-10-14 15:15:27eric.araujosetnosy: + eric.araujo
messages: + msg145529
2011-10-12 22:33:39rpetrovsetmessages: + msg145440
2011-10-12 22:01:35vstinnersetmessages: + msg145436
2011-10-12 21:36:07rpetrovsetnosy: + rpetrov
messages: + msg145434
2011-10-12 20:14:17python-devsetnosy: + python-dev
messages: + msg145425
2011-10-12 12:06:11vstinnersetcomponents: + Build
2011-10-12 12:06:06vstinnercreate