-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Regression in 1.9.0-rc2 compared to 1.9.0-rc1 (weak dependencies not loaded correctly at precompilation?) #49250
Comments
The weakdep must be an explicit dependency, or you cannot depend on when it will eventually be loaded |
It looks to me like it is an explicit dependency: https://github.com/ranocha/SummationByPartsOperators.jl/blob/f0b37d29e1fd9ae27b7acc97b38adc85a12960cd/Project.toml#L22-L23 |
The package it depends on is StaticArrayInterfaceStaticArraysExt |
But you can't depend directly on an extension package can you? |
So SummationByPartsOperators.jl needs to depend on the internal implementation detail StaticArrayInterfaceStaticArraysExt included in StaticArrayInterface.jl? How can I do that? (Is this even a good idea given that this is an implementation detail of StaticArrayInterface.jl?) |
We stopped loading extensions during precompilation. Putting that back fixes this. |
I can install the package SummationByPartsOperators.jl without problems on Julia 1.9.0-rc1
However, the package cannot be precompiled on Julia 1.9.0-rc2. Full output:
The stacktrace shows that the calls to
static_length
from StaticArrayInterface.jl in linehttps://github.com/ranocha/SummationByPartsOperators.jl/blob/f0b37d29e1fd9ae27b7acc97b38adc85a12960cd/src/periodic_operators.jl#LL57C87-L57C112
return an
Int
instead of the desiredStaticInt
when given anSVector
from StaticArrays.jl as argument.StaticArrayInterface.jl uses a weak dependency to load the required code when StaticArrays.jl is present, see
https://github.com/JuliaArrays/StaticArrayInterface.jl/blob/7a8988436b82e9cdff2d2e59d5e75d0204d118a9/Project.toml#L27
SummationByPartsOperators.jl requires this code to be loaded to work correctly. In particular, it needs to be loaded at precompile time to precompile workloads and benefit from the massive improvements in Julia v1.9. Based on the stacktrace above, it looks like the weak dependency of StaticArrayInterface.jl is not loaded correctly in Julia 1.9.0-rc2 while everything is fine with Julia 1.9.0-rc1.
I have seen something similar before when using Requires.jl on Julia v1.8, see https://discourse.julialang.org/t/how-to-load-requires-jl-code-of-dependency-while-precompiling/95962.
My best guess is that this change of behavior was introduced by #48674, see
julia/base/loading.jl
Lines 1672 to 1675 in 93df7e2
The text was updated successfully, but these errors were encountered: