Github messages for voidlinux
 help / color / mirror / Atom feed
* [ISSUE] Python configures broken symlinks for idle and 2to3
@ 2025-01-30 20:37 o-alquimista
  2025-01-31  5:41 ` Vinfall
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: o-alquimista @ 2025-01-30 20:37 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2150 bytes --]

New issue by o-alquimista on void-packages repository

https://github.com/void-linux/void-packages/issues/54154

Description:
### Is this a new report?

Yes

### System Info

Void 6.12.11_1 x86_64 GenuineIntel uptodate rrmFFFFF

### Package(s) Affected

python3-3.13.1_1

### Does a report exist for this bug with the project's home (upstream) and/or another distro?

_No response_

### Expected behaviour

The `python3` package [configures](https://github.com/void-linux/void-packages/blob/51a0af9fb8503ce42587340a704fabb897e74c69/srcpkgs/python3/template#L34), through the "alternatives" system, the executables `idle` and `2to3`:

```
$ xbps-alternatives --list
python
 - python3 (current)
  - idle:/usr/bin/idle3.13
  - 2to3:/usr/bin/2to3-3.13
  - pydoc:/usr/bin/pydoc3.13
  - python:/usr/bin/python3.13
  - python.1:/usr/share/man/man1/python3.13.1
```

This happens even if you don't have these tools installed:

```
$ idle
bash: idle: command not found
$ 2to3
bash: 2to3: command not found
$ ls -l /usr/bin/idle
lrwxrwxrwx 1 root root 8 Jan 29 18:53 /usr/bin/idle -> idle3.13
$ ls -l /usr/bin/2to3
lrwxrwxrwx 1 root root 9 Jan 29 18:53 /usr/bin/2to3 -> 2to3-3.13
```

This results in the creation of broken symlinks in your `PATH`, which generates [a lot of warnings](https://codeberg.org/dnkl/fuzzel/issues/467) when you run a program launcher like Fuzzel.

Fuzzel maintainer *dnkl* [told me](https://codeberg.org/dnkl/fuzzel/issues/467#issuecomment-2661610) there's nothing they can do to fix this on their end, and that this is a Void problem.

Since the alternatives system is responsible for creating the symlinks every time the package is updated, I need to figure out how to disable these symlinks:

```
  - idle:/usr/bin/idle3.13
  - 2to3:/usr/bin/2to3-3.13
```

I could also install these executables. While there is a package that provides IDLE (`idle-python3`), I could not find any package for `2to3` in the repository.

After reading the `xbps-alternatives` manpage and help info, it doesn't seem to be possible to change these specific entries. Any ideas on how to solve this?

### Actual behaviour

.

### Steps to reproduce

.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Python configures broken symlinks for idle and 2to3
  2025-01-30 20:37 [ISSUE] Python configures broken symlinks for idle and 2to3 o-alquimista
@ 2025-01-31  5:41 ` Vinfall
  2025-01-31  5:48 ` Vinfall
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Vinfall @ 2025-01-31  5:41 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1871 bytes --]

New comment by Vinfall on void-packages repository

https://github.com/void-linux/void-packages/issues/54154#issuecomment-2626352255

Comment:
This is placed in the wrong place:

https://github.com/void-linux/void-packages/blob/187f5547999daa2223e44af205527c4610ab6f30/srcpkgs/python3/template#L34-L36

`idle-python3` is just a symlink to `python3-tkinter`, but it has no alternatives set here. So actually `/usr/bin/idle` ALWAYS does NOT work, whether you have installed `python3` and `python3-tkinter`.

AFAIK 2to3 ~~is~~used to be a standard library, but is deprecated in Python3.11 and [removed in Python3.13](https://docs.python.org/3/whatsnew/3.13.html#to3), so maybe remove it and move idle to python3-tkinter? Did not test it myself:

```diff
diff --git a/srcpkgs/python3-tkinter/template b/srcpkgs/python3-tkinter/template
index 73cc637cd..650f271cb 100644
--- a/srcpkgs/python3-tkinter/template
+++ b/srcpkgs/python3-tkinter/template
@@ -30,6 +30,8 @@ license="Python-2.0"
 distfiles="https://www.python.org/ftp/python/${version%rc*}/Python-${version}.tar.xz"
 checksum=9cf9427bee9e2242e3877dd0f6b641c1853ca461f39d6503ce260a59c80bf0d9
 
+alternatives="python:idle:/usr/bin/idle${version%.*}"
+
 if [ "$XBPS_TARGET_LIBC" = "glibc" ]; then
        makedepends+=" libxcrypt-devel"
 fi
diff --git a/srcpkgs/python3/template b/srcpkgs/python3/template
index b4f2829f0..1b974c759 100644
--- a/srcpkgs/python3/template
+++ b/srcpkgs/python3/template
@@ -32,8 +32,6 @@ checksum="9cf9427bee9e2242e3877dd0f6b641c1853ca461f39d6503ce260a59c80bf0d9
 skip_extraction="${_bluez}.tar.xz"
 
 alternatives="
- python:idle:/usr/bin/idle${version%.*}
- python:2to3:/usr/bin/2to3-${version%.*}
  python:pydoc:/usr/bin/pydoc${version%.*}
  python:python:/usr/bin/python${version%.*}
  python:python.1:/usr/share/man/man1/python${version%.*}.1"
```


Can you confirm this? @ahesford 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Python configures broken symlinks for idle and 2to3
  2025-01-30 20:37 [ISSUE] Python configures broken symlinks for idle and 2to3 o-alquimista
  2025-01-31  5:41 ` Vinfall
@ 2025-01-31  5:48 ` Vinfall
  2025-01-31  5:48 ` Vinfall
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Vinfall @ 2025-01-31  5:48 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 410 bytes --]

New comment by Vinfall on void-packages repository

https://github.com/void-linux/void-packages/issues/54154#issuecomment-2626360035

Comment:
Temporary solution:
If you are lazy or don't know how to recompile python3 with the patch above, you can also just delete the broken symlink, although it would appear next time python3 is upgraded or when you run commands like `xbps-alternatives`/`xbps-reconfigure`.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Python configures broken symlinks for idle and 2to3
  2025-01-30 20:37 [ISSUE] Python configures broken symlinks for idle and 2to3 o-alquimista
  2025-01-31  5:41 ` Vinfall
  2025-01-31  5:48 ` Vinfall
@ 2025-01-31  5:48 ` Vinfall
  2025-01-31 11:48 ` ahesford
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Vinfall @ 2025-01-31  5:48 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 457 bytes --]

New comment by Vinfall on void-packages repository

https://github.com/void-linux/void-packages/issues/54154#issuecomment-2626360035

Comment:
Temporary solution:
If you are lazy or don't know how to recompile python3 with the patch above, you can also just delete the broken symlink, although it would appear next time python3 is upgraded or when you run commands like `xbps-alternatives`/`xbps-reconfigure`.

```sh
sudo rm /usr/bin/idle /usr/bin/2to3
```

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Python configures broken symlinks for idle and 2to3
  2025-01-30 20:37 [ISSUE] Python configures broken symlinks for idle and 2to3 o-alquimista
                   ` (2 preceding siblings ...)
  2025-01-31  5:48 ` Vinfall
@ 2025-01-31 11:48 ` ahesford
  2025-01-31 11:54 ` classabbyamp
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: ahesford @ 2025-01-31 11:48 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1161 bytes --]

New comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/issues/54154#issuecomment-2627018350

Comment:
We can certainly drop the dead `2to3` link.

Handling `idle` is a bit trickier. We can't just move the alternative to the subpackage without giving the new alternative a different name. That requires a corresponding change in `python2` to avoid conflicts, and a manual conflict with prior versions of `python2` (and `python<3`) to avoid conflicts with existing installations.

I suggest we just drop both symlinks from the alternative group and, rather than make a new group just for `idle`, we eliminate the uncredited symlink from `python2` altogether and add it unconditionally in `python3-tkinter`, which would still need the aforementioned conflicts. This means it is still possible to swap `python` back to `python2` with an alternative , but `idle` only ever points to the py3 version.

Eventually, we should drop the whole alternative group and force py2 users to use versioned executables exclusively. This probably breaks some ancient workflow and would merit an `INSTALL.msg` warning of the coming change.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Python configures broken symlinks for idle and 2to3
  2025-01-30 20:37 [ISSUE] Python configures broken symlinks for idle and 2to3 o-alquimista
                   ` (3 preceding siblings ...)
  2025-01-31 11:48 ` ahesford
@ 2025-01-31 11:54 ` classabbyamp
  2025-01-31 12:28 ` ahesford
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: classabbyamp @ 2025-01-31 11:54 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 212 bytes --]

New comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/issues/54154#issuecomment-2627031876

Comment:
is it necessary to split the python2 tkinter packages anymore? 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Python configures broken symlinks for idle and 2to3
  2025-01-30 20:37 [ISSUE] Python configures broken symlinks for idle and 2to3 o-alquimista
                   ` (4 preceding siblings ...)
  2025-01-31 11:54 ` classabbyamp
@ 2025-01-31 12:28 ` ahesford
  2025-02-09  3:58 ` [ISSUE] [CLOSED] " ahesford
  2025-02-09  3:58 ` ahesford
  7 siblings, 0 replies; 9+ messages in thread
From: ahesford @ 2025-01-31 12:28 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 219 bytes --]

New comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/issues/54154#issuecomment-2627122466

Comment:
Probably not. We can just have an omnibus py2 that omits the idle symlink.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [ISSUE] [CLOSED] Python configures broken symlinks for idle and 2to3
  2025-01-30 20:37 [ISSUE] Python configures broken symlinks for idle and 2to3 o-alquimista
                   ` (5 preceding siblings ...)
  2025-01-31 12:28 ` ahesford
@ 2025-02-09  3:58 ` ahesford
  2025-02-09  3:58 ` ahesford
  7 siblings, 0 replies; 9+ messages in thread
From: ahesford @ 2025-02-09  3:58 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2094 bytes --]

Closed issue by o-alquimista on void-packages repository

https://github.com/void-linux/void-packages/issues/54154

Description:
### Is this a new report?

Yes

### System Info

Void 6.12.11_1 x86_64 GenuineIntel uptodate rrmFFFFF

### Package(s) Affected

python3-3.13.1_1

### Does a report exist for this bug with the project's home (upstream) and/or another distro?

_No response_

### Description

The `python3` package [configures](https://github.com/void-linux/void-packages/blob/51a0af9fb8503ce42587340a704fabb897e74c69/srcpkgs/python3/template#L34), through the "alternatives" system, the executables `idle` and `2to3`:

```
$ xbps-alternatives --list
python
 - python3 (current)
  - idle:/usr/bin/idle3.13
  - 2to3:/usr/bin/2to3-3.13
  - pydoc:/usr/bin/pydoc3.13
  - python:/usr/bin/python3.13
  - python.1:/usr/share/man/man1/python3.13.1
```

This happens even if you don't have these tools installed:

```
$ idle
bash: idle: command not found
$ 2to3
bash: 2to3: command not found
$ ls -l /usr/bin/idle
lrwxrwxrwx 1 root root 8 Jan 29 18:53 /usr/bin/idle -> idle3.13
$ ls -l /usr/bin/2to3
lrwxrwxrwx 1 root root 9 Jan 29 18:53 /usr/bin/2to3 -> 2to3-3.13
```

This results in the creation of broken symlinks in your `PATH`, which generates [a lot of warnings](https://codeberg.org/dnkl/fuzzel/issues/467) when you run a program launcher like Fuzzel.

Fuzzel maintainer *dnkl* [told me](https://codeberg.org/dnkl/fuzzel/issues/467#issuecomment-2661610) there's nothing they can do to fix this on their end, and that this is a Void problem.

Since the alternatives system is responsible for creating the symlinks every time the package is updated, I need to figure out how to disable these symlinks:

```
  - idle:/usr/bin/idle3.13
  - 2to3:/usr/bin/2to3-3.13
```

I could also install these executables. While there is a package that provides IDLE (`idle-python3`), I could not find any package for `2to3` in the repository.

After reading the `xbps-alternatives` manpage and help info, it doesn't seem to be possible to change these specific entries. Any ideas on how to solve this?

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Python configures broken symlinks for idle and 2to3
  2025-01-30 20:37 [ISSUE] Python configures broken symlinks for idle and 2to3 o-alquimista
                   ` (6 preceding siblings ...)
  2025-02-09  3:58 ` [ISSUE] [CLOSED] " ahesford
@ 2025-02-09  3:58 ` ahesford
  7 siblings, 0 replies; 9+ messages in thread
From: ahesford @ 2025-02-09  3:58 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 195 bytes --]

New comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/issues/54154#issuecomment-2646055578

Comment:
Fixed in 766650b66d7235e0c4b7aec36ddb11882b68ad84.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2025-02-09  3:58 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-30 20:37 [ISSUE] Python configures broken symlinks for idle and 2to3 o-alquimista
2025-01-31  5:41 ` Vinfall
2025-01-31  5:48 ` Vinfall
2025-01-31  5:48 ` Vinfall
2025-01-31 11:48 ` ahesford
2025-01-31 11:54 ` classabbyamp
2025-01-31 12:28 ` ahesford
2025-02-09  3:58 ` [ISSUE] [CLOSED] " ahesford
2025-02-09  3:58 ` ahesford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).