-
Notifications
You must be signed in to change notification settings - Fork 53
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
Document the lockfile #191
Conversation
@zkochan suggested I might comment here regarding some questions on using hash based version ids, lock files, and machine level (global) installs. Fwiw, I've been made aware I'm not that good at paraphrasing things for easy consumption on this type of forum. My apologies in advance if any of this seems overly "wordy". In Summary (TL;DR;)
Reinventing the wheel?I was wondering if simply using yarn's lock format had been considered? I cursorily looked at both specs and on the surface it appears they're both intending to solve the same fundamental problem in the same fundamental way, by atomically storing: a flat version dependency graph using content hashes as version identifiers; the dependency version-set specifiers used when obtaining the content and their mapping's to the semantic version and hash version; and the content's source registry? Please correct me if I'm in error. The pro of this, and the impetus for the question, is it would ease developer workflows where the graph has previously been computed and stored with the source in a SCCS, for both The con is that I do see the value of being able to simply open one in an editor and find what I'm looking for, and it would be nice to that end if it used some common encoding, but part of me would prefer doing that through the command line tool (as the files are usually large), where I could just type something like (btw what would the merged effort's tool be named?) Timing of computing hash version of globally installed modulesA question I have, not directly related to the lock format itself, is exactly when the version hash of a module installed at the machine level is computed. I believe certain activities that can occur while running install lifecycle steps rely on other modules, and are therefore potentially deterministic in behavior and output by the versions of the modules being depended upon during installation, and today those dependency versions can change from local install to local install. I also wonder if certain installs alter their output as a function of what's depending on them (a bad thing to be doing in my opinion). I honestly have no direct measure of how frequently altered output as a consequence of either of those actually occurs in practice, or if at all, I just know it's technically possible, and if the desire is to "nail it" with respect to version locking to ensure determinism, it might need to be considered. To me, this is just one of those 'sucky' problems that might happen once in a blue moon, and if it did would 'break' things in a very subtle, hard to initially locate kind of way, and requires a fair amount of effort to completely deal with. For example, in this case, to mitigate problems as a consequence of output coupled to versions of dependencies used during installation, we'd want to then store for potential re-use on other machines, and include as part of the hash input, what hashed dependencies where used for installation, and then integrate all of that when rendering the physical tree; i.e. if the module hash in the lock file didn't exist, we'd have to install at the machine level, using the dependency versions originally used to generate that hash, and NOT those from the lock file been rendered. For the other issue, output coupled to the dependent of what's being installed?... uhm.... punt to documentation that it's not supported, and discourage making modules behave that way, possible with a recommended alternate pattern to address how to achieve the same ends; although I'd wait to do any of that until it's actually encountered and can be analyzed. |
I deleted a comment unnecessarily. Regarding the effect of dependencies used for a machine install, I think I over complicated a potential way to handle. The hash-versions of the dependencies used just need to be part of the input to hash(); i.e. |
Responding (just) to the TL;DR:
Yes! See #188 (comment) |
8f78b36
to
86c69a8
Compare
close #188