Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(1.10) ] precompile does not understand extension triggers in [deps] #4095

Open
topolarity opened this issue Nov 24, 2024 · 0 comments
Open
Milestone

Comments

@topolarity
Copy link
Member

You also hit that error if you only add a symmetric extension Parent → DepWithParentExtExt:

diff --git a/test/project/Extensions/Parent.jl/Project.toml b/test/project/Extensions/Parent.jl/Project.toml
index a79ec8859b..9119864a47 100644
--- a/test/project/Extensions/Parent.jl/Project.toml
+++ b/test/project/Extensions/Parent.jl/Project.toml
@@ -4,3 +4,6 @@ version = "0.1.0"

 [deps]
 DepWithParentExt = "8a35c396-5ffc-40d2-b7ec-e8ed2248da32"
+
+[extensions]
+DepWithParentExtExt = "DepWithParentExt"
diff --git a/test/project/Extensions/Parent.jl/ext/DepWithParentExtExt.jl b/test/project/Extensions/Parent.jl/ext/DepWithParentExtExt.jl
new file mode 100644
index 0000000000..c9232efcbd
--- /dev/null
+++ b/test/project/Extensions/Parent.jl/ext/DepWithParentExtExt.jl
@@ -0,0 +1,6 @@
+module DepWithParentExtExt
+
+using DepWithParentExt
+using Parent
+
+end

That diff introduces an extension "cycle" of the kind that doesn't exist on 1.11, but is a cycle on 1.10.

We don't even get to print our warning though:

./julia --project=test/project/Extensions/tempenv -q
(tempenv) pkg> dev ./test/project/Extensions/DepWithParentExt.jl/ ./test/project/Extensions/Parent.jl/
   Resolving package versions...
    Updating `~/repos/julia/test/project/Extensions/tempenv/Project.toml`
  [8a35c396] + DepWithParentExt v0.1.0 `../DepWithParentExt.jl`
  [58cecb9c] + Parent v0.1.0 `../Parent.jl`
    Updating `~/repos/julia/test/project/Extensions/tempenv/Manifest.toml`
  [8a35c396] + DepWithParentExt v0.1.0 `../DepWithParentExt.jl`
  [58cecb9c] + Parent v0.1.0 `../Parent.jl`

(tempenv) pkg> precompile
ERROR: KeyError: key "DepWithParentExt" not found
Stacktrace:
  [1] getindex
    @ ./dict.jl:498 [inlined]
  [2] precompile(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; internal_call::Bool, strict::Bool, warn_loaded::Bool, already_instantiated::Bool, timing::Bool, _from_loading::Bool, kwargs::@Kwargs{io::Base.TTY})
    @ Pkg.API ~/repos/julia/usr/share/julia/stdlib/v1.10/Pkg/src/API.jl:1168
  [3] precompile(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.TTY, kwargs::@Kwargs{})
    @ Pkg.API ~/repos/julia/usr/share/julia/stdlib/v1.10/Pkg/src/API.jl:159
  [4] precompile(pkgs::Vector{Pkg.Types.PackageSpec})
    @ Pkg.API ~/repos/julia/usr/share/julia/stdlib/v1.10/Pkg/src/API.jl:148
  [5] precompile(pkgs::Vector{String})
    @ Pkg.API ~/repos/julia/usr/share/julia/stdlib/v1.10/Pkg/src/API.jl:147

Originally posted by @topolarity in #56675

Pkg is trying to look-up extension triggers in just [weakdeps] instead of both [deps] and [weakdeps]. This is not an issue on 1.11+, since the new ExplicitEnv code properly does the look-up properly

This is an important fix to get into 1.10, since our fix for JuliaLang/julia#56204 can sometimes force you to add triggers on [deps] instead of just [weakdeps]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant