You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Modules does not properly remove path starting with ~ when unloading a module #597
changed the title [-]In fedora 42 from WSL the modules do not properly remove the path when unloading a module[/-][+]In Fedora 42 from WSL the modules do not properly remove the path when unloading a module[/+]on Oct 24, 2025
Could you please run the same command sequence in your Fedora WSL environment and report here the output you obtain. Providing the content of your modulefile will help to understand what is going on.
Indeed, the modules work with regular paths. I have abused it by a statement like below
prepend-path PATH ~/tools/arm/bin
and it almost worked by placing the proper expanded path at the front. The problematic issue is the ~ and it should not be used since the path can't be cleared on module cleanup. This is therefore not a bug but misuse from my part.
Another issue is that the WSL path can be a nightmare, example in my case is bellow
Modules does not resolve ~ but the shell, when evaluating output produced by Modules, does. So when unloading the modulefile, as the shell has transformed the path entry, Modules is not able to find it to remove it from the path variable.
If you want to use paths containing the ~ character and as you are using Tcl9, I suggest to use the following code:
changed the title [-]In Fedora 42 from WSL the modules do not properly remove the path when unloading a module[/-][+]Modules do not properly remove path starting with `~` when unloading a module[/+]on Oct 28, 2025
changed the title [-]Modules do not properly remove path starting with `~` when unloading a module[/-][+]Modules does not properly remove path starting with `~` when unloading a module[/+]on Oct 28, 2025
Activity
[-]In fedora 42 from WSL the modules do not properly remove the path when unloading a module[/-][+]In Fedora 42 from WSL the modules do not properly remove the path when unloading a module[/+]xdelaruelle commentedon Oct 26, 2025
I am using a Fedora 42 on my laptop and I cannot reproduce the issue you describe:
Could you please run the same command sequence in your Fedora WSL environment and report here the output you obtain. Providing the content of your modulefile will help to understand what is going on.
x3x7 commentedon Oct 27, 2025
Indeed, the modules work with regular paths. I have abused it by a statement like below
prepend-path PATH ~/tools/arm/bin
and it almost worked by placing the proper expanded path at the front. The problematic issue is the ~ and it should not be used since the path can't be cleared on module cleanup. This is therefore not a bug but misuse from my part.
Another issue is that the WSL path can be a nightmare, example in my case is bellow
/home/user/.local/bin:/home/user/bin:/usr/share/Modules/bin:/usr/lib64/ccache:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/Program Files/PowerShell/7:/mnt/c/Program Files/Python313/Scripts/:/mnt/c/Program Files/Python313/:/mnt/c/windows/system32:/mnt/c/windows:/mnt/c/windows/System32/Wbem:/mnt/c/windows/System32/WindowsPowerShell/v1.0/:/mnt/c/windows/System32/OpenSSH/:/mnt/c/Program Files/WindowsPowerShell/Scripts:/mnt/c/Program Files (x86)/STMicroelectronics/STM32 ST-LINK Utility/ST-LINK Utility:/mnt/c/Program Files/dotnet/:/mnt/c/Program Files/usbipd-win/:/mnt/c/Program Files/Git/cmd:/mnt/c/Program Files/CMake/bin:/mnt/c/Program Files/PuTTY/:/mnt/c/Program Files/PowerShell/7/:/mnt/c/Users/ett15530/.cargo/bin:/mnt/c/Users/ett15530/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/ett15530/AppData/Local/Programs/Microsoft VS Code/binxdelaruelle commentedon Oct 28, 2025
Modules does not resolve
~but the shell, when evaluating output produced by Modules, does. So when unloading the modulefile, as the shell has transformed the path entry, Modules is not able to find it to remove it from the path variable.If you want to use paths containing the
~character and as you are using Tcl9, I suggest to use the following code:prepend-path PATH [file tildeexpand ~/tools/arm/bin][-]In Fedora 42 from WSL the modules do not properly remove the path when unloading a module[/-][+]Modules do not properly remove path starting with `~` when unloading a module[/+][-]Modules do not properly remove path starting with `~` when unloading a module[/-][+]Modules does not properly remove path starting with `~` when unloading a module[/+]xdelaruelle commentedon Oct 28, 2025
I will update the man page to mention that path element provided to
prepend-pathcommand are not transformed but shell may interpret it.doc: no auto path resolution on {prepend,append,remove}-path