-
Notifications
You must be signed in to change notification settings - Fork 711
RFC: --index-snapshot <posix-time> #3378
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
Conversation
This should address haskell#2956 and is motivated by haskell#3378
PS: some variations are easily computable (i.e. consider this as different modes we could implement besides the strict filtering mode):
PS2: additional addressing mode: besides index-serial-no & posix-timestamp: cutoff relative to package releases, i.e.: |
I see, so the And so we need a separate |
yes, that way it only needs to be constructed once at
the revision number is implicitly contained if we can assume that the first
yes
yes, and especially that part of the code has a big TODO/FIXME attached as it's a bit ugly :-) |
Closing for now. |
I'm back working on this... |
continuing in #3604 since GitHub doesn't allow me to change the target branch for an existing PR |
This is an early working proof-of-concept (which already works), and I'm submitting this here to solicit an early general discussion/feedback regarding the direction the implementation is going.
This is a forward-ported version of
hvr@3dea219
mostly aimed at use with
new-build
&cabal.project
files.This introduces a flag
--index-snapshot
and a respective propertyindex-snapshot: ...
for use incabal.project
(.local
) files which currently only supports a unix timestamp argument. The--index-snapshot
-value acts as a timestamp-filter on the package index. For now, only posix-timestamps are supported as filtering criteria. Additionally an "index serial-number" is planned, which would enumerate all entries in the01-index
-tarball incrementing the serial number for each.cabal
and eachpreferred-versions
entry. This is a more exact/granular way to specify the index-state, as there could be more than one index-entry with the same timestamp.By setting
--index-snapshot
to a timestamp from the past(!), this effectively freezes the hackage index to the state and thereby allows for simple way to provide (non-curated) deterministic install-plans.This requires enabling secure repos to have any useful effect (non-secure repos have a 0-timestamp for all entries, therefore all entries lay in the past of positive
--index-snapshot
values and are not filtered).Since the index-cache format is extended, this uses a different name
01-index.cache
and the contents looks likewhere
b#
denotes the block-offset into the index-tarball andt#
denotes the posix-time of that entryPS: This patch is based on 1.24 as I started working on this rebased patch a couple of weeks ago already and was planning to have this merged in time for 1.24.1
/cc @ezyang @dcoutts @23Skidoo