haskell / haskell/cabal

Build a lone package with `--ignore-project`

Open
#10,556 1 comment 0 reactions 0 assignees View on GitHub
re: --ignore-project resolution: duplicate type: enhancement
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

I wanted to try `cabal build` with a test package for `cabal-testsuite` so changed to its folder and tried building it there. I was surprised that I couldn't `--ignore-project`. I reached for `--project-dir` instead and this did seem to help ignore projects higher in the directory tree.

Could we please enable `--ignore-project` for `cabal build`?

```
$ cd cabal-testsuite/PackageTests/Check/PackageFiles/VersionBounds

$ ls
cabal.out cabal.test.hs pkg.cabal

$ cabal build all --dry-run
Warning: this is a debug build of cabal-install with assertions enabled.
Configuration is affected by the following files:
- cabal.project
Resolving dependencies...
Error: [Cabal-7107]
Could not resolve dependencies:
[__0] trying: cabal-testsuite-3 (user goal)
[__1] unknown package: Cabal-hooks (dependency of cabal-testsuite)
[__1] fail (backjumping, conflict set: Cabal-hooks, cabal-testsuite)
After searching the rest of the dependency tree exhaustively,
these were the goals I've had most trouble fulfilling: cabal-testsuite, Cabal-hooks

$ cabal build all --dry-run --ignore-project
Error: cabal: unrecognized 'build' option `--ignore-project'

$ cabal build all --dry-run --project-dir=.
Warning: this is a debug build of cabal-install with assertions enabled.
Resolving dependencies...
Build profile: -w ghc-9.10.1 -O1
In order, the following would be built (use -v for more details):
- pkg-0 (lib) (first run)
```

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.