Skip to content

Commit 19b810a

Browse files
authored
juliac: apply buildscript modifications after user code (#59297)
These modifications to the MethodTable should be performed at the "link-stage", after all user top-level code has executed. This should be closer to the upcoming 1.13 pipeline, which will move all top-level user code to its standard package execution context. This also makes any user-provided functionality for type printing available to the `TrimVerifier`. Resolves #59280.
1 parent 61d04b3 commit 19b810a

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

contrib/juliac/juliac-buildscript.jl

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22

33
# Script to run in the process that generates juliac's object file output
44

5-
# Run the verifier in the current world (before modifications), so that error
6-
# messages and types print in their usual way.
7-
Core.Compiler._verify_trim_world_age[] = Base.get_world_counter()
8-
95
# Initialize some things not usually initialized when output is requested
106
Sys.__init__()
117
Base.init_depot_path()
@@ -23,10 +19,6 @@ if Base.get_bool_env("JULIA_USE_FLISP_PARSER", false) === false
2319
Base.JuliaSyntax.enable_in_core!()
2420
end
2521

26-
if Base.JLOptions().trim != 0
27-
include(joinpath(@__DIR__, "juliac-trim-base.jl"))
28-
end
29-
3022
# Load user code
3123

3224
import Base.Experimental.entrypoint
@@ -83,7 +75,12 @@ let include_result = Base.include(Main, ARGS[1])
8375
end
8476
end
8577

78+
# Run the verifier in the current world (before build-script modifications),
79+
# so that error messages and types print in their usual way.
80+
Core.Compiler._verify_trim_world_age[] = Base.get_world_counter()
81+
8682
if Base.JLOptions().trim != 0
83+
include(joinpath(@__DIR__, "juliac-trim-base.jl"))
8784
include(joinpath(@__DIR__, "juliac-trim-stdlib.jl"))
8885
end
8986

0 commit comments

Comments
 (0)