Skip to content

[1.12] Run __init__() even in sysimage builds #1408

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

Closed
wants to merge 1 commit into from

Conversation

topolarity
Copy link
Member

1.12-specific version of #1407 (1.12 does not have LazyLibrary)

This change makes the LinearAlgebra initialization code run during the sysimage build, similar to how it would run when using LinearAlgebra at top-level in a normal package.

In this configuration, we can't rely on the serializer to isolate side-effects for us, so we have to manually ensure that any mutations that we perform here are not accidentally persisted to run-time. Accordingly, the OncePerProcess is here as a reminder that any code in this init has to think about phasing.

Requires JuliaLang/julia#59232

Resolves the segfault in JuliaLang/julia#59215

This change makes the LinearAlgebra initialization code run during the
sysimage build, similar to how it would run when using LinearAlgebra at
top-level in a normal package.

In this configuration, we can't rely on the serializer to isolate
side-effects for us, so we have to manually ensure that any mutations
that we perform here are not accidentally persisted to run-time.

Accordingly, the `OncePerProcess` is here as a reminder that any code
in this init have to think about phasing (and be careful not to leave
behind changes from compile-time that would badly impact run-time).
@topolarity topolarity force-pushed the ct/init-once-per-process-1.12 branch from a8140cd to 4ec5faa Compare August 8, 2025 01:13
Copy link

codecov bot commented Aug 8, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.57%. Comparing base (6cc0405) to head (4ec5faa).

Additional details and impacted files
@@               Coverage Diff                @@
##           release-1.12    #1408      +/-   ##
================================================
+ Coverage         93.56%   93.57%   +0.01%     
================================================
  Files                34       34              
  Lines             15442    15444       +2     
================================================
+ Hits              14448    14452       +4     
+ Misses              994      992       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@topolarity
Copy link
Member Author

Closing in preference of #1407 (comment)

@topolarity topolarity closed this Aug 8, 2025
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.

1 participant