| synopsis | Don't pass the executable name to external commands | |
|---|---|---|
| packages |
|
|
| prs | 11232 | |
| issues |
|
|
| significance | significant |
Previously the executable name of the external command was passed to external commands as the first argument.
This behaviour was adapted from cargo which does this because of reasons that are internal to rust that do not affect GHC Haskell, and are even orthogonal to patterns that see common use in Haskell.
Additionally, it complicates the 'simple' case which is what we should optimize for when building such a feature - with this change, for any executable cabal-foo in your search-path, cabal foo will be a valid invocation of that command.
The previous use case (one executable that serves multiple external subcommands) is still possible by the following means:
- using a wrapper around the executable
- using a symlink and check argv[0] in the executable
Additionally, the variable $CABAL that was set by cabal-install was renamed to CABAL_EXTERNAL_CABAL_PATH. This has two reasons:
- it makes migration easier for users of the external command feature that were previously expecting the name of the executable
to appear in
argv[1] - it does not unnecessarily pollute the environment variable namespace as it turns out some other tools have been and are already using this name, historically