Skip to content

Build a lone package with --ignore-project #10556

Open

Description

@philderbeast

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)

Activity

  1. ulysses4ever commented on Nov 19, 2024

    @ulysses4ever
    Collaborator

    That's, unfortunately, a long-standing issue and a duplicate of #7057

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions