Skip to content

Display within which cabal.project we build #8519

@mgajda

Description

@mgajda

Describe the bug

The cabal behaves differently depending whether any of the ancestor directories has cabal.project or not.
Since we should not demand the user to only ever test builds within a fresh /tmp directory, and large builds
may easily have multiple cabal.projects, it would be nice to warn the user which cabal.project we use, or that there is none used in this case.

To Reproduce

Steps to reproduce the behavior:

$ git clone https://gitlab.com/migamake/homplexity
$ cabal new-build
$ cabal sdist
$ cd dist-newstyle/sdist
$ tar xzf homplexity-*.tar.gz
$ echo "Let's test the build...."
$ cd homplexity-*
$ cabal new-build

This build breaks.

If we do:

$ mkdir /tmp/homplexity-test
$ tar xzf $MYPATH/homplexity*.tar.gz
$ cabal new-build

We get a correct build.

The only difference is absence of the cabal.project file in the second case.

Expected behavior

cabal new-build should tell why its behaviour differs by indicating which cabal.project is used,
or printing no cabal project.

System information

  • any
  • cabal 3.4.1,0
  • ghc version -- does not matter

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions