From 448dfc3fece678b458c7ebc031d660a270842352 Mon Sep 17 00:00:00 2001 From: Valentin Churavy Date: Sat, 9 May 2026 12:05:39 +0200 Subject: [PATCH] Consider assertions for runtime module --- src/rtlib.jl | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/rtlib.jl b/src/rtlib.jl index 12fc321b..d9149d34 100644 --- a/src/rtlib.jl +++ b/src/rtlib.jl @@ -114,6 +114,12 @@ function build_runtime(@nospecialize(job::CompilerJob)) mod end +@static if VERSION >= v"1.11.0" + import Core.Compiler: is_asserts +else + is_asserts() = false +end + @locked function load_runtime(@nospecialize(job::CompilerJob)) global compile_cache if compile_cache === nothing # during precompilation @@ -124,6 +130,12 @@ end if !supports_typed_pointers(context()) slug *= "-opaque" end + + # Julia codegen changes metadata in modules when `FORCE_ASSERTIONS=1` + if is_asserts() + slug *= "-asserts" + end + name = "runtime_$(slug).bc" path = joinpath(compile_cache, name)