Skip to content

extra-deps: Cabal is ignored when .cabal file does not have Cabal dependency #5706

Closed
@andreasabel

Description

@andreasabel

I am using cabal-version: 2.4 in my .cabal file because I am using ** globbing patterns in the data-files section.

It seems that Cabal-2.4.0.1 shipped with lts-14.27 does not correctly implement these yet, at least stack build fails:

.stack-work/install/x86_64-osx/2d2cad02bc2492d52c57d57f66cc81f62e153722b88c98941d8195159454b5ac/8.6.5/share/x86_64-osx-ghc-8.6.5/MiniAgda-0.2022.4.6/test/should-fail: copyFile: does not exist (No such file or directory)
Completed 10 action(s).
'cabal copy' failed.  Error message:

--  While building package MiniAgda-0.2022.4.6 (scroll up to its section to see the error) using:
      /Users/abel/.stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_2.4.0.1_ghc-8.6.5 --builddir=.stack-work/dist/x86_64-osx/Cabal-2.4.0.1 copy
    Process exited with code: ExitFailure 1

Indeed the should-fail directory does not exist, but ** exists instead (looks like a bug handling globbing pattern **):

$ ls .stack-work/install/x86_64-osx/2d2cad02bc2492d52c57d57f66cc81f62e153722b88c98941d8195159454b5ac/8.6.5/share/x86_64-osx-ghc-8.6.5/MiniAgda-0.2022.4.6/test
**      fail    succeed

However, working around this problem by bumping the Cabal version in the stack.yaml files fails:

extra-deps:
- Cabal-2.4.1.0

is seemingly ignored, and also any newer Cabal version.

Note that my .cabal file does not declare a dependency on Cabal directly, the dependency is more indirect via cabal-version: 2.4.

Maybe related:

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