Accept more ISO8601 timestamp formats

Aperta
#12,630 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 3 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
66/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
haskell
Ambito
build-system

Direzione di ricerca

Start at cabal-install/src/Distribution/Client/IndexUtils/Timestamp.hs around lines 94-100, where the TODO sits and the existing parser handles @unix, full ISO8601 UTC and HEAD; read that parser and its error message closely before changing anything. Add the three forms listed (date-only as UTC midnight, minutes without seconds, numeric UTC offset) and extend the surrounding test module with one case per accepted form plus a rejection case. Done looks like --index-state=2026-06-01 and the other two examples parsing while local-time inputs still error.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

needs triage type: enhancement

https://github.com/haskell/cabal/blob/0fd9ad9bd211a15033094b3a787765fa0af6e52f/cabal-install/src/Distribution/Client/IndexUtils/Timestamp.hs#L94-L100

I'd rather write just the shorter YYYY-MM-DD form of the timestamp, if that works so I'm promoting the above TODO note to a feature enhancement issue.

The behaviour at the moment is to get an error (with minor grammar glitches):

Error: cabal: invalid argument to option `--index-state': index-state must be
a unix-timestamps (e.g. '@1474732068'), a ISO8601 UTC timestamp (e.g.
'2016-09-24T17:47:48Z'), or 'HEAD'

I don't think we need a whole lot more forms of ISO8601 but a few that are more convenient. Anything that would parse to a local time we need to be wary of.

  1. A date on its own, 2026-06-01, meaning the start of that day in UTC.
  2. A time without seconds, 2026-06-01T12:30Z (from the TODO).
  3. A numeric UTC offset, 2026-06-01T12:00:00+12:00 (from the TODO).
Lingua principale
Haskell
Stelle
1.8k
Fork
766
Merge medio
5g 21h
PR unite (30g)
27

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di haskell/cabal

Tutte le issue di haskell/cabal

Issue simili

Altre issue su Haskell

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.