dev/cleanup-mounts-under doesn't look python3.13

0 views
Skip to first unread message

Greg Troxel

unread,
Dec 28, 2025, 6:46:11 PM (4 days ago) 12/28/25
to bup-...@googlegroups.com
There's a hardcoded list. pkgsrc's approach to python instability is to
expect everything that uses python to bind to a specific version, so
there's no 'python' and no 'python3', as both are unsound late binding.

The fix is to add 3.14 and 3.13. I'm surprised to see 3.6 still.

(I'd be in favor of dropping python3 and python, to make this problem
more obvious sooner.)



#!/bin/sh
"""": # -*-python-*-
# This command is used by "make clean", so don't rely on ./configure
set -e
for python in \
python3 \
python3.12 \
python3.11 \
python3.10 \
python3.9 \
python3.8 \
python3.7 \
python3.6 \
python; \
do \
if command -v "$python"; then
exec "$python" "$0" "$@"
fi
done
echo "error: unable to find suitable python executable; please report" 1>&2
exit 2
"""

Rob Browning

unread,
Dec 28, 2025, 7:56:06 PM (4 days ago) 12/28/25
to Greg Troxel, bup-...@googlegroups.com
Greg Troxel <g...@lexort.com> writes:

> There's a hardcoded list. pkgsrc's approach to python instability is to
> expect everything that uses python to bind to a specific version, so
> there's no 'python' and no 'python3', as both are unsound late binding.
>
> The fix is to add 3.14 and 3.13. I'm surprised to see 3.6 still.

This script is intentionally very generous since it should and is
intended to work with "most any python", and it starts with python3
because https://peps.python.org/pep-0394/ says that python3 should be
expected to work.

No worries if pkgsrc doesn't follow that PEP, but I suspect many systems
do.

Thanks
--
Rob Browning
rlb @defaultvalue.org and @debian.org
GPG as of 2011-07-10 E6A9 DA3C C9FD 1FF8 C676 D2C4 C0F0 39E9 ED1B 597A
GPG as of 2002-11-03 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4

Greg Troxel

unread,
Dec 28, 2025, 8:11:29 PM (4 days ago) 12/28/25
to Rob Browning, bup-...@googlegroups.com
Rob Browning <r...@defaultvalue.org> writes:

> Greg Troxel <g...@lexort.com> writes:
>
>> There's a hardcoded list. pkgsrc's approach to python instability is to
>> expect everything that uses python to bind to a specific version, so
>> there's no 'python' and no 'python3', as both are unsound late binding.
>>
>> The fix is to add 3.14 and 3.13. I'm surprised to see 3.6 still.
>
> This script is intentionally very generous since it should and is
> intended to work with "most any python", and it starts with python3
> because https://peps.python.org/pep-0394/ says that python3 should be
> expected to work.
>
> No worries if pkgsrc doesn't follow that PEP, but I suspect many systems
> do.

Sure - PEP 0394 is a difference of opinion :-) and I expect many do.

Having python3 present means things use it, and then when python3
changes where it points, you get UB in anything using it because the set
of installed modules changes compared to what was probed when it was
built. pkgsrc will install that symlink if you have "pkg_alternatives"
installed, but I don't on that box, and some people object to these
symlinks. (There are vast numbers of packages that need newer and that
can't use newer so we end up with multiple versions installed usually.
That's messy, but python compat isn't good enough to avoid it.)

As for old versions, I see the point but if bup has a documented
"python3 >= x" then I'd align this.

Are you amenable to adding 3.14 and 3.13 - should I send a diff or is it
just easier for you to do that?

Rob Browning

unread,
Dec 29, 2025, 1:01:13 PM (3 days ago) 12/29/25
to Greg Troxel, bup-...@googlegroups.com
Greg Troxel <g...@lexort.com> writes:

> As for old versions, I see the point but if bup has a documented
> "python3 >= x" then I'd align this.

Perhaps, but this (dev-only tool) needs to run for *any* make clean,
even before configure has run, or even if configure is in a broken
state, so I wanted it to be very resilient.

Previously it could cause make clean to crash, which then required some
flavor of manual intervention to fix. I also didn't feel like trying to
write it in (ba)sh at the time.

> Are you amenable to adding 3.14 and 3.13 - should I send a diff or is it
> just easier for you to do that?

Already did in a tree here.
Reply all
Reply to author
Forward
0 new messages