Skip to content

World age increment not at top level regression with v1.3.1 #58

Closed
@mortenpi

Description

@mortenpi

It looks like something might have regressed in 1.3.1 (works with 1.3.0; but also still broken with current master, i.e. 6b5623a).

The MWE is a bit weird, so maybe this is actually not supposed to work, but it shows up in the real world in HTTP.jl, which currently fails to precompile on 1.12 and above: https://github.com/JuliaWeb/HTTP.jl/blob/9db9aaded7c942e442b185d03ea5fd212b1b7efe/src/precompile.jl#L34-L38

The following MWE

hello(who::String) = "Hello, $who"
using PrecompileTools: @setup_workload, @compile_workload
@setup_workload begin
    withenv() do
        @compile_workload begin
            hello("x")
        end
    end
end

leads to

ERROR: LoadError: syntax: World age increment not at top level
Stacktrace:
 [1] top-level scope
   @ ~/oss/Example.jl/src/Example.jl:19
 [2] include(mod::Module, _path::String)
   @ Base ./Base.jl:303
 [3] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::Nothing)
   @ Base ./loading.jl:3019
 [4] top-level scope
   @ stdin:5
 [5] eval(m::Module, e::Any)
   @ Core ./boot.jl:489
 [6] include_string(mapexpr::typeof(identity), mod::Module, code::String, filename::String)
   @ Base ./loading.jl:2865
 [7] include_string
   @ ./loading.jl:2875 [inlined]
 [8] exec_options(opts::Base.JLOptions)
   @ Base ./client.jl:329
 [9] _start()
   @ Base ./client.jl:563
in expression starting at /home/mortenpi/oss/Example.jl/src/Example.jl:1
in expression starting at stdin:

Only affects Julia 1.12+ (getting it on 1.12.0-beta1 and 1.13.0-DEV.361), since <= 1.11 installs PrecompileTools 1.2.1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions