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
Support for --index-state on cabal update #4341
Conversation
@@ -262,7 +262,7 @@ getSourcePackagesAtIndexState verbosity repoCtxt mb_idxState = do | |||
return () | |||
IndexStateTime ts0 -> do | |||
when (isiMaxTime isi /= ts0) $ | |||
warn verbosity ("Requested index-state " ++ display ts0 | |||
info verbosity ("Requested index-state " ++ display ts0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? IMO warn
is more appropriate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, my mental model of --index-state
is that you are saying, "Give me the state of the index at time X." In this case, the date I pass in might not correspond to any timestamp explicitly mentioned in the index. But this doesn't feel like a warning case to me: the time of last update might be different from the time I gave, but what's wrong with that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. I was thinking of the case where the requested timestamp is invalid, e.g. in the future or deep past, so the command doesn't do what the user expects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I suppose that is something we could warn about, but that's a different warning!
c6c0456
to
1af2c51
Compare
The strategy is to save an 01-index.timestamp file that remembers what --index-state the user requested during cabal update. Subsequently, we use that index state if no more precise index state was specified (via the flag or a project config.) Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
1af2c51
to
51ae48d
Compare
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
CC @hvr