Skip to content

build-tool-depends silently ignored for non-existent executable #4781

Closed
@hvr

Description

@hvr

Consider the following specification,

name:                dummypkg
version:             0
build-type:          Simple
cabal-version:       >=2.0

library
  default-language: Haskell2010
  build-tool-depends: mtl:imaginary-exe

when invoking new-build, this silently succeeds. And also, plan.json doesn't record any exe-depends from dummypkg-0-inplace on mtl as it would if build-tool-depends referred to an actually existing executable:

    {
      "type": "configured",
      "id": "dummypkg-0-inplace",
      "pkg-name": "dummypkg",
      "pkg-version": "0",
      "flags": {},
      "style": "local",
      "dist-dir": ".../dist-newstyle/build/x86_64-linux/ghc-8.2.1/dummypkg-0",
      "depends": [],
      "exe-depends": [],
      "component-name": "lib"
    },

For a build-tool-depends declaration, I'd expect the solver to require the existence of that executable in the respective package as a constraint to solve for. The reason being is that packages may start out as a library, and in later releases start adding an executable. Or sometimes executables may get renamed or removed.

/cc @grayjay @Ericson2314

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions