Closed fredrikekre closed 1 month ago
Simpler repo:
❯ rm -rf ~/.julia/compiled/v1.12/Graphs ~/.julia/compiled/v1.12/LightGraphs ~/.julia/compiled/v1.12/Metis*
❯ julia --project=test -e 'using Pkg; Pkg.precompile(; timing=true)'
Precompiling all packages...
716.4 ms ✓ Metis
2137.6 ms ✓ LightGraphs
2301.4 ms ✓ Graphs
894.8 ms ✓ SimpleWeightedGraphs
1095.7 ms ✓ Metis → MetisLightGraphs
5 dependencies successfully precompiled in 3 seconds. 50 already precompiled.
❯ julia --project=test -e 'using Metis, Graphs'
Precompiling MetisGraphs...
1 dependency successfully precompiled in 1 seconds. 53 already precompiled.
I think this is because of the fake dependency that gets introduced in
which causes
to fail.
And yes, as I expected if the above reasoning was true, https://github.com/JuliaLang/julia/pull/53972 fixes this:
~/JuliaPkgs/Metis.jl fe/precompile-bug
❯ rm -rf ~/.julia/compiled/v1.12/Graphs ~/.julia/compiled/v1.12/LightGraphs ~/.julia/compiled/v1.12/Metis*
~/JuliaPkgs/Metis.jl fe/precompile-bug
❯ julia --project=test -e 'include("/home/kc/julia/base/precompilation.jl"); Precompilation.precompilepkgs(; timing=true)'
Precompiling all packages...
671.4 ms ✓ Metis
1902.9 ms ✓ LightGraphs
2112.5 ms ✓ Graphs
622.0 ms ✓ Metis → MetisLightGraphs
637.8 ms ✓ Metis → MetisGraphs
700.0 ms ✓ SimpleWeightedGraphs
596.9 ms ✓ Metis → MetisSimpleWeightedGraphs
7 dependencies successfully precompiled in 4 seconds. 51 already precompiled.
~/JuliaPkgs/Metis.jl fe/precompile-bug
❯ julia --project=test -e 'using Metis, Graphs'
~/JuliaPkgs/Metis.jl fe/precompile-bug
❯
Checkout this branch: https://github.com/JuliaSparse/Metis.jl/tree/fe/precompile-bug
Notice that the
MetisGraphs
andMetisSimpleWeightedGraphs
extensions were missed in the original precompile command and only precompiled when loading the trigger packages in the test script.