commercialhaskell / commercialhaskell/stack
Stack --stack-yaml follows symlinks with too much knowledge
- Dominant language
- Haskell
- Stars
- 4.1k
- Forks
- 850
- Avg merge
- 10h 37m
- Merged PRs (30d)
- 4
Description
### Steps to reproduce
For example:
1. `git clone http://gitlab.com/iu-guest/mbug`
2. `stack build` works
3. `stack path --config-location` returns `stack.yaml`
4. `stack build --stack-yaml=stack.yaml` gives:
```
Stack looks for packages in the directories configured in the 'packages' and 'extra-deps' fields defined in your stack.yaml
The current entry points to /home/iu/devel/gitlab/iu-guest/mbug/config/ but no .cabal or package.yaml file could be found there.
```
In the above repo `stack.yaml` is a symlink to `config/latest.yaml`. It appears that `stack build` uses `stack.yaml` as is and assumes it's current directory is `.`. However, `stack build--stack-yaml=stack.yaml` chases the symlink first to find the directory. It feels that you expect the property:
```
stack build == stack build --stack-yaml=$(stack path --config-location)
```
But that isn't the case. In particular, [weeder](https://github.com/ndmitchell/weeder) makes this assumption.
### Method of installation
* Version 1.8.0, Git revision d9952087654f7bbdfe1ee165c6d137733edcda11 x86_64 hpack-0.28.2
Note that I am reporting a bug based on information given to me in a private bug report.
Contributor guide
Assessment
This issue has not been assessed yet.