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

Precompiled module loading issue #25604

Closed
martinholters opened this issue Jan 17, 2018 · 2 comments · Fixed by #25613
Closed

Precompiled module loading issue #25604

martinholters opened this issue Jan 17, 2018 · 2 comments · Fixed by #25613

Comments

@martinholters
Copy link
Member

Given a package

__precompile__()
module Foo
using ProgressMeter
using DataStructures
end

I see

julia> using Foo
┌ Warning: Replacing module `Compat`
└ @ Base loading.jl:350

once Foo has been precompiled (but in a fresh Julia session). I don't think this is specific to PorgressMeter and DataStructures, they just happen to both depend on the same package (Compat) and be loadable on current master. However, it does look like the packages have to be registered.

While this is more or less just an annoyance, I guess the same underlying problem is responsible for something more severe. Consider the package (which unfortunately depends on some patches to FFTW to make it loadable):

__precompile__()
module Foo
using AbstractFFTs
using FFTW
foo() = fft([1])
end

Loading this for the first time, I get

julia> using Foo
[ Info: Recompiling stale cache file /tmp/julia/lib/v0.7/Foo.ji for module Foo

julia> Foo.foo()
# a bunch of deprecation warnings
1-element Array{Complex{Float64},1}:
 1.0 + 0.0im

Repeating (in a fresh session), I get

julia> using Foo
┌ Warning: Replacing module `Compat`
└ @ Base loading.jl:350
┌ Warning: Replacing module `AbstractFFTs`
└ @ Base loading.jl:350

julia> Foo.foo()
WARNING: both AbstractFFTs and FFTW export "fft"; uses of it in module Foo must be qualified
ERROR: UndefVarError: fft not defined
Stacktrace:
 [1] foo() at /tmp/julia/Foo/src/Foo.jl:5
 [2] top-level scope

(Note that FFTW imports AbstractFFTs.fft.)

@martinholters
Copy link
Member Author

Bisection points to f532093, CC @vtjnash

@StefanKarpinski
Copy link
Sponsor Member

I've been seeing this too on #25455 but I thought that it was some change on that branch.

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.

2 participants