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

Extensions do not load properly with --compiled-modules=no #47921

Closed
KristofferC opened this issue Dec 19, 2022 · 0 comments · Fixed by #47927
Closed

Extensions do not load properly with --compiled-modules=no #47921

KristofferC opened this issue Dec 19, 2022 · 0 comments · Fixed by #47927
Assignees
Milestone

Comments

@KristofferC
Copy link
Member

KristofferC commented Dec 19, 2022

Run julia with --compiled-modules=no and run:

julia> using Pkg; Pkg.activate(; temp=true); Pkg.add(["PGFPlotsX", "Colors"]); using PGFPlotsX; using Colors
 Activating new project at `/tmp/jl_SycxIQ`
    Updating registry at `~/.julia/registries/General`
    Updating git-repo `https://github.com/JuliaRegistries/General`
   Resolving package versions...
   Installed PGFPlotsX ─ v1.5.2
    Updating `/tmp/jl_SycxIQ/Project.toml`
  [5ae59095] + Colors v0.12.10
  [8314cec4] + PGFPlotsX v1.5.2
    Updating `/tmp/jl_SycxIQ/Manifest.toml`
  [dce04be8] + ArgCheck v2.3.0
...
┌ Error: Error during loading of extension
│   exception =1-element ExceptionStack:
│    LoadError: UndefVarError: `Colorant` not defined
│    Stacktrace:
│      [1] getproperty(x::Module, f::Symbol)
│        @ Base ./Base.jl:31
│      [2] top-level scope
│        @ ~/.julia/packages/PGFPlotsX/MBXhp/ext/ColorsExt.jl:7
│      [3] include
│        @ ./Base.jl:451 [inlined]
│      [4] _require(pkg::Base.PkgId, env::Nothing)
│        @ Base ./loading.jl:1657
│      [5] _require_prelocked(uuidkey::Base.PkgId, env::Nothing)
│        @ Base ./loading.jl:1482
│      [6] _require_prelocked(uuidkey::Base.PkgId)
│        @ Base ./loading.jl:1480
│      [7] macro expansion
│        @ ./lock.jl:267 [inlined]
│      [8] require(uuidkey::Base.PkgId)
│        @ Base ./loading.jl:1477

The failure occurs at https://github.com/KristofferC/PGFPlotsX.jl/blob/640377b9c6a9a3f96702e6d34259337aa23828b1/ext/ColorsExt.jl#L7.

It seems we are trying to load the extension too early, before Colors have been fully loaded and has had its symbols populated.

@vtjnash, I might need some help here. If I do e.g. using Colors, then it will start loading its dependencies which triggers checking of extensions. I use Base.loaded_modules to check if a package is loaded but that is apparently not correct since Colors is in that dictionary before it has been properly loaded. Is there a check I can do on a package module to see if it has actually finished loading?

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

Successfully merging a pull request may close this issue.

1 participant