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

[Discussion] Multiple package version support in pkgm, potential problems and feature creep #29

Open
andrewcrook opened this issue Feb 22, 2025 · 7 comments

Comments

@andrewcrook
Copy link

andrewcrook commented Feb 22, 2025

Following from #24 (which we cannot rely upon packages following semver unfortunately) I have hit several other issues thinking about this. I think we need to clarify this before #24 and starting an uninstall feature.

How do we want to support multiple versions?

some points:

  1. There can only be one version linked in /usr/local/bin using the packages name. Do we make it the highest version installed? how to run other versions?
  2. make symbolic links for /usr/local/bin/package-version/usr/local/pkgs/package folder/version/package-bin
  3. 2 above this would have to be done with other binaries in a package if they are made available. (pkgx. ‘provides:’ ?)
  4. 1 and 2 would also have to be done with libraries on /usr/local/lib
  5. If we want to support multiple versions how would this work with upgrades, upgrade only x or x.x what about patch versions ?
  6. How to keep versions we want to keep? Add a pin feature to stop upgrading and pruning of certain installed versions?
  7. do we want to be able to switch default version e.g change the symbolic link on /usr/local/bin/package
  8. How to deal with packages and versions removed from the pantry

As you can see this starts to become very messy and increases complexity.
Perhaps we only should have one version for each package or perhaps only the major or major and minor?
or perhaps only allow multiple versions for certain packages?

With libraries I would hope that libraries would be on path in the env and /usr/local/lib is just a fallback.
But we would have to think about this because its probably more likely that we want multiple versions of libraries.

Will pkgx's pantry be keeping multiple versions of everything?
I doubt it, maybe libraries, compilers and interpreters for an extended period of time.

@jhheider
Copy link
Contributor

my feeling would be that if you need to switch versions, you either need to be using pkgx (not pkgm), or if #28 is merged, you can quickly switch versions by installing the desired version over the extant version.

@jhheider
Copy link
Contributor

or, if #26 is merged, you could have two (a "local" and a "global").

@mxcl
Copy link
Member

mxcl commented Feb 24, 2025

I think we can support this for packages that are designed to be installed in parallel, but as Jacob says a more robust solution is pkgx and/or dev.

@jhheider
Copy link
Contributor

OS-level installs aren't well-situated for multiple version install, though hacks abound. I can think of two that could work:

  • pkgm install --with-prefix=foo python^3.11 && foopython --version
  • pkgm install --with-version rust^1.56 && rustc1.56 --version

Both have the problem that the installed software will be looking for the rest of its suite under common names, and external software won't find it without tricks. This is, however, the specific use case at which pkgx excels.

@mxcl
Copy link
Member

mxcl commented Feb 24, 2025

indeed, only some packages will support this, this is the problem with “installing” and part of the reason pkgx approached it differently.

Python is a notable exception ofc in that it is designed to have each minor installed alongside each other.

I think really we need @andrewcrook to describe what he is trying to achieve more specifically.

@andrewcrook
Copy link
Author

andrewcrook commented Feb 25, 2025

The search for information

I am just trying to get a sense of what the software is meant to do and road map when it comes to the finer details.
hence "How do we want to support multiple versions?” , if at all. How to deal with links in /usr/local/bin and /usr/local/lib and symbolic link clashes.

I think multiple versions of packages of programs is different to handling multiple versions of libraries, however, library packages often come with programs e.g command line tools.

What am I looking for?

Personally I would like to have latest tools system wide and use dev on projects. I was thinking about something like Flox but without the nix. I want it to replace homebrew formulas (probably not casks). direnv and mise/asdf (and now flux).

I know people will complain about not having multiple python versions at the same time I see it a lot on other projects. I think this could still be supported.

Python thing doesn’t really affect myself much, but it would be nice, I tend to set one a time in the current project and have latest version system wide.

However, if a package requires a different versions of python then that should be a dependency and hard linked into the version of the package to call it directly.

@mxcl
Copy link
Member

mxcl commented Feb 25, 2025

k so you want to try multiple versions of things, I don’t grok though why you need them installed, this is what pkgx is perfect for.

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

3 participants