Skip to content

gh-110704: Recommend distclean target over clean when source tree is not clean#112610

Merged
gpshead merged 2 commits into
python:mainfrom
SnoopJ:bugfix/gh110704-recommend-distclean-target
May 24, 2026
Merged

gh-110704: Recommend distclean target over clean when source tree is not clean#112610
gpshead merged 2 commits into
python:mainfrom
SnoopJ:bugfix/gh110704-recommend-distclean-target

Conversation

@SnoopJ
Copy link
Copy Markdown
Contributor

@SnoopJ SnoopJ commented Dec 1, 2023

Closes #110704

This changeset recommends using the distclean target over the clean target when the clean source tree check fails, as the latter does not remove files that will reliably fail the check if they are present (python$(BUILDEXE) in particular). The clobber target might work just as well, but distclean seems like the more user-legible change here.

Discovered while trying to run the build script introduced by #112473, I have not previously run into this problem before, but it had my scratching my head for a couple of minutes before I looked at the check target and realized the report was misleading me.

This change seems niche enough not to require a NEWS entry but I'm happy to write one if a maintainer disagrees.

@SnoopJ SnoopJ changed the title gh-112473: Recommend distclean target over clean when source tree is not clean gh-110704: Recommend distclean target over clean when source tree is not clean Dec 1, 2023
@github-actions
Copy link
Copy Markdown

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label Apr 14, 2026
@serhiy-storchaka
Copy link
Copy Markdown
Member

@gpshead, you made changes in that line. Could you please review this change?

@gpshead gpshead added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes labels May 24, 2026
@gpshead
Copy link
Copy Markdown
Member

gpshead commented May 24, 2026

@gpshead, you made changes in that line. Could you please review this change?

that was 103c4ea.

regardless, using distclean is still needed in this situation. updated & set to merge.

@gpshead gpshead enabled auto-merge (squash) May 24, 2026 13:09
@gpshead gpshead self-assigned this May 24, 2026
@gpshead gpshead merged commit 3463105 into python:main May 24, 2026
49 checks passed
@miss-islington-app
Copy link
Copy Markdown

Thanks @SnoopJ for the PR, and @gpshead for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15.
🐍🍒⛏🤖

@bedevere-app
Copy link
Copy Markdown

bedevere-app Bot commented May 24, 2026

GH-150342 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label May 24, 2026
@bedevere-app
Copy link
Copy Markdown

bedevere-app Bot commented May 24, 2026

GH-150343 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label May 24, 2026
@bedevere-app
Copy link
Copy Markdown

bedevere-app Bot commented May 24, 2026

GH-150344 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 bugs and security fixes label May 24, 2026
@SnoopJ SnoopJ deleted the bugfix/gh110704-recommend-distclean-target branch May 24, 2026 15:41
gpshead added a commit that referenced this pull request May 24, 2026
…ce tree is not clean (GH-112610) (#150342)

gh-110704: Recommend `distclean` target over `clean` when source tree is not clean (GH-112610)

Recommend `distclean` target over `clean` when source tree is not clean
(cherry picked from commit 3463105)

Co-authored-by: James <6125322+SnoopJ@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
gpshead added a commit that referenced this pull request May 24, 2026
…ce tree is not clean (GH-112610) (#150343)

gh-110704: Recommend `distclean` target over `clean` when source tree is not clean (GH-112610)

Recommend `distclean` target over `clean` when source tree is not clean
(cherry picked from commit 3463105)

Co-authored-by: James <6125322+SnoopJ@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
gpshead added a commit that referenced this pull request May 24, 2026
…ce tree is not clean (GH-112610) (#150344)

gh-110704: Recommend `distclean` target over `clean` when source tree is not clean (GH-112610)

Recommend `distclean` target over `clean` when source tree is not clean
(cherry picked from commit 3463105)

Co-authored-by: James <6125322+SnoopJ@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
@bedevere-bot
Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot ARM64 macOS 3.15 (tier-2) has failed when building commit d02c2df.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/2118/builds/96) and take a look at the build logs.
  4. Check if the failure is related to this commit (d02c2df) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/2118/builds/96

Failed tests:

  • test_ssl

Failed subtests:

  • test_trampoline_works - test.test_perf_profiler.TestPerfTrampoline.test_trampoline_works
  • test_sock_client_connect_racing - test.test_asyncio.test_sock_lowlevel.PollEventLoopTests.test_sock_client_connect_racing
  • test_sys_api - test.test_perf_profiler.TestPerfTrampoline.test_sys_api

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/Users/buildbot/buildarea/3.15.pablogsal-macos-m1.macos-with-brew/build/Lib/test/test_asyncio/test_sock_lowlevel.py", line 280, in test_sock_client_connect_racing
    self.loop.run_until_complete(asyncio.wait_for(
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
        self._basetest_sock_connect_racing(listener, sock), 10))
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/buildarea/3.15.pablogsal-macos-m1.macos-with-brew/build/Lib/asyncio/base_events.py", line 724, in run_until_complete
    return future.result()
           ~~~~~~~~~~~~~^^
  File "/Users/buildbot/buildarea/3.15.pablogsal-macos-m1.macos-with-brew/build/Lib/asyncio/tasks.py", line 487, in wait_for
    async with timeouts.timeout(timeout):
               ~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/Users/buildbot/buildarea/3.15.pablogsal-macos-m1.macos-with-brew/build/Lib/asyncio/timeouts.py", line 114, in __aexit__
    raise TimeoutError from exc_val
TimeoutError


Traceback (most recent call last):
  File "/Users/buildbot/buildarea/3.15.pablogsal-macos-m1.macos-with-brew/build/Lib/test/test_perf_profiler.py", line 81, in test_trampoline_works
    perf_file_contents = perf_file.read_text()
  File "/Users/buildbot/buildarea/3.15.pablogsal-macos-m1.macos-with-brew/build/Lib/pathlib/__init__.py", line 986, in read_text
    with self.open(mode='r', encoding=encoding, errors=errors, newline=newline) as f:
         ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/buildarea/3.15.pablogsal-macos-m1.macos-with-brew/build/Lib/pathlib/__init__.py", line 970, in open
    return io.open(self, mode, buffering, encoding, errors, newline)
           ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied: '/tmp/perf-7910.map'


Traceback (most recent call last):
  File "/Users/buildbot/buildarea/3.15.pablogsal-macos-m1.macos-with-brew/build/Lib/asyncio/tasks.py", line 488, in wait_for
    return await fut
           ^^^^^^^^^
  File "/Users/buildbot/buildarea/3.15.pablogsal-macos-m1.macos-with-brew/build/Lib/test/test_asyncio/test_sock_lowlevel.py", line 244, in _basetest_sock_connect_racing
    await self.loop.sock_connect(sock, addr)
  File "/Users/buildbot/buildarea/3.15.pablogsal-macos-m1.macos-with-brew/build/Lib/asyncio/selector_events.py", line 648, in sock_connect
    return await fut
           ^^^^^^^^^
asyncio.exceptions.CancelledError


Traceback (most recent call last):
  File "/Users/buildbot/buildarea/3.15.pablogsal-macos-m1.macos-with-brew/build/Lib/test/test_perf_profiler.py", line 260, in test_sys_api
    perf_file_contents = perf_file.read_text()
  File "/Users/buildbot/buildarea/3.15.pablogsal-macos-m1.macos-with-brew/build/Lib/pathlib/__init__.py", line 986, in read_text
    with self.open(mode='r', encoding=encoding, errors=errors, newline=newline) as f:
         ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/buildarea/3.15.pablogsal-macos-m1.macos-with-brew/build/Lib/pathlib/__init__.py", line 970, in open
    return io.open(self, mode, buffering, encoding, errors, newline)
           ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied: '/tmp/perf-7902.map'

@bedevere-bot
Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot ARM64 macOS 3.14 (tier-2) has failed when building commit 229447a.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1772/builds/1084) and take a look at the build logs.
  4. Check if the failure is related to this commit (229447a) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/1772/builds/1084

Failed tests:

  • test.test_asyncio.test_sock_lowlevel
  • test_ssl

Failed subtests:

  • test_sock_client_connect_racing - test.test_asyncio.test_sock_lowlevel.PollEventLoopTests.test_sock_client_connect_racing

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/Users/buildbot/buildarea/3.14.pablogsal-macos-m1.macos-with-brew/build/Lib/test/test_asyncio/test_sock_lowlevel.py", line 280, in test_sock_client_connect_racing
    self.loop.run_until_complete(asyncio.wait_for(
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
        self._basetest_sock_connect_racing(listener, sock), 10))
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/buildarea/3.14.pablogsal-macos-m1.macos-with-brew/build/Lib/asyncio/base_events.py", line 719, in run_until_complete
    return future.result()
           ~~~~~~~~~~~~~^^
  File "/Users/buildbot/buildarea/3.14.pablogsal-macos-m1.macos-with-brew/build/Lib/asyncio/tasks.py", line 487, in wait_for
    async with timeouts.timeout(timeout):
               ~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/Users/buildbot/buildarea/3.14.pablogsal-macos-m1.macos-with-brew/build/Lib/asyncio/timeouts.py", line 114, in __aexit__
    raise TimeoutError from exc_val
TimeoutError


Traceback (most recent call last):
  File "/Users/buildbot/buildarea/3.14.pablogsal-macos-m1.macos-with-brew/build/Lib/asyncio/tasks.py", line 488, in wait_for
    return await fut
           ^^^^^^^^^
  File "/Users/buildbot/buildarea/3.14.pablogsal-macos-m1.macos-with-brew/build/Lib/test/test_asyncio/test_sock_lowlevel.py", line 244, in _basetest_sock_connect_racing
    await self.loop.sock_connect(sock, addr)
  File "/Users/buildbot/buildarea/3.14.pablogsal-macos-m1.macos-with-brew/build/Lib/asyncio/selector_events.py", line 645, in sock_connect
    return await fut
           ^^^^^^^^^
asyncio.exceptions.CancelledError

@bedevere-bot
Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot ARM64 macOS 3.13 (tier-2) has failed when building commit 80c422d.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1404/builds/1658) and take a look at the build logs.
  4. Check if the failure is related to this commit (80c422d) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/1404/builds/1658

Failed tests:

  • test_ssl

Summary of the results of the build (if available):

==

Click to see traceback logs
remote: Enumerating objects: 3, done.        
remote: Counting objects:  50% (1/2)        
remote: Counting objects: 100% (2/2)        
remote: Counting objects: 100% (2/2), done.        
remote: Compressing objects:  50% (1/2)        
remote: Compressing objects: 100% (2/2)        
remote: Compressing objects: 100% (2/2), done.        
remote: Total 3 (delta 0), reused 1 (delta 0), pack-reused 1 (from 1)        
From https://github.com/python/cpython
 * branch                    3.13       -> FETCH_HEAD
Note: switching to '80c422d442520495199338de762b2e8a736dc4a1'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 80c422d4425 [3.13] gh-110704: Recommend `distclean` target over `clean` when source tree is not clean (GH-112610) (#150344)
Switched to and reset branch '3.13'

./Modules/selectmodule.c:1988:35: warning: cast from 'PyObject *(*)(PyObject *)' (aka 'struct _object *(*)(struct _object *)') to 'PyCFunction' (aka 'struct _object *(*)(struct _object *, struct _object *)') converts to incompatible function type [-Wcast-function-type-mismatch]
 1988 |     "kqueue_tracking_after_fork", (PyCFunction)kqueue_tracking_after_fork,
      |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
ranlib: warning: 'libpython3.13d.a(brc.o)' has no symbols
ranlib: warning: 'libpython3.13d.a(dynamic_annotations.o)' has no symbols
ranlib: warning: 'libpython3.13d.a(gc_free_threading.o)' has no symbols
ranlib: warning: 'libpython3.13d.a(jit.o)' has no symbols
ranlib: warning: 'libpython3.13d.a(optimizer.o)' has no symbols
ranlib: warning: 'libpython3.13d.a(optimizer_analysis.o)' has no symbols
ranlib: warning: 'libpython3.13d.a(optimizer_symbols.o)' has no symbols
ranlib: warning: 'libpython3.13d.a(pymath.o)' has no symbols
ranlib: warning: 'libpython3.13d.a(perf_jit_trampoline.o)' has no symbols

make: *** [buildbottest] Error 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news stale Stale PR or inactive for long period of time.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

4 participants