Skip to content
This repository has been archived by the owner on Jun 9, 2023. It is now read-only.

Ensure calling Base.compilecache before --output attempts to call using #68

Closed
vtjnash opened this issue Jan 2, 2020 · 4 comments · Fixed by #71
Closed

Ensure calling Base.compilecache before --output attempts to call using #68

vtjnash opened this issue Jan 2, 2020 · 4 comments · Fixed by #71

Comments

@vtjnash
Copy link
Member

vtjnash commented Jan 2, 2020

The --output step somewhat expects that Base.compilecache has already been called from a regular copy of the identical system image first before it encounters a using statement. This lets it initialize the image properly (run the __init__ methods) and thereby reduces divergence from the normally tested configuration of packages. While it'll silently fall back to attempting to load it in-process, the result isn't necessarily pleasant.

(Or probably ideally, this package would bypass calling using entirely and just directly call _require_from_serialized in the compiler process on the return value of Base.compilecache from the helper process as this should yet further limit the opportunity for messy errors and other process noise to potentially slip in and cause divergence.)

@KristofferC
Copy link
Member

The --output step somewhat expects that Base.compilecache has already been called from a regular copy of the identical system image first before it encounters a using statement.

Ironically, I run with compiled_modules=false to work around JuliaLang/julia#34076.

@vtjnash
Copy link
Member Author

vtjnash commented Jan 2, 2020

Yeah, you're trying to cause the side-effects from the wrong places.

@KristofferC
Copy link
Member

KristofferC commented Jan 2, 2020

Are you saying to use some "wrapper script" that looks something like

using MyApp

Base.@ccallable julia_main
    MyApp.julia_main()
end

and include that in the --output process instead of having the Base.@ccallable inside the package that gets precompiled. Should be an easy change if you think that is better.

@vtjnash
Copy link
Member Author

vtjnash commented Jan 2, 2020

Yes

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants