Skip to content
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

Changing dependency path doesn't invalidate node_modules #53

Open
chenglou opened this issue Feb 4, 2017 · 3 comments
Open

Changing dependency path doesn't invalidate node_modules #53

chenglou opened this issue Feb 4, 2017 · 3 comments

Comments

@chenglou
Copy link
Collaborator

chenglou commented Feb 4, 2017

Repro: change "bs-platform": "esy-ocaml/bucklescript#esy" to "bs-platform": "/path/to/local/bucklescript", then do esy install while having an existing node_modules.

@jordwalke
Copy link
Owner

I think the current approach is that it creates the build cache key on the dependency's version number and package name. So if you bump the version number I suspect it will work, but I think we might want to hash on either the package contents, or the hash of mtimes on files within the package (which might be faster and sufficiently unique - as well as detecting when you modify a file).

@chenglou
Copy link
Collaborator Author

chenglou commented Feb 4, 2017

BTW I'm not modifying the package's content (they're symlinked and I wouldn't touch them anyway). I'm switching from a remote git url to a local one. What you said applies if I keep the same path but changes some content. In this case, the path's changed.

@jordwalke
Copy link
Owner

jordwalke commented Feb 4, 2017

Also, since we'll be finding little bugs/fixes in the build cache, maybe we should have an escape hatch called esy purge myPattern, which will say:

> esy purge myPattern



There are (3) build caches for packages matching "myPattern":
---------------------------------------------------------------
  myPattern-1.0.0
  └─ ~/.esy/store/_build/myPattern-1.0.0-83b5bc03c594d2
  myPattern-1.0.1
  └─ ~/.esy/store/_build/myPattern-1.0.1-9877bc03c594d0
  myPatternxyz-2.0.0
  └─   ~/esy/store/_build/.....

And two other packages that depend on those cached builds:

  dependsOnThatPackage-2.0.0
  └─ ~/.esy/store/_build/blah
  anotherThingThatDependsOnThem-4.0.0
  └─ ~/.esy/store/_build/blah


╭───────────────────────────────────────────────────────────────╮	
│ WARNING ┊                                                     │
│   ♼     ┊  Would you like to purge the above packages? [Y/n]? │ 
│ WARNING ┊                                                     │
╰───────────────────────────────────────────────────────────────╯	
Answer: [Y/n]?
 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants