haskell / haskell/cabal

confusion with multiple extra-prog-path

Open
#5,958 7 comments 0 reactions 0 assignees View on GitHub
cabal-install: cmd/user-config type: bug
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

I would have thought that

```
extra-prog-path: C:\msys64\usr\bin;C:\msys64\mingw64\bin;C:\Users\Tamar\AppData\Roaming\cabal\bin
```
Should work based on the fact that it does work for `extra-include-dirs`, but doesn't find `sh`.

But I guess it doesn't based on the singular `path` in the name. Searching the docs doesn't seem to get me anything on this but at

https://stackoverflow.com/questions/42555250/installing-haskell-on-windows-cabal-config

I found that apparently the right way is to have multiple `extra-prog-path`.

```
extra-prog-path: C:\msys64\mingw64\bin
extra-prog-path: C:\Users\Tamar\AppData\Roaming\cabal\bin
extra-prog-path: C:\msys64\usr\bin
```

which seems to work but it a bit inconsistent with the other options, but also I am confused on how to modify this with `user-config`.

To "read" a key I have been using `cabal user-config diff -a '$key:'`, This is mostly a guess since I can't find documentation on this option either.

The output is terribly confusing, I had expected `-a` to only output the difference in the line you specified.

so

```
> cabal user-config diff -a 'extra-prog-path: '
+ extra-include-dirs: C:\msys64\mingw64\include
+ extra-lib-dirs: C:\msys64\mingw64\lib
- extra-prog-path: C:\Users\Tamar\AppData\Roaming\cabal\bin
+ extra-prog-path:
+ symlink-bindir: C:\Users\Tamar\AppData\Roaming\cabal\bin
```

I had expected to have only given me back the diff between the blank line `'extra-prog-path: '` and the existing ones. However it gives me back a weird result. Even weirder, one of the path is missing. Without `-a` I get

```
> cabal user-config diff 'extra-prog-path: '
+ C: \msys64\usr\bin
+ extra-include-dirs: C:\msys64\mingw64\include
+ extra-lib-dirs: C:\msys64\mingw64\lib
- extra-prog-path: C:\Users\Tamar\AppData\Roaming\cabal\bin
+ extra-prog-path: C:\msys64\mingw64\bin,
+ symlink-bindir: C:\Users\Tamar\AppData\Roaming\cabal\bin
```

Which seems to be the same as `cabal user-config diff` which is fair, it doesn't say `diff` takes any argument. The path is now back, but it doesn't tell me the key it belongs to.

The `--help` for `user-config` says

```
-a --augment=CONFIGLINE Additional setting to augment the config file
(replacing a previous setting if it existed).
````

and

```
diff: Shows a pseudo-diff of the user's ~/.cabal/config file and the default
configuration that would be created by cabal if the config file did not exist.
```

So I don't understand, does `diff` support `-a`? it does seem to do *something*, does it support these multiple entry fields?

Can I just get `cabal` to tell me where the `config` file is so I can modify it manually? `cabal user-config init` echo's the path as part of the output, but I can't really count on that format as it's just an info line.

Contributor guide

Open the contributing guide

Research direction

Start with the documented `cabal user-config diff` and `cabal user-config init` commands, then reproduce the Windows `extra-prog-path` and `--augment` examples from the issue. Compare the observed output with `--help` and the command description. Done means the multiple-entry behavior, argument support, and config-file location are either corrected or clearly documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
cli, documentation
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.