-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
staticdata: fix assert from partially disabled native code #53439
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3768,8 +3768,11 @@ JL_DLLEXPORT jl_value_t *jl_restore_package_image_from_file(const char *fname, j | |
|
||
jl_image_t pkgimage = jl_init_processor_pkgimg(pkgimg_handle); | ||
|
||
if (ignore_native){ | ||
memset(&pkgimage.fptrs, 0, sizeof(pkgimage.fptrs)); | ||
if (ignore_native) { | ||
// Must disable using native code in possible downstream users of this code: | ||
// https://github.com/JuliaLang/julia/pull/52123#issuecomment-1959965395. | ||
// The easiest way to do that is to disable it in all of them. | ||
jl_options.use_sysimage_native_code = JL_OPTIONS_USE_SYSIMAGE_NATIVE_CODE_NO; | ||
Comment on lines
+3774
to
+3775
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't let me hold this up, but I don't quite understand what this does and how setting a sysimage flag relates to pkgimage usage.. Will this still allow pkgimages to be used by any packages, most importantly stdlibs like Pkg which are dead slow without pkgimages.. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This essentially turns off native code for all images loaded after this moment (including the current one) In #53373 this option was fixed for pkgimages (where when the sysimage is loaded without native code, pkgimages can use native code either) IIUC we load the sysimg and all dependency with native code enabled and once we see the first cache file with ignore_native all subsequent cache files can't use native code, since they might point to images that were loaded without native code. We could be less discriminate if we could prove that there is no overlap in the cached code. As an example of a slightly problematic issue it is now order dependent if we use native code or not.
But
Since we can't know that a code instance is not duplicated between MyPackage and Test, and it depends on which one we load first. So this generally means that we might ignore the native code of test dependencies, but we will use the native code of actual dependencies. |
||
} | ||
|
||
jl_value_t* mod = jl_restore_incremental_from_buf(pkgimg_handle, pkgimg_data, &pkgimage, *plen, depmods, completeinfo, pkgname, 0); | ||
|
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 we just remove
ignore_native
and move this instead into_tryrequire_from_serialized
herejulia/base/loading.jl
Line 1805 in a96726b