-
Notifications
You must be signed in to change notification settings - Fork 187
Make PyCall.jl AOT-compilable #651
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
Conversation
empty!(pycall_gc) | ||
empty!(pyexc) | ||
empty!(pytype_queries) | ||
empty!(permanent_strings) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
write(joinpath(@__DIR__, "_julia_path"), Base.julia_cmd().exec[1]) | ||
|
||
@info "System image: $pysysout" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This all seems like boilerplate — why does PyCall.jl need a custom compile.jl
file? Can't PackageCompiler automate this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Snoop in PackageCompiler does not work due to JuliaLang/julia#31156 (a bug in Julia?). There is another "latent" issue JuliaLang/PackageCompiler.jl#192. I think PackageCompiler is still rather a moving target so using lower-level API with a bit of boilerplate makes sense. Another upside is that we can control exactly what functions are included in system image by tweaking code in aot/precompile.jl
(although it is rather sparse and random ATM).
Rebuilt after #671: https://travis-ci.org/JuliaPy/PyCall.jl/builds/511789604 (all green) |
In PR JuliaPy#651, I introduced code to empty `npy_api` in `__init__` but forgot to reset `npy_initialized`. This introduces a bug if `npyinitialize` is called during sysimage compilation (`--output-o` mode) because the main body of `npyinitialize` is not run at run-time.
In PR JuliaPy#651, I introduced code to empty `npy_api` in `__init__` but forgot to reset `npy_initialized`. This introduces a bug if `npyinitialize` is called during sysimage compilation (`--output-o` mode) because the main body of `npyinitialize` is not run at run-time.
) In PR #651, I introduced code to empty `npy_api` in `__init__` but forgot to reset `npy_initialized`. This introduces a bug if `npyinitialize` is called during sysimage compilation (`--output-o` mode) because the main body of `npyinitialize` is not run at run-time.
This PR makes PyCall.jl compatible with PackageCompiler.jl and add some tests.
Quick usage:
Slightly more detailed docs in: aot/README.md