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

Strange BoundsError when trying to import Compose in userimg.jl #16970

Closed
tkelman opened this issue Jun 16, 2016 · 8 comments
Closed

Strange BoundsError when trying to import Compose in userimg.jl #16970

tkelman opened this issue Jun 16, 2016 · 8 comments

Comments

@tkelman
Copy link
Contributor

tkelman commented Jun 16, 2016

Linux x86_64, 4accf8a - you'll need to check out Compose to latest master to avoid an unrelated syntax error on 0.5.

tkelman@nanosoldier1:~/Julia/julia-0.5$ echo 'import Compose' > base/userimg.jl
tkelman@nanosoldier1:~/Julia/julia-0.5$ make > /dev/null
WARNING: Method definition (::Type{#T<:Any})(Any) in module Inference at coreimg.jl:48 overwritten in module Base at sysimg.jl:60.

<a bunch of deprecation warnings that are no longer fatal and hopefully don't matter here>

LoadError("sysimg.jl",373,LoadError("/home/tkelman/Julia/julia-0.5/base/userimg.jl",1,LoadError("/home/tkelman/.julia/v0.5/Compose/src/Compose.jl",174,BoundsError(String[],(1,)))))
make[1]: *** [/home/tkelman/Julia/julia-0.5/usr/lib/julia/sys.o] Error 1
make: *** [julia-sysimg-release] Error 2

I feel like this may have worked once upon a time, before __precompile__ existed? Though I get the same basic error on 0.4, and trying to go back to older versions of Compose doesn't change much either. It works outside of userimg, so what's happening here?

@vtjnash
Copy link
Sponsor Member

vtjnash commented Jun 16, 2016

it looks like it's trying to call Pkg.installed which is wrong, broken, and not going to work

@tkelman
Copy link
Contributor Author

tkelman commented Jun 16, 2016

Sure, but why the BoundsError?

@ViralBShah
Copy link
Member

Is Pkg.installed itself broken, or that we shouldn't be calling it at all? I suspect it is the latter.

@ViralBShah
Copy link
Member

Cc @shashi

@vtjnash
Copy link
Sponsor Member

vtjnash commented Jun 17, 2016

I suspect that it is semi-intentionally broken because you should never be calling into Pkg from non-Pkg code

@shashi
Copy link
Contributor

shashi commented Jun 17, 2016

What do you suggest Compose should do here?

https://github.com/dcjones/Compose.jl/blob/09a85af07ed030235ec56e806fdbc3141060e77f/src/Compose.jl#L174-L208

It uses Pkg.installed to load code conditionally if Cairo and Fontconfig are installed. I suspect the answer is "Don't do it", or make "Compose pull both packages"...?

@tkelman
Copy link
Contributor Author

tkelman commented Jun 17, 2016

The only reliable way to do optional dependencies and precompilation right now is to separate the code that depends on both packages being present into a third package that can unconditionally depend on both. Until extern gets implemented, anyway.

@tkelman
Copy link
Contributor Author

tkelman commented Sep 16, 2016

closing in favor of moving to GiovineItalia/Compose.jl#221

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

No branches or pull requests

4 participants