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

Need to import QuartzImageIO, otherwise errors #58

Closed
ghost opened this issue Dec 6, 2019 · 5 comments
Closed

Need to import QuartzImageIO, otherwise errors #58

ghost opened this issue Dec 6, 2019 · 5 comments

Comments

@ghost
Copy link

ghost commented Dec 6, 2019

Using https://github.com/JuliaImages/TestImages.jl, if I don't manually import in QuartzImageIO into my own project/module, I get the following weird errors, whether or not I have QuartzImageIO as a dependency of my own project. (Note it complains of Base not having QuartzImageIO as a dependency.)

WARNING: eval into closed module __toplevel__:
Expr(:import, Expr(:., :QuartzImageIO))
  ** incremental compilation may be fatally broken for this module **

┌ Warning: Package Base does not have QuartzImageIO in its dependencies:
│ - If you have Base checked out for development and have
│   added QuartzImageIO as a dependency but haven't updated your primary
│   environment's manifest file, try `Pkg.resolve()`.
│ - Otherwise you may need to report an issue with Base
└ Loading QuartzImageIO into Base from project dependency, future warnings for Base are suppressed.
WARNING: eval into closed module FileIO:
:QuartzImageIO = Expr(:ref, Expr(:., :Base, :(:loaded_modules)), Base.PkgId(uuid=Base.UUID(value=UInt128(0xdca85d43d64c5e678c65017450d5d020)), name="QuartzImageIO"))
  ** incremental compilation may be fatally broken for this module **
@ghost
Copy link
Author

ghost commented Dec 6, 2019

On a simple test project I get this always when adding a dependency to the project (TestImages, ImageFiltering, etc.) without running Pkg.resolve(). But running it fixes the issue. However, not on my real project no matter how many times I run Pkg.resolve().

@goretkin
Copy link

goretkin commented Apr 27, 2020

I imagine you're seeing WARNING: eval into closed module this because your test project is being precompiled, and precompilation encounters FileIO.load, which triggers that import statement.

It's not an issue with QuartzImageIO.jl. Try __precompile__(false) to prevent precompilation, or move the expression causing the load into the body of the __init__ function.

@ghost
Copy link
Author

ghost commented Apr 27, 2020

Umm... the expression causing the error is import itself, which should not go into a function as far as I know. (How will anything else see the import unless __init__ has very special and apparently undocumented scoping?) Very weird that precompiling the module would load files. Everything else that uses TestImages, besides the import statement itself, is in a function, not called during load/precompilation.

@goretkin
Copy link

goretkin commented Apr 27, 2020

If you show your simple test project, it may clarify. I was assuming that in your test project you have something like

module TestProject
import TestImages: testimage
img = testimage("cameraman.tif")
end

And that that module is also a package.

When you do import TestProject, I would expect that you get the message WARNING: eval into closed module __toplevel__.

@johnnychen94
Copy link
Member

This is a similar issue to JuliaIO/FileIO.jl#283, the reason is that FileIO is lazy. So if you really need to load some image with FileIO, you need to add at least one image io backend to your project.

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

2 participants