Improve atomicness#17
Merged
Merged
Conversation
|
Nice |
zkochan
added a commit
that referenced
this pull request
May 11, 2018
zkochan
added a commit
that referenced
this pull request
Aug 17, 2018
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In practice, this allows you to interrupt
pnpm install, then run it again, and it'll work just fine after that... no matter where you stopped it.How?
pnpminstalls into.storeatomic. That is, if it's in.storeand.store/lodash@4.0.0/.pnpm_inprogressis not present, you're sure that it's an incomplete installation of a module..pnpm_inprogressto modules that are currently in progress in being built. It's cleaned up afterwards.node_modules/.tmpis cleaned up afterwards. There's no explicit handling torm -rf .tmpor anything (that'd be awful!)—simply, if pnpm tries to rebuild a module that has.pnpm_inprogress(ie, from a broken install), it'll know to tear the old.tmpversion of that down. Neat.Why .pnpm_inprogress?
Note that since 0.5.0, pnpm symlinks partial installs from
.tmp/0a1b2c3d...into.store/lodash@4.0.0. This allows you to uselodash@4.0.0while it's being built—sadly something needed by modules that have circular dependencies (ehem,babel-core). Hence, you can't count on the existence of.store/lodash@4.0.0as a way to determine thatlodash@4.0.0is built.An empty
.pnpm_inprogressfile solves that. As long as that file is present, it means it's a transient package that's in the middle of being built.