Open dcarley opened 2 months ago
I'm not sure this is a clear cut bug. In semver, if you want any version where major is 5, then you can say @5
and it will match any 5.x
and I think that is correct behavior? If you truly want 5.0, you can say @5.0
or @5.0.0
and get it.
So in that sense I'm not 100% confident we really want @5.8
to only ever match 5.8.0
. I think allowing it to match 5.8.0
, 5.8.1
, 5.8.4
, etc is correct, with the preference towards the latest revision based on the resolution. In the above if you truly wanted the third option for zsh
you could specify @5.8.0
and get it.
IMO all this is correct. The only thing that is off a bit to me is that in my head at least, you could take and of the line items from flox show
and install them as displayed and get exactly that. But that doesn't track well with semver, so I'm not sure how to reconcile that, aside from documentation?
The behaviour does match our docs for version but like you say it doesn't jive well with being able to take the results of flox show
and I hadn't thought to look at the docs when I encountered it. What was most surprising for me was that it proceeded silently with a different version than I "specified" so maybe it would be appropriate to warn either a) when X.Y
is resolved differently to X.Y.0
, or b) when any wildcard is resolved to true semver?
needs design - can we resolve exact matches and fall back to semver?
I think it might be more consistent with some other tools to instead require =
if you want an exact version. And if we're concerned about copy paste from flox show
, we could print
% flox show hello
hello - A program that produces a familiar, friendly greeting
hello@=2.12.1
hello@=2.12
hello@=2.10
I like that solution. I think it's both consistent with other tooling and also guides users to the syntax to get what they would likely expect if they didn't know any better. And if the do know better, all the options are available to them. Side note that I don't think this is working as expected today. This will need to be addressed as well as part of this. Unsure if this is a catalog server or request issue, however it's probably the catalog.
bill@Bill-FloxDev:~/prj/testing/foo5
$ flox install hello@2.12
✅ 'hello' installed to environment 'foo5'
bill@Bill-FloxDev:~/prj/testing/foo5
$ flox list
hello: hello (2.12.1)
bill@Bill-FloxDev:~/prj/testing/foo5
$ flox uninstall hello
🗑️ 'hello' uninstalled from environment 'foo5'
bill@Bill-FloxDev:~/prj/testing/foo5
$ flox install hello@=2.12
✅ 'hello' installed to environment 'foo5'
bill@Bill-FloxDev:~/prj/testing/foo5
$ flox list
hello: hello (2.12.1)
bill@Bill-FloxDev:~/prj/testing/foo5
$ flox edit
⚠️ No changes made to environment.
bill@Bill-FloxDev:~/prj/testing/foo5
$ flox uninstall hello
🗑️ 'hello' uninstalled from environment 'foo5'
bill@Bill-FloxDev:~/prj/testing/foo5
$ flox install hello@==2.12
✅ 'hello' installed to environment 'foo5'
bill@Bill-FloxDev:~/prj/testing/foo5
$ flox list
hello: hello (2.12.1)
bill@Bill-FloxDev:~/prj/testing/foo5 $ flox uninstall hello
🗑️ 'hello' uninstalled from environment 'foo5'
bill@Bill-FloxDev:~/prj/testing/foo5
$ flox install hello@2.10
✅ 'hello' installed to environment 'foo5'
bill@Bill-FloxDev:~/prj/testing/foo5
$ flox list
hello: hello (2.10)
bill@Bill-FloxDev:~/prj/testing/foo5
$ flox install hello@=2.12
⚠️ Package with id 'hello' already installed to environment 'foo5'
bill@Bill-FloxDev:~/prj/testing/foo5
$ flox uninstall hello
🗑️ 'hello' uninstalled from environment 'foo5'
bill@Bill-FloxDev:~/prj/testing/foo5
$ flox install hello@=2.12
✅ 'hello' installed to environment 'foo5'
bill@Bill-FloxDev:~/prj/testing/foo5
$ flox edit
⚠️ No changes made to environment.
bill@Bill-FloxDev:~/prj/testing/foo5
$ flox list
hello: hello (2.12.1)
bill@Bill-FloxDev:~/prj/testing/foo5
$ flox uninstall hello && flox install hello@2.12.0
🗑️ 'hello' uninstalled from environment 'foo5'
✅ 'hello' installed to environment 'foo5'
bill@Bill-FloxDev:~/prj/testing/foo5
$ flox list
hello: hello (2.12)
I like that solution @mkenigs!
Describe the bug:
Unable to install a package at version X.Y when a version is also available at X.Y.Z
This a catalog-server bug, rather than a CLI parsing bug, but I've filed it here for visibility. Minimal reproduction:
Steps to reproduce:
flox install hello@2.12
flox list
The same can be reproduced with
zsh
which also publishes X.Y and X.Y.Z:Result:
Expected:
Flox Version (run
flox --version
if possible): 1.2.3 @ de6557d1uname -a
output: N/A