You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Discussion] Multiple package version support in pkgm, potential problems and feature creep #29
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:
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?
make symbolic links for /usr/local/bin/package-version/usr/local/pkgs/package folder/version/package-bin
2 above this would have to be done with other binaries in a package if they are made available. (pkgx. ‘provides:’ ?)
1 and 2 would also have to be done with libraries on /usr/local/lib
If we want to support multiple versions how would this work with upgrades, upgrade only x or x.x what about patch versions ?
How to keep versions we want to keep? Add a pin feature to stop upgrading and pruning of certain installed versions?
do we want to be able to switch default version e.g change the symbolic link on /usr/local/bin/package
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.
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.
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.
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.
what I was asking was if pkgm was meant to support multiple versions.
No? that’s great I am totally fine about it. The links need to use the latest version then?
But what about multi-version dependencies in terms of libraries and other application? How to handle?
Only install other versions as dependencies and only allow one version to be installed under pkgm manually for user use?
Need to call and reference to dependencies from parent package should do so directly by relative path and version?
Dependencies under '~.pkgx’ only? because any paths defined have to work with pkgx and pkgm.
What about /usr/local/bin and /usr/local/lib?
How should these be handled?
Scenario
If I have an app using opensll v1.1.1x and another app using openssl v3.x.x as dependencies.
the openssl library links in /usr/local/lib going to clash as to are any applications that are distributed with the library.
Activity
jhheider commentedon Feb 23, 2025
my feeling would be that if you need to switch versions, you either need to be using
pkgx(notpkgm), or if #28 is merged, you can quickly switch versions by installing the desired version over the extant version.jhheider commentedon Feb 23, 2025
or, if #26 is merged, you could have two (a "local" and a "global").
mxcl commentedon 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
pkgxand/ordev.jhheider commentedon Feb 24, 2025
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 --versionpkgm install --with-version rust^1.56 && rustc1.56 --versionBoth 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
pkgxexcels.mxcl commentedon Feb 24, 2025
indeed, only some packages will support this, this is the problem with “installing” and part of the reason
pkgxapproached 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 commentedon 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/binand/usr/local/liband 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 commentedon 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
pkgxis perfect for.andrewcrook commentedon Mar 5, 2025
@mxcl
No. I am happy to use dev and pkgx for that.
what I was asking was if pkgm was meant to support multiple versions.
No? that’s great I am totally fine about it. The links need to use the latest version then?
But what about multi-version dependencies in terms of libraries and other application?
How to handle?
Only install other versions as dependencies and only allow one version to be installed under pkgm manually for user use?
Need to call and reference to dependencies from parent package should do so directly by relative path and version?
Dependencies under '~.pkgx’ only? because any paths defined have to work with pkgx and pkgm.
What about /usr/local/bin and /usr/local/lib?
How should these be handled?
Scenario
If I have an app using opensll v1.1.1x and another app using openssl v3.x.x as dependencies.
the openssl library links in /usr/local/lib going to clash as to are any applications that are distributed with the library.