Pkg.jl icon indicating copy to clipboard operation
Pkg.jl copied to clipboard

Initialy display of possible versions doesn't take into account yanked versions

Open oxinabox opened this issue 2 years ago • 1 comments

Consider:

(jl_ykwcvm) pkg> add [email protected]
   Resolving package versions...
ERROR: Unsatisfiable requirements detected for package KernelAbstractions [63c18a36]:
 KernelAbstractions [63c18a36] log:
 ├─possible versions are: 0.1.0 - 0.9.17 or uninstalled
 └─restricted to versions 0.9.16 by an explicit requirement — no versions left

KernelAbstractions v0.9.16 was yanked. The correct display is: possible versions are: 0.1.0 - 0.9.15, 0.9.17 or uninstalled

I think the problem is here https://github.com/JuliaLang/Pkg.jl/blob/1f16df404a2fbe8642ea3eecc9f4d7064c400a73/src/Resolve/graphtype.jl#L625C21-L625C59

It does: range_compressed_versionspec(versions) but I think it should do range_compressed_versionspec(versions, [ver.v for ver in ... if !ver.isyanked]) but idk what goes in the ...

I wrote this display code (a long time ago), It is smart enough to know about skipped over versions if you tell it about them. I think that should work for yanked versions too

oxinabox avatar Feb 28 '24 02:02 oxinabox

but I think it should do range_compressed_versionspec(versions, [ver.v for ver in ... if !ver.isyanked])

To me, filtering out yanked versions should already have happened at this stage in https://github.com/JuliaLang/Pkg.jl/blob/1f16df404a2fbe8642ea3eecc9f4d7064c400a73/src/Operations.jl#L532 so that the resolver only has non-yanked versions as input.

KristofferC avatar Apr 17 '24 08:04 KristofferC

What goes into the resolver is:

"KernelAbstractions" => VersionNumber[v"0.1.0", v"0.1.1", v"0.1.2", v"0.1.3", v"0.1.4", v"0.1.5", v"0.1.6", v"0.2.0", v"0.2.1", v"0.2.2", v"0.2.3", v"0.2.4", v"0.2.5", v"0.2.6", v"0.3.0", v"0.3.1", v"0.3.2", v"0.3.3", v"0.4.0", v"0.4.1", v"0.4.2", v"0.4.3", v"0.4.4", v"0.4.5", v"0.4.6", v"0.5.0", v"0.5.1", v"0.5.2", v"0.5.3", v"0.5.4", v"0.5.5", v"0.6.0", v"0.6.1", v"0.6.2", v"0.6.3", v"0.7.0", v"0.7.1", v"0.7.2", v"0.7.3", v"0.8.0", v"0.8.1", v"0.8.2", v"0.8.3", v"0.8.4", v"0.8.5", v"0.8.6", v"0.9.0", v"0.9.1", v"0.9.2", v"0.9.3", v"0.9.4", v"0.9.5", v"0.9.6", v"0.9.8", v"0.9.9", v"0.9.10", v"0.9.12", v"0.9.13", v"0.9.14", v"0.9.15", v"0.9.17", v"0.9.18", v"0.9.19", v"0.9.20", v"0.9.21", v"0.9.22", v"0.9.23", v"0.9.24", v"0.9.25", v"0.9.26", v"0.9.27", v"0.9.28", v"0.9.29", v"0.9.30", v"0.9.31", v"0.9.32", v"0.9.33", v"0.9.34", v"0.9.35", v"0.9.36"]
ERROR: Unsatisfiable requirements detected for package KernelAbstractions [63c18a36]:
 KernelAbstractions [63c18a36] log:
 ├─possible versions are: 0.1.0 - 0.9.36 or uninstalled
 └─restricted to versions 0.9.16 by an explicit requirement — no versions left

We can see that the 0.9.16 version is missing from that list. So this has nothing to do with yanking, it is just the way that resolver errors are printed.

KristofferC avatar Jul 04 '25 13:07 KristofferC

yes, read the top post again. This issue has always been about what is printed. Its not about what is going into the resolver.

oxinabox avatar Jul 06 '25 06:07 oxinabox

What's the difference between a yanked version and a non existing version? They are currently treated the same.

KristofferC avatar Jul 06 '25 08:07 KristofferC

range_compressed_versionspec(versions, [ver.v for ver in ... if !ver.isyanked])

There are no yanked versions that the resolver knows about so that check doesn't make sense to me.

KristofferC avatar Jul 06 '25 08:07 KristofferC


0.1.0 - 0.9.17 or uninstalled
 └─restricted to versions 0.9.16 by an explicit requirement — no versions left

The top range includes 0.9.16 but below says it doesn't exist.

IanButterworth avatar Jul 06 '25 09:07 IanButterworth

As a user who knows 0.9.16 existed, stating the above range then saying it doesn't exist when it falls in that range doesn't make sense.

We need to acknowledge the yank.

IanButterworth avatar Jul 06 '25 09:07 IanButterworth

The range doesn't mean every single version possible within that range exists (that's an infinite number of versions) . The error message is just like if someone would have skipped a version.

Again, the resolver has no concept of yanked versions because those are filtered out a an earlier stage.

So please rephrase the request here to make sense.

KristofferC avatar Jul 06 '25 10:07 KristofferC

To be explicit:

(@v1.12) pkg> add [email protected]
    Updating registry at `~/.julia/registries/General.toml`
   Resolving package versions...
ERROR: Unsatisfiable requirements detected for package Crayons [a8cc5b0e]:
 Crayons [a8cc5b0e] log:
 ├─possible versions are: 0.5.0 - 4.1.1 or uninstalled
 └─restricted to versions 3.1.1000 by an explicit requirement — no versions left

Crayons has no yanked versions AFAIU.

KristofferC avatar Jul 06 '25 10:07 KristofferC

That's fine when you declare a version that never existed but when you have a version in a manifest that did exist and falls within the declared range, it needs to be explained that the version no longer exists.

IanButterworth avatar Jul 06 '25 10:07 IanButterworth

Or forget the manifest, if you just know that version used to exist it can be confusing.

IanButterworth avatar Jul 06 '25 10:07 IanButterworth

I.e. it currently gaslights you that the version never existed

IanButterworth avatar Jul 06 '25 10:07 IanButterworth

We can do a lookup before even resolving for any versions that are fully qualified with @x.y.z and say if it doesn't exist (or is yanked).

KristofferC avatar Jul 06 '25 11:07 KristofferC

That sounds good

IanButterworth avatar Jul 06 '25 11:07 IanButterworth