Skip to content

Semantics of index-state in cabal.project #8568

Open
@andreabedini

Description

@andreabedini

At IOG we have started using a custom hackage repositories, which we informally call CHaP.

To add the custom repository to a project we have been doing

repository cardano-haskell-packages
  url: https://input-output-hk.github.io/cardano-haskell-packages
  secure: True
  root-keys:
    -- snip

index-state: 2022-07-01T00:00:00Z
index-state: cardano-haskell-packages 2022-10-20T00:00:00Z

We thought the first index-state would apply to all active repositories, and the second one only to the specified repository. (For context: we did this because we were working around a limination with another tool which we use to parse cabal.project).

But we were wrong! After a while it became clear that the second index-state completely overrides the first (as the first was never there).

Indeed, the correct way to express two index-states would be

index-state:
  , hackage.haskell.org 2022-07-01T00:00:00Z
  , cardano-haskell-packages 2022-10-20T00:00:00Z
  1. Is this the intended behaviour?
  2. Should cabal accept multiple index-state stanza (for different repos)
  3. Should cabal give a warning when it sees stanzas which override previos ones?

Thanks!

Ping @michaelpj @angerman

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