Skip to content

Add flexible source-free load remap regression test#2

Merged
jack-champagne merged 1 commit into
masterfrom
test/flexible-load-remap
Jun 30, 2026
Merged

Add flexible source-free load remap regression test#2
jack-champagne merged 1 commit into
masterfrom
test/flexible-load-remap

Conversation

@jack-champagne

Copy link
Copy Markdown
Member

What this locks in

Adds test/test_flexible_load.jl: an end-to-end regression for the flexible
source-free load
that remap! + load_package_image exist to enable —
loading a precompiled package image whose dependency has since been rebuilt
under a new build-id, by rewriting the recorded build-id so the image
relinks against the new dependency at load time, with no source.

The test builds its own two trivial packages (User -> Dep) in an isolated
temp depot (never touches ~/.julia), precompiles Dep@v1 + User, stashes
the images, then perturbs Dep and recompiles to Dep@v2. It then runs four
scenarios, each in a separate julia child process (two builds of the same
module name cannot coexist in one process):

  • A — positive control: load User against the Dep it was built with →
    User.hello() == "User sees: Dep v1".
  • B1 — no remap: load the stale User against Dep@v2 → clean failure in
    resolve_dep (Cannot resolve dependency: module 'Dep' ... not found), no
    crash, no spurious load.
  • B2 — the regression: remap User's recorded Dep build-id to Dep@v2
    in both the .so (read by the C restore step) and the .ji header (read
    by resolve_dep), then load source-free → loads and relinks:
    User.hello() == "User sees: Dep v2".
  • B3 — negative control: remap to a bogus build-id → clean failure (no
    crash, no spurious load).

Notes

  • Self-contained: builds its own fixtures, does not depend on an external
    bundle or JSD_FIXTURE_DEPOT.
  • Skips cleanly via @test_skip when a split .so package image cannot be
    produced (no C toolchain, or the build otherwise fails) instead of failing.
  • Child processes run with an isolated JULIA_DEPOT_PATH and a stdlib-only
    load path; the user depot is never written.
  • Does not modify any existing test file or src/.

Result

Full suite green locally on Julia 1.12.6 (Pkg.test()): 198 Pass, 0 Fail,
with the round-trip actually exercised (not skipped).

🤖 Generated with Claude Code

@jack-champagne
jack-champagne merged commit 66dc24f into master Jun 30, 2026
1 check passed
@jack-champagne
jack-champagne deleted the test/flexible-load-remap branch June 30, 2026 06:13
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