Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend RepoIndexState syntax to include modifiers #6604

Open
phadej opened this issue Mar 22, 2020 · 1 comment
Open

Extend RepoIndexState syntax to include modifiers #6604

phadej opened this issue Mar 22, 2020 · 1 comment
Assignees

Comments

@phadej
Copy link
Collaborator

phadej commented Mar 22, 2020

  1. ignore revisions (pick first, not last)
  2. include releases at given index-timestamp, but include more recent revisions until a second timestamp
  3. pin individual packages to specific revision (via sha256, I think we don't want "count")

The 1st and 2nd points are mutulally exclusive, 3rd should be repeated.

Currently we have

hackage.haskell.org,2020-03-22T14:34:00Z

like syntax, i.e. RepoName comma timestamp.

In #6597 I made configuration with colon instead of comma, at least for now. Yet, we need a syntax which works for all of above modifications, is not too convoluted and easy to parse, and perfectly also expandable.

One option is to use spaces.

@phadej phadej added this to the 3.4 milestone Mar 22, 2020
@phadej phadej self-assigned this Mar 22, 2020
@phadej
Copy link
Collaborator Author

phadej commented Mar 22, 2020

One rough idea:

With spaces

parser for TotalIndexSpace would similar as now, but requiring
comma separator.

The RepoIndexSpace would be a list of things separated by spaces.

These are compatible with current index-state:

HEAD
2020-03-24T14:34:00Z
@123456789

But we can have more modifiers:

vanilla
revisions-until:2020-03-13T14:34:00Z
revision:package-foobar-1.2.3:b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c

with general rule unqual-component-name like token (: specifiers)?.
Token is required to start with alpha character.
Note that HEAD is such. ISO8601 date and posix timestamps start with digit
and @ so are different.

Examples:

hackage.haskell.org HEAD
hackage.haskell.org 2020-03-24T14:34:00Z
hackage.haskell.org @a23345679
hackage.haskell.org 2019-12-31T23:59:59Z revisions-until:2020-03-24T14:34:00Z
hackage.haskell.org HEAD revision:tree-diff-1.2.3:b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c

That would look like in cabal.project or cabal.project.freeze file like

index-state:
  hackage.haskell.org 
    2019-12-31T23:59:59Z revisions-until:2020-03-24T14:34:00Z
    revision:tree-diff-1.2.3:b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c
    revision:another-pkg-1:7d865e959b2466918c9863afca942d0fb89d7c9ac0c99bafc3749504ded97730

  , head.hackage 2020-03-24T14:34:00Z

Note: eventually when cabal.project parser is remade with parsec, we get leading comma.

With cli you could say

cabal v2-update 'hackage.haskell.org revision:tree-diff-1.2.3:b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c'

or just

cabal v2-update revision:tree-diff-1.2.3:b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c

to pin single revision back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant