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

Docker image creation fails for julia 1.9 due to pkgdefaults.jl #667

Closed
maxstb opened this issue Jul 30, 2023 · 2 comments · Fixed by #671
Closed

Docker image creation fails for julia 1.9 due to pkgdefaults.jl #667

maxstb opened this issue Jul 30, 2023 · 2 comments · Fixed by #671

Comments

@maxstb
Copy link

maxstb commented Jul 30, 2023

Hello everyone,

I'm running a Docker where I use Unitful as a dependency. Unfortunately, I cannot update to Julia 1.9 since the system image creation fails due to a line in pkgdefaults.jl. Every other (older) Julia version works perfectly fine.

In v.1.15.0 the Line 309 with

@doc @doc(L) l

Leads to the following error:

ERROR: LoadError: UndefRefError: access to undefined reference
Step #5: Stacktrace:
Step #5:   [1] getproperty
Step #5:     @ ./Base.jl:37 [inlined]
Step #5:   [2] getindex
Step #5:     @ ./refvalue.jl:56 [inlined]
Step #5:   [3] docm(source::LineNumberNode, mod::Module, ex::Any)
Step #5:     @ Base.Docs ./docs/Docs.jl:522
Step #5:   [4] var"@doc"(__source__::LineNumberNode, __module__::Module, x::Vararg{Any})
Step #5:     @ Core ./boot.jl:539
Step #5:   [5] include(mod::Module, _path::String)
Step #5:     @ Base ./Base.jl:457
Step #5:   [6] include(x::String)
Step #5:     @ Unitful ~/.julia/packages/Unitful/QEYHc/src/Unitful.jl:1
Step #5:   [7] top-level scope
Step #5:     @ ~/.julia/packages/Unitful/QEYHc/src/Unitful.jl:69
Step #5:   [8] include
Step #5:     @ ./Base.jl:457 [inlined]
Step #5:   [9] _require(pkg::Base.PkgId, env::String)
Step #5:     @ Base ./loading.jl:1836
Step #5:  [10] _require_prelocked(uuidkey::Base.PkgId, env::String)
Step #5:     @ Base ./loading.jl:1660
Step #5:  [11] macro expansion
Step #5:     @ ./loading.jl:1648 [inlined]
Step #5:  [12] macro expansion
Step #5:     @ ./lock.jl:267 [inlined]
Step #5:  [13] require(into::Module, mod::Symbol)
Step #5:     @ Base ./loading.jl:1611
Step #5:  [14] include
Step #5:     @ ./Base.jl:457 [inlined]
Step #5:  [15] _require(pkg::Base.PkgId, env::String)
Step #5:     @ Base ./loading.jl:1836
Step #5:  [16] _require_prelocked(uuidkey::Base.PkgId, env::String)
Step #5:     @ Base ./loading.jl:1660
Step #5:  [17] macro expansion
Step #5:     @ ./loading.jl:1648 [inlined]
Step #5:  [18] macro expansion
Step #5:     @ ./lock.jl:267 [inlined]
Step #5:  [19] require(into::Module, mod::Symbol)
Step #5:     @ Base ./loading.jl:1611
Step #5:  [20] include
Step #5:     @ ./Base.jl:457 [inlined]
Step #5:  [21] _require(pkg::Base.PkgId, env::Nothing)
Step #5:     @ Base ./loading.jl:1836
Step #5:  [22] _require_prelocked(uuidkey::Base.PkgId, env::Nothing)
Step #5:     @ Base ./loading.jl:1660
Step #5:  [23] _require_prelocked
Step #5:     @ ./loading.jl:1658 [inlined]
Step #5:  [24] macro expansion
Step #5:     @ ./lock.jl:267 [inlined]
Step #5:  [25] require(uuidkey::Base.PkgId)
Step #5:     @ Base ./loading.jl:1655
Step #5:  [26] top-level scope
Step #5:     @ /tmp/jl_8F4dIfgzsL:11
Step #5: in expression starting at /root/.julia/packages/Unitful/QEYHc/src/pkgdefaults.jl:309
Step #5: in expression starting at /root/.julia/packages/Unitful/QEYHc/src/pkgdefaults.jl:309
Step #5: in expression starting at /root/.julia/packages/Unitful/QEYHc/src/Unitful.jl:1

Unfortunately, I cannot reproduce this for a normal precompilation and I therefore don't know how to provide a MWE...

@sostock
Copy link
Collaborator

sostock commented Aug 1, 2023

Disclaimer: I haven’t tried this myself (I have never used Docker).

This should be fixed by JuliaLang/julia#48594 (the PR even mentions this usecase), so it should work1 in Julia 1.10. Can you confirm that it works in Julia 1.10-beta1?

We could work around this by duplicating the Unitful.L docstring in the code instead of using @doc(L) to look it up. The same applies to ε0 and angstrom.

Footnotes

  1. where “work” means that it doesn’t error, but Unitful.l, Unitful.ϵ0, and Unitful.Å get empty docstrings

@maxstb
Copy link
Author

maxstb commented Aug 1, 2023

Hey, thanks for the quick reply. Created a pull request that should address that issue. Couldn't test it out yet with julia-1.10 since there seems to be an issue with my current code base and the newest alpha release.

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