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

staticdata: Refactor sysimage loading #57542

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

topolarity
Copy link
Member

@topolarity topolarity commented Feb 26, 2025

Introduce jl_image_buf_t to represent the in-memory details of an unparsed system image and clean-up several global variables and split loading logic in staticdata.c so that we get (almost) everything we need from the sysimage handle at once.

This allows sysimage loading to be separated into three phases:

  1. Lookup the raw sysimage buffer as a jl_image_buf_t
  2. For .so sysimages, parse the sysimage and initialize JIT targets, etc.
  3. Finally load the sysimage into a jl_image_t

Care was taken to preserve the existing behavior of calling jl_set_sysimg_so to configure the sysimage before initializing Julia, although this is likely to be next on the chopping block in a follow-up.

Dependent on #57523.

Introduce `jl_image_buf_t` to represent the in-memory details of an unparsed
system image and clean-up several global variables and split loading logic
in staticdata.c so that we (almost) get everything we need from the sysimage
handle at once.

This allows sysimage loading to be separated into three phases:
  1. Lookup the raw sysimage buffer as a `jl_image_buf_t`
  2. For .so sysimages, parse the sysimage and initialize JIT targets, etc.
  3. Finally load the sysimage into a `jl_image_t`

Care was taken to preserve the existing behavior of calling `jl_set_sysimg_so`
to configure the sysimage before initializing Julia, although this is likely
to be next on the chopping block in a follow-up.
Copy link
Member

@vtjnash vtjnash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this feels less magic and global coupling of hidden logic. Much clearer now

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

Successfully merging this pull request may close these issues.

2 participants