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

Attempt to fix issue #2942

Open barche opened this issue 3 years ago • 10 comments

This basically skips an stdlib in deps_graph if it is no longer an stdlib in the current Julia version (and therefore doesn't exist). I'm not entirely sure I know what I'm doing :)

barche avatar Jan 29 '22 23:01 barche

How do we get the dependencies for that stdlib then, to put in the manifest?

KristofferC avatar Jan 30 '22 07:01 KristofferC

How do we get the dependencies for that stdlib then, to put in the manifest?

Good point, I moved the check to the if condition, so now it should continue on the else branch for ex-stdlibs and attempt to get these from the registry. For the libjulia_jll example in issue #2942 the outcome is the same, since the dependency of libjulia_jll on LibOSXUnwind_jll is only there in older (and thus "yanked" as far as I understand) versions of libjulia_jll.

barche avatar Jan 30 '22 12:01 barche

I don't know if the test failures here are my doing...

barche avatar Feb 06 '22 14:02 barche

I believe the MacOS failure is a flaky test. The other is fixed on master. You just need to rebase/update.

Is there a test that could be added?

IanButterworth avatar Feb 06 '22 20:02 IanButterworth

Regarding tests: the one package this affects right now is LibOSXUnwind_jll. So perhaps a test involving that could be added... perhaps trying to do "something" with libjulia_jll ? Sorry, I don't know enough about the test rig for Pkg.jl to make really sensible suggestions, just random ideas...

fingolfin avatar Feb 21 '22 08:02 fingolfin

Rebased and added test, which passes locally 🤞

barche avatar Feb 21 '22 23:02 barche

@IanButterworth any chance to get this merged in a way that it gets into Julia 1.8? Or is that too late already?

fingolfin avatar Feb 23 '22 22:02 fingolfin

Sorry, I've tried to understand this, but I can't. I think the logic here might need comments in the code. I requested @staticfloat's review who might be best placed to review?

It seems a reasonable thing to get into 1.8 IMO

IanButterworth avatar Feb 24 '22 03:02 IanButterworth

The change (line 431 in Operations.jl) checks if the dependency is still an stdlib in the current running version of Julia, since uuid_is_stdlib is true if the dependency was an stdlib in the targeted (older) version of Julia. If it is no longer and stdlib, it needs to be obtained from the repositories, which is done in the else branch. At least that is how I understand it ;)

barche avatar Feb 24 '22 04:02 barche

Sound like a great comment to add.

Also, might "download unavailable stdlibs during julia_version resolve" be a descriptive name for this PR?

IanButterworth avatar Feb 24 '22 04:02 IanButterworth