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

Ensure Main.eval and Main.include exist in embedded julia #32062

Merged
merged 1 commit into from
May 21, 2019

Conversation

c42f
Copy link
Member

@c42f c42f commented May 17, 2019

These two functions need to be added to Main as part of jl_init(), but only when Base is present to avoid bootstrap issues.

Fixes #28825

Obviously __preinit_threads__ is a weirdly named function to be moving this to, but this part of the init stage seems to be appropriate (ie, right after jl_add_standard_imports(jl_main_module)). Renaming/cleanup suggestions welcome.

@JeffBezanson
Copy link
Sponsor Member

__preinit_threads__ is specifically for thread state, so I don't think it should go there. I think the best way to do it is in init.c right after the call to jl_add_standard_imports(jl_main_module), by calling jl_module_import.

@c42f c42f force-pushed the cjf/fix-embedded-main-include branch from c8d0e12 to 1a78fb9 Compare May 18, 2019 23:18
@c42f
Copy link
Member Author

c42f commented May 18, 2019

Yes, I think that's better, I pushed an update.

@c42f c42f force-pushed the cjf/fix-embedded-main-include branch from 1a78fb9 to 2bf916b Compare May 21, 2019 00:43
@c42f c42f added kind:bugfix This change fixes an existing bug domain:embedding Embedding Julia using the C API labels May 21, 2019
These two functions need to be added to Main as part of `jl_init()`,
but only when Base is present to avoid bootstrap issues.
@c42f c42f force-pushed the cjf/fix-embedded-main-include branch from 2bf916b to 0791d36 Compare May 21, 2019 05:27
@c42f c42f merged commit 633ad82 into master May 21, 2019
@c42f c42f deleted the cjf/fix-embedded-main-include branch May 21, 2019 10:59
@KristofferC KristofferC mentioned this pull request Aug 26, 2019
55 tasks
@KristofferC KristofferC mentioned this pull request Dec 3, 2019
56 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:embedding Embedding Julia using the C API kind:bugfix This change fixes an existing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Embedded Julia doesn't know how to include
2 participants