Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
FS#80231 - [rustup][cuda] /etc/profile.d/*.sh adds duplicate entry in PATH
Attached to Project:
Arch Linux
Opened by env (ENV25) - Saturday, 11 November 2023, 10:37 GMT
Last edited by Sven-Hendrik Haase (Svenstaro) - Tuesday, 14 November 2023, 01:13 GMT
Opened by env (ENV25) - Saturday, 11 November 2023, 10:37 GMT
Last edited by Sven-Hendrik Haase (Svenstaro) - Tuesday, 14 November 2023, 01:13 GMT
|
DetailsDescription:
In a modern system the scripts in `/etc/profile.d/` are run multiple times. For example, once by the login manager sddm, and again by the virtual terminal konsole. If `/etc/profile.d/*.sh` scripts use something like `export PATH=$PATH:/usr/lib/rustup/bin` to append to $PATH, this causes duplicate entries to appear in PATH. This is why `/etc/profile` has the function `append_path`. The above example should be `append_path "/usr/lib/rustup/bin"`. Additional info: * package version(s) plan9port 20230331-1 rustup 1.26.0-3 plan9port and rustup are the only affected packages I found in my system. If you have access to every package in Arch Linux, the following script should help find affected packages. ``` for file in *.pkg.tar.zst; do bsdtar xvfO "$file" etc/profile.d/ | tr '\0' '\n'; done 2>&1 | grep -v -E '^bsdtar:' | grep -E '^x|\$\{?PATH' ``` |
This task depends upon
Closed by Sven-Hendrik Haase (Svenstaro)
Tuesday, 14 November 2023, 01:13 GMT
Reason for closing: Fixed
Tuesday, 14 November 2023, 01:13 GMT
Reason for closing: Fixed
Not always. An optimally configured system won't see this issue i.e. one that doesn't unnecessarily spawn login shells.
> For example, once by the login manager sddm, and again by the virtual terminal konsole.
I just tried this right now in a fresh Plasma VM. When opening multiple konsole windows there is *no* duplication (at least with my shell config).
But yeah, using append_path is probably better. There are things like "tmux" that like to spawn a login shell by default. Related
FS#66339It seems wezterm starts a login shell by default for some reason. I am not sure if that is the correct behavior. The following config seems to fix it:
```
config.default_prog = { os.getenv("SHELL") }
```