Skip to content

stack query generates a .cabal file as side effect #6780

@andreasabel

Description

@andreasabel

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

resolver: lts-22.44

package.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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions