Skip to content

Don't construct Module() during precompilation#134

Merged
pfitzseb merged 1 commit intoJuliaDebug:masterfrom
serenity4:eval-closed-module-fix
Feb 18, 2025
Merged

Don't construct Module() during precompilation#134
pfitzseb merged 1 commit intoJuliaDebug:masterfrom
serenity4:eval-closed-module-fix

Conversation

@serenity4
Copy link
Copy Markdown
Contributor

A new error appeared for nightly, likely due to JuliaLang/julia#57425:

Failed to precompile Infiltrator [5903a43b-9cc3-4c30-8d17-598619ec4e9b] to "/home/serenity4/julia/wip8/.julia/compiled/v1.13/Infiltrator/jl_KfVJ1M".
ERROR: LoadError: Creating a new global in closed module `anonymous` (`anonymous`) breaks incremental compilation because the side effects will not be permanent.
Stacktrace:
  [1] Module
    @ ./boot.jl:574 [inlined]
  [2] Module()
    @ Core ./boot.jl:574
  [3] top-level scope
    @ ~/julia/wip8/.julia/packages/Infiltrator/cxm1l/src/Infiltrator.jl:223

The created Module() was anyway discarded with clear_store!(store) during __init__(), so this change should be safe.

@pfitzseb pfitzseb merged commit 762c2a7 into JuliaDebug:master Feb 18, 2025
7 checks passed
@KristofferC
Copy link
Copy Markdown
Member

Anyone package that loads this package will still hit this due to the clear_store! in __init__.

@serenity4
Copy link
Copy Markdown
Contributor Author

Would you have an error log to share? This PR fixed an issue during precompilation, not during __init__. For the latter I wasn't aware there was another issue.

@KristofferC
Copy link
Copy Markdown
Member

Other packages that load this will run this package __init__ where it errors. https://s3.amazonaws.com/julialang-reports/nanosoldier/pkgeval/by_hash/83dcbd4_vs_8561cc3/SnapshotTests.primary.log

@serenity4
Copy link
Copy Markdown
Contributor Author

I see, will make a PR

@KristofferC
Copy link
Copy Markdown
Member

Imo JuliaLang/julia#57635 should be fixed

@serenity4
Copy link
Copy Markdown
Contributor Author

That'd be nice, as I expect many other packages to rely on this.

In the meantime, here is #136 which I'd be happy to revert at some point in the future if the situation is resolved.

@serenity4 serenity4 deleted the eval-closed-module-fix branch March 31, 2025 15:24
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.

3 participants