Skip to content

Module() can not be executed during precompilation #57635

@KristofferC

Description

@KristofferC

Happens in https://s3.amazonaws.com/julialang-reports/nanosoldier/pkgeval/by_hash/c78016e_vs_d63aded/StableHashTraits.primary.log (https://github.com/fonsp/Pluto.jl/blob/70c51817a282a220618039b176cf8b60673e8b1a/src/runner/PlutoRunner/src/precompile.jl#L16).

MWE:

module ModulePrecompile

Module()

end 
julia> using ModulePrecompile
[ Info: Precompiling ModulePrecompile [d8303ee4-7efc-44e4-ab4b-638a646effd6] 
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
    @ ~/JuliaTests/ModulePrecompile/src/ModulePrecompile.jl:3

Introduced in #57425.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions