Skip to content

Commit 975aa9e

Browse files
committed
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 97ead58 commit 975aa9e

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
@@ -78,7 +70,12 @@ let mod = Base.include(Main, ARGS[1])
7870
end
7971
end
8072

73+
# Run the verifier in the current world (before build-script modifications),
74+
# so that error messages and types print in their usual way.
75+
Core.Compiler._verify_trim_world_age[] = Base.get_world_counter()
76+
8177
if Base.JLOptions().trim != 0
78+
include(joinpath(@__DIR__, "juliac-trim-base.jl"))
8279
include(joinpath(@__DIR__, "juliac-trim-stdlib.jl"))
8380
end
8481

0 commit comments

Comments
 (0)