cpython $ ./configure && make
cpython $ mkdir debug
cpython $ cd debug
cpython/debug $ ../configure --with-pydebug && make
[...]
Error: The source directory (..) is not clean
Building Python out of the source tree (in /home/antocuni/pypy/misc/cpython/debug) requires a clean source tree (/home/antocuni/pypy/misc/cpython/debug/..)
Try to run: make -C ".." clean
cpytohn/debug $ make -C ".." clean
[...]
cpython/debug $ make
Error: The source directory (..) is not clean
Building Python out of the source tree (in /home/antocuni/pypy/misc/cpython/debug) requires a clean source tree (/home/antocuni/pypy/misc/cpython/debug/..)
Try to run: make -C ".." clean
Bug report
Bug description:
make cleanas suggested, it's not enough:(I also tried to
cd .. && make clean).The problem seems to be that
check-clean-srcchecks for the presence of the./pythonbinary, which is not removed bymake clean:https://github.com/python/cpython/blob/982f1b7d6dc2f13b9607ce092e36e32972e3702c/debug/Makefile#L773-L785
If I remove it manually, the out-of-tree make works as expected
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Linked PRs
distcleantarget overcleanwhen source tree is not clean #112610distcleantarget overcleanwhen source tree is not clean (GH-112610) #150342distcleantarget overcleanwhen source tree is not clean (GH-112610) #150343distcleantarget overcleanwhen source tree is not clean (GH-112610) #150344