Skip to content

Commit 2f84551

Browse files
author
KristofferC
committed
add a release banner option
1 parent f9a8252 commit 2f84551

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/PackageCompiler.jl

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,7 @@ function create_sysimg_object_file(object_file::String,
410410
script::Union{Nothing, String},
411411
sysimage_build_args::Cmd,
412412
extra_precompiles::String,
413+
release_banner::Union{Nothing, String},
413414
incremental::Bool,
414415
import_into_main::Bool)
415416
julia_code_buffer = IOBuffer()
@@ -437,8 +438,12 @@ function create_sysimg_object_file(object_file::String,
437438
push!(precompile_files, tracefile)
438439
end
439440
append!(precompile_files, abspath.(precompile_statements_file))
441+
banner_code = release_banner === nothing ? "" : """
442+
@eval Base const TAGGED_RELEASE_BANNER = $(repr(release_banner))
443+
"""
440444
precompile_code = """
441445
# This @eval prevents symbols from being put into Main
446+
$banner_code
442447
@eval Module() begin
443448
using Base.Meta
444449
PrecompileStagingArea = Module()
@@ -631,6 +636,7 @@ function create_sysimage(packages::Union{Nothing, Symbol, Vector{String}, Vector
631636
soname=nothing,
632637
compat_level::String="major",
633638
extra_precompiles::String = "",
639+
release_banner::Union{Nothing, String}=nothing,
634640
import_into_main::Bool=true,
635641
)
636642
# We call this at the very beginning to make sure that the user has a compiler available. Therefore, if no compiler
@@ -737,6 +743,7 @@ function create_sysimage(packages::Union{Nothing, Symbol, Vector{String}, Vector
737743
script,
738744
sysimage_build_args,
739745
extra_precompiles,
746+
release_banner,
740747
incremental,
741748
import_into_main)
742749
object_files = [object_file]
@@ -1030,7 +1037,8 @@ function create_distribution(project_dir::String,
10301037
include_transitive_dependencies::Bool=true,
10311038
include_preferences::Bool=true,
10321039
script::Union{Nothing, String}=nothing,
1033-
copy_globs::Vector{String}=String[])
1040+
copy_globs::Vector{String}=String[],
1041+
release_banner::Union{Nothing, String}=nothing)
10341042
ctx = create_pkg_context(project_dir)
10351043
Pkg.instantiate(ctx, verbose=true, allow_autoprecomp=false)
10361044

@@ -1072,6 +1080,7 @@ function create_distribution(project_dir::String,
10721080
sysimage_build_args,
10731081
include_transitive_dependencies,
10741082
script,
1083+
release_banner,
10751084
import_into_main=false)
10761085

10771086
precompile_stdlibs(dist_dir, sysimage_path, cpu_target)

0 commit comments

Comments
 (0)