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

Collisions between different hermit distributions #385

Open
swankjesse opened this issue Oct 4, 2023 · 1 comment
Open

Collisions between different hermit distributions #385

swankjesse opened this issue Oct 4, 2023 · 1 comment

Comments

@swankjesse
Copy link

My company uses a private internal-only Hermit.

We’ve had problems caused by running the public hermit and our internal hermit on the same machine. In particular, some package names collide, so we get the public OpenJDK when expecting our internal packaging of OpenJDK.

I’d like for Hermit to prevent such collisions from causing us grief. Perhaps by namespacing packages on the filesystem using a hash? Instead of pkg/k9s-0.27.4/ it would be something like pkg/9s-0.27.4-a5c4faa30.

We’re currently working around this problem by setting an environment variable on CI builds where this problem is most pronounced:

export HERMIT_STATE_DIR=$HOME/Library/Caches/hermit-square
@alecthomas
Copy link
Collaborator

I started implementing this today, and there are a couple of complications.

  1. Implementing this will effectively result in all existing packages on an individual machine being reinstalled.
    I think this could be mitigated somewhat by adding some special-casing to delete any existing packages that don't include hashes, but maybe it's not worth the hassle.
  2. Package resolution occurs quite frequently in Hermit (eg. every time a binary is executed), and this change will slow that down due to the hashing of the package itself and any files that it copies during installation.
    It's not clear to me how much of an impact this would be in practice, I'll have to do some testing. There's currently no caching either, so that could be an easy win.

Other than these considerations, it seems fairly straightforward.

spicykay pushed a commit to spicykay/hermit that referenced this issue Aug 23, 2024
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