-
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
[CAS] Prefix folder names with package name #48
Comments
I agree that it's a problem, on the other hand it kind of defeats the point of having content-addressable directory names for dependencies if you put an arbitrary name in front of it. That being said we could simply ignore the prefix.... So yes, if you someone figures out an elegant way to implement this, I'm very open to it. |
Per http://nixos.org/nixos/about.html, NixOS appends the package names (rather than prepend, as proposed here). The length of the hash is going to be constant, and you can just ignore everything after that. |
I like it prepended because it'd make stack traces easier to visually skim through.
It will also make |
as a side note, |
I don't think that the feature is really necessary. However, I'd like to put these generic directories with packages into a special folder like
That can be a thing that you are actualy want. |
@just-boris How does this simplify anything? Say you get a stacktrace emailed to you – you literally have no idea what's going on unless you ssh into the server to see what all the hashes match up to. The neat directory is merely aesthetic, no? @rstacruz The |
@brianreavis that is probably a valid point, thanks for pointing this. Scoped packages are installed in the folder prefixed with |
Append or prepend both sound fine, I can see pros and cons of both. Is it work considering a shorter hash too, 10 or 12 hex character perhaps? Are there practical disadvantages to a shorter hash (10 hex chars is still over a trillion uniques)? |
@davej once again, we can get rid of hashes in folder names at all. I just haven't tried to implement it, but it seems possible. |
@just-boris: I thought the folder names were CAS, i.e.. generated from content checksum rather than the package + version. I'm on mobile phone so can't look at the codebase now but from the readme: node_modules as CAS - Packages are always being referenced by their SHA-1 checksums. Therefore a node_modules directory can be considered to be a Content Addressable Storage, meaning that packages are being identified by their contents, not by arbitrary identifiers, such as package names that are not guaranteed to be unique across different registries. |
@davej, oh, sorry. There were some changes, and that sentence from the Readme is not actual and should be updated. Now folders names is not actually a shasums of the content. It was a necessary change to support other package sources, like So now, it is easy to change it and bring some humanity into folder names and provide more friendy stack traces for users. |
Cool, well then I guess it makes perfect sense to drop the hash. |
dropping the hash sounds like a fantastic idea. really excited for the future of ied. |
just chiming in with some lessons learned in my own implementation. you can't always expect
in those cases, you can use |
Current implementation is fine. Prefixing CAS names with package names kind of defeats the purpose of having CAS names in the first place in my opinion. You can get the package name either from the |
The downside with checksum folder names is that it can make stacktrace debugging very difficult. It's impossible to tell what module is what without manually opening up each folder.
@alexanderGugel Is this something you'd be open to?
The text was updated successfully, but these errors were encountered: