Conversation
|
One note about the implementation: it persist all dependency locations and that means that |
|
I haven't looked at the code yet, but based on your comment @qrilka: do you think it makes more sense to take a different approach here? Two things I can think of:
|
|
@snoyberg I think I need to check the current timings to get a bit more clear understanding of the problem. But in any case it looks odd to add an optimization which makes Stack slower. |
|
@snoyberg on Monday I've tried to optimize sourcemap-based lockfiles and I had some improvements but still if we parse almost the same what we have in a snapshot it takes some time. So in 40bf6f0 I've simplified everything and in that commit lock file contains only non-trivial location completions (e.g. snapshot locations won't get stored there) - it simplifies logic quite a lot and also it gives some speed improvements (up to 20% compared to optimized sourcemap-based locks). |
|
BTW regarding timings I have this gist - https://gist.github.com/qrilka/d5e220f3955c8d8ea70ad40f720f5f12 |
|
@snoyberg 1 of integration test failed, so I need to fix that before it will be ready for a proper review |
|
the problem with |
snoyberg
left a comment
There was a problem hiding this comment.
Looks really solid, and I'm happy with the results of testing it so far! One request: I didn't notice a test for removing a package from extra-deps and checking that it was removed from the lock file as well. If I missed it: ignore me. If I didn't miss it: can you add such a test?
| {-# LANGUAGE ScopedTypeVariables #-} | ||
| {-# LANGUAGE OverloadedStrings #-} | ||
|
|
||
| module Stack.LockSpec where |
| logDebug $ "Parsing cabal file for " <> display loc | ||
| bs <- loadCabalFileBytes loc | ||
| let foundCabalKey = BlobKey (SHA256.hashBytes bs) (FileSize (fromIntegral (B.length bs))) | ||
| let foundCabalKey = bsToBlobKey bs |
|
@snoyberg please take another look, especially into the doc |
| This should minimize the number of changes to packages incurred. | ||
| When loading a Stack project all completed package or snapshot locations | ||
| (even when they were completed using information from a lock file) get | ||
| collected to form a new lock file. |
There was a problem hiding this comment.
to form a new lock file
Can you clarify this a bit? I'm guessing the logic is "form a new lock file in memory and compare against the one on disk, writing if there are any differences." Is that the case?
Please include the following checklist in your PR:
Tested manually and with local run of integration tests
Has some code and resolves #4550
Resolves #4288