Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Support version locking a la npm #271

Open
alecthomas opened this issue May 14, 2022 · 0 comments
Open

Support version locking a la npm #271

alecthomas opened this issue May 14, 2022 · 0 comments

Comments

@alecthomas
Copy link
Collaborator

alecthomas commented May 14, 2022

@lyonlai had an interesting suggestion of being able to lock specific packages to a version range. The idea being that you could then just type hermit upgrade and everything would be upgraded within the specified constraints. It could be similar to npm's approach, but encoded in the symlink chain. eg.

hermit install openjdk~17.0.2

(note the tilde) would allow patch level upgrades automatically, but not minor version upgrades

This could be encoded in the symlink chain as you would expect

javac -> .openjdk~17.0.2.pkg -> hermit

After some thought I don't think this would be the best approach, as it would require Hermit to do constraint matching against all available versions of the package on every stub execution. A better approach might be to add a constraints option to the environment's config, eg.

constraints = {
  "openjdk": "^17"
}

This would be automatically managed by hermit install/upgrade/uninstall. hermit upgrade would upgrade the bin links to the latest version that satisfies the constraint.

Synesso pushed a commit to Synesso/hermit that referenced this issue Feb 22, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant