dotnet-sdk installs bogus `~/.dotnet/tools` entry as `/etc/paths.d/dotnet-cli-tools`
See original GitHub issueWe installed dotnet-sdk using brew today and the /etc/paths.d/dotnet-cli-tools
it created injected a bogus ~
into the system PATH
variable which results in kubectl
getting upset.
The /etc/paths.d
directory (managed by /usr/libexec/path_helper
) takes static files and literally inlines their contents into a produced PATH env string.
This PATH env string is not later evaluated, which means that a ~
in a file in /etc/paths.d
, as in:
/etc/paths.d/dotnet-cli-tools
:
~/.dotnet/tools
Will not get converted into the equivalent of $HOME/.dot/tools
.
This gets reported by victims in issues such as kubernetes/kubectl#574.
I think that this is caused by: https://github.com/dotnet/sdk/blob/a30e465a2e2ea4e2550f319a2dc088daaafe5649/src/Cli/dotnet/ShellShim/OsxBashEnvironmentPath.cs#L23-L78
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:8 (1 by maintainers)
Top GitHub Comments
Please, add env variable to define path to tools! It’s all kind a mess with different paths of tools, datas, etc. - best way is make dotnet follow XDG spec in all platforms according to this or similar
I’d half argue in favor of adding a
/usr/local/bin/.dotnet-tools
instead and making that a symlink to$HOME/.dotnet/tools
.