Thanks to visit codestin.com
Credit goes to github.com

Skip to content

make clean is not enough for out-of-source builds #110704

@antocuni

Description

@antocuni

Bug report

Bug description:

  1. First, do a regular in-tree build:
cpython $ ./configure && make
  1. Then, try to make an out-of-tree build:
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
  1. Now, if you try to run a top-level make clean as suggested, it's not enough:
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

(I also tried to cd .. && make clean).
The problem seems to be that check-clean-src checks for the presence of the ./python binary, which is not removed by make 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildThe build process and cross-buildtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions