commercialhaskell / commercialhaskell/stack

`stack query` generates a `.cabal` file as side effect

Open
#6,780 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
4.1k
Forks
850
Avg merge
10h 37m
Merged PRs (30d)
4

Description

Running `stack query`, e.g. `stack query compiler` will create a `.cabal` file from `package.yaml` if such `.cabal` file does not exist yet.

Reproducer: create a directory with e.g. these two files:
`stack.yaml`
```yaml
resolver: lts-22.44
```
`package.yaml`
```yaml
name: stack-query-created-me
library:
source-dirs: .
```
Then ask `stack` for the GHC version of the project:
```
$ stack query compiler actual
ghc-9.6.7
```
And, oops!, you have given birth to a new `.cabal` file:
```
$ ls *.cabal
stack-query-created-me.cabal
```
I am using the latest Stack (3.7.1):
```
$ stack --version 1 х │ ghc-9.6.7 hs │ 16:32:09
Version 3.7.1, Git revision 331f4880f1a33f1d39e14317dc9ecc6d3d6d617d aarch64 hpack-0.38.1
```

I got here because I am using the `zsh` Powerlevel 10k prompt, and I was wondering why `.cabal` files were mysteriously appearing on my file system:
- https://github.com/romkatv/powerlevel10k/issues/2890

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.