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

Renamed submodules does not play well with precompilation #39405

Closed
fredrikekre opened this issue Jan 26, 2021 · 0 comments · Fixed by #39408
Closed

Renamed submodules does not play well with precompilation #39405

fredrikekre opened this issue Jan 26, 2021 · 0 comments · Fixed by #39408
Assignees
Labels
bug Indicates an unexpected problem or unintended behavior modules
Milestone

Comments

@fredrikekre
Copy link
Member

This package code:

module ForgetImports

    import Pkg.PlatformEngines as pe
    import Pkg as p

    function test()
        println("Pkg = ", p)
    end

    function test2()
        println("PlatformEngines = ", pe)
    end

end # module

results in the following error if the module is precompiled

$ julia -q
julia> using ForgetImports

julia> ForgetImports.test()
Pkg = Pkg

julia> ForgetImports.test2()
ERROR: UndefVarError: pe not defined
Stacktrace:
 [1] test2()
   @ ForgetImports /tmp/tmp.wXr6KYv8f2/ForgetImports/src/ForgetImports.jl:11
 [2] top-level scope
   @ REPL[3]:1

Works fine without precompilation:

$ julia --compiled-modules=no -q                           
julia> using ForgetImports

julia> ForgetImports.test()
Pkg = Pkg

julia> ForgetImports.test2()
PlatformEngines = Pkg.PlatformEngines

(Tentatively putting on 1.6 milestone since the rename feature is new for 1.6).

@fredrikekre fredrikekre added this to the 1.6 blockers milestone Jan 26, 2021
@JeffBezanson JeffBezanson self-assigned this Jan 26, 2021
@JeffBezanson JeffBezanson added the bug Indicates an unexpected problem or unintended behavior label Jan 26, 2021
@KristofferC KristofferC mentioned this issue Jan 27, 2021
60 tasks
KristofferC pushed a commit that referenced this issue Jan 29, 2021
KristofferC pushed a commit that referenced this issue Feb 1, 2021
staticfloat pushed a commit that referenced this issue Dec 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior modules
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants