Skip to content

Importing a source-repository-package cannot be overridden #8463

Open
@parsonsmatt

Description

@parsonsmatt

Describe the bug

I have a cabal.project and a ghc94.cabal.project that I am using to get compatible with GHC 9.4 on the work codebase. To simplify the code, I'm using the import feature in Cabal 3.8 with ghc94.cabal.project to ensure that there is as little duplication as possible and to track what work needs to be done to integrate everything.

Unfortunately, because I have two different source-repository-package in each file for the same package, I get a conflict, and cabal doesn't try to override.

-- cabal.project

packages: .

source-repository-package
  type: git
  location: https://github.com/avieth/bytebuild.git
  tag: 036aa84fb037e62c4e7da4523c818541481b9a07
  --sha256: 9yiWSMGyi9vxVAV27YctWFYTDL0Uaa1j7TfyUdgMYtY=
  subdir: .

-- ghc94.cabal.project
packages: .

import: ./cabal.project

-- https://github.com/byteverse/bytebuild/pull/29
source-repository-package
    type: git
    location: https://github.com/parsonsmatt/bytebuild
    tag: e8dee26a4cc379a1971b428187fad51824de8e38

To Reproduce

Put the two cabal.project files in a directory somewhere with a .cabal file that depends on bytebuild.

$ cabal v2-build --project-file ghc94.cabal.project

Expected behavior

cabal clearly knows that I depend on bytebuild. And in the imported cabal.project, I satisfy that dependency with a source-repository-package. In the importing ghc94.cabal.project, I would expect the new source-repository-package to override the one in the import.

System information

  • Operating system: Ubuntu
  • cabal, ghc versions
λ cabal --version
cabal-install version 3.8.1.0
compiled using version 3.8.1.0 of the Cabal library 
λ ghc --version
The Glorious Glasgow Haskell Compilation System, version 9.4.2

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions