-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Refactor julia initialization by finding and loading the sysimage earlier #58231
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
jl_gc_notify_image_load(sysimage.data, sysimage.size); | ||
|
||
if (jl_options.cpu_target == NULL) | ||
jl_options.cpu_target = "native"; |
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.
Should this be the default value in jloptions.c?
Is this enough to fix |
@@ -461,9 +461,7 @@ JL_DLLEXPORT jl_gcframe_t **jl_autoinit_and_adopt_thread(void) | |||
" (this should not happen, please file a bug report)\n"); | |||
exit(1); | |||
} | |||
const char *image_path = jl_pathname_for_handle(handle); | |||
jl_enter_threaded_region(); // This should maybe be behind a lock, but it's harmless if done twice |
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.
Was this deletion intentional?
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.
Yes. It got moved into the jl_init_with_handle call (the threaded region maybe should still be here :\ but I dunno)
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.
Yeah it was specifically the thread region I was curious about - I'm OK with deleting it for now, we can re-visit soon with thread-safety
2b4f4e0
to
7510499
Compare
This makes it clearer that sysimage resolution and `jl_options` setup are the responsibility of `jl_api.c`, not the initialization system.
7510499
to
8522727
Compare
7c9cb68
to
a242ff2
Compare
I cannot abide CI any longer. I'm going to merge this as-is (it has passed 80% of CI several times now) Pkg server issues have been worked around, but 5-10+ manual Windows restarts per run, random failures, and |
Thanks @gbaraldi ! |
This changes the order of initialization slightly. The goal is to be able to initialize executables and share libraries without having to explicitly call init functions.
This still doesn't address the thread safety