Skip to content

exactDeps has bad interaction with source-repository-package and shellFor #1637

Open
@michaelpj

Description

@michaelpj

I've observed what I think is the following interaction:

Project P has

  1. A shell with exactDeps set
  2. A package A which depends on B
  3. A source-repository-package stanza patching C which is a dependency of B

In this scenario, cabal will always want to rebuild B. There is no way to convince it to take a prebuilt B from a package-db short of removing the source-repository-package stanza. But setting exactDeps says "we don't want cabal to build anything", and indeed this will "work": cabal will decide it wants to build B, but fail because it has no repositories ("unknown package B").

(In fact, we're clever enough to not even bother putting our prebuilt B into the shell, because we know cabal will ignore it. This can seem a little surprising if you're not expecting B to be missing!)

I think this is inescapable: cabal will absolutely insist on building B, and exactDeps won't let it. If we just wanted exactDeps to say "don't let cabal hit the network", then we could point it at a local repository instead, perhaps.

My preferred solution: don't use exactDeps.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpreservedKeep stale bot away

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions