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

Precompiling packages that have path manipulations #5802

Closed
timholy opened this issue Feb 13, 2014 · 4 comments · Fixed by #5821
Closed

Precompiling packages that have path manipulations #5802

timholy opened this issue Feb 13, 2014 · 4 comments · Fixed by #5821

Comments

@timholy
Copy link
Sponsor Member

timholy commented Feb 13, 2014

Trying to precompile packages like HDF5 and ImageView results in errors:

ERROR: LoadError("/usr/local/julia/julia/base/sysimg.jl",250,LoadError("/usr/local/julia/julia/base/userimg.jl",3,LoadError("/usr/local/julia/julia-packages/v0.3/HDF5/src/HDF5.jl",1,MethodError(haskey,(ObjectIdDict({#undef,#undef,#undef,#undef,#undef,#undef,:SOURCE_PATH,#undef,#undef,#undef,#undef,#undef,#undef,#undef,#undef,#undef,#undef,#undef,#undef,#undef,#undef,#undef,#undef,#undef,#undef,#undef,#undef,#undef,#undef,#undef,#undef,#undef}),:SOURCE_PATH)))))

At least in the case of ImageView, I could solve it by commenting-out the first line of ImageView.jl, which is

include(joinpath(Pkg.dir(),"ImageView","test","testimages.jl"))

and which loads a secondary module called TestImages.

With HDF5, I bet the issue is that JLD is also a secondary module, but I haven't tested.

I could just split TestImages and JLD out into their own packages, if that's the best solution. But I thought I'd raise the issue.

@JeffBezanson
Copy link
Sponsor Member

The functionality discussed in #5746 will probably fix this. I think the problem is that the old Base module is still "used" by Main after loading the new Base.

@JeffBezanson
Copy link
Sponsor Member

(not idle speculation, I actually tried it)

@timholy
Copy link
Sponsor Member Author

timholy commented Feb 14, 2014

Cool! I won't worry about doing surgery on my packages, then.

JeffBezanson added a commit that referenced this issue Feb 14, 2014
make the Core.Main binding non-constant, so uses of "Main" in general
refer to the *current* Main. Doing "import Main" will give you a
constant reference to the Main at that time.

fixes #5802

related to #1195
@timholy
Copy link
Sponsor Member Author

timholy commented Feb 16, 2014

Yay! Many thanks!

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