JuliaLang / Pkg.jl

Pkg - Package manager for the Julia programming language
https://pkgdocs.julialang.org
Other
610 stars 251 forks source link

Bad resolve if different build metadata versions have different dependencies #3795

Open mortenpi opened 4 months ago

mortenpi commented 4 months ago

Not 100% clear I understand everything here, but it looks like a bug to me:

Consider the following (valid) Manifest (+all the deps; full MWE environment in this gist; can almost be recreated with pkg> add Wayland_jll#Wayland-v1.21.0+0):

[[deps.Wayland_jll]]
deps = ["Artifacts", "Expat_jll", "JLLWrappers", "Libdl", "Libffi_jll", "Pkg", "XML2_jll"]
git-tree-sha1 = "ed8d92d9774b077c53e1da50fd81a36af3744c1c"
uuid = "a2964d1f-97da-50d4-b82a-358c7fce9d89"
version = "1.21.0+0"

when resolving this manifest (including on 1.11.0-DEV.1593 (2024-02-14)), you end up with this diff:

+[[deps.EpollShim_jll]]
+deps = ["Artifacts", "JLLWrappers", "Libdl"]
+git-tree-sha1 = "8e9441ee83492030ace98f9789a654a6d0b1f643"
+uuid = "2702e6a9-849d-5ed8-8c21-79e8b8f9ee43"
+version = "0.0.20230411+0"
+

 [[deps.Wayland_jll]]
-deps = ["Artifacts", "Expat_jll", "JLLWrappers", "Libdl", "Libffi_jll", "Pkg", "XML2_jll"]
+deps = ["Artifacts", "EpollShim_jll", "Expat_jll", "JLLWrappers", "Libdl", "Libffi_jll", "Pkg", "XML2_jll"]
 git-tree-sha1 = "ed8d92d9774b077c53e1da50fd81a36af3744c1c"
 uuid = "a2964d1f-97da-50d4-b82a-358c7fce9d89"
 version = "1.21.0+0"

The Wayland_jll version does not get updated, but EpollShim_jll gets added as a new dependency, leading to an invalid manifest. This is because Wayland_jll added EpollShim_jll as a dependency when going from 1.21.0+0 -> 1.21.0+1.

Not really sure whose "fault" it is here, but it feels like Pkg should not generate invalid manifests, even if there's the build metadata magic happening. Instead, it should either update the version or don't update dependency list.

X-ref: https://github.com/JuliaLang/Pkg.jl/issues/1568