Skip to content

Commit 89d61c6

Browse files
KristofferCKristofferC
and
KristofferC
authored
do not put project stdlibs into the base (non-incremental) sysimage (#987)
There is no need to do this, the stdlibs used by the project will be included when the final sysimage is built --------- Co-authored-by: KristofferC <[email protected]>
1 parent 46ed4a5 commit 89d61c6

File tree

2 files changed

+27
-65
lines changed

2 files changed

+27
-65
lines changed

src/PackageCompiler.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ function create_sysimage(packages::Union{Nothing, Symbol, Vector{String}, Vector
594594
if base_sysimage !== nothing
595595
error("cannot specify `base_sysimage` when `incremental=false`")
596596
end
597-
sysimage_stdlibs = filter_stdlibs ? gather_stdlibs_project(ctx) : stdlibs_in_sysimage()
597+
sysimage_stdlibs = filter_stdlibs ? String[] : stdlibs_in_sysimage()
598598
base_sysimage = create_fresh_base_sysimage(sysimage_stdlibs; cpu_target, sysimage_build_args)
599599
else
600600
base_sysimage = something(base_sysimage, unsafe_string(Base.JLOptions().image_file))

test/runtests.jl

+26-64
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ const is_slow_ci = is_ci && Sys.ARCH == :aarch64 && !Sys.isapple()
3232

3333
const is_julia_1_6 = VERSION.major == 1 && VERSION.minor == 6
3434
const is_julia_1_9 = VERSION.major == 1 && VERSION.minor == 9
35-
const is_julia_1_11 = VERSION.major == 1 && VERSION.minor == 11
36-
const is_julia_1_12 = VERSION.major == 1 && VERSION.minor == 12
3735

3836
if is_ci || is_gha_ci
3937
@info "This is a CI job" Sys.ARCH VERSION is_ci is_gha_ci
@@ -46,8 +44,6 @@ end
4644
const jlver_some_tests_skipped = [
4745
is_julia_1_6,
4846
is_julia_1_9,
49-
is_julia_1_11,
50-
is_julia_1_12,
5147
]
5248

5349
if any(jlver_some_tests_skipped)
@@ -107,18 +103,6 @@ end
107103
end
108104
@testset for incremental in incrementals_list
109105
if incremental == false
110-
if is_gha_ci && (is_julia_1_11 || is_julia_1_12)
111-
# On Julia 1.11 and 1.12, `incremental=false` is currently broken.
112-
# 1.11: https://github.com/JuliaLang/PackageCompiler.jl/issues/976
113-
# 1.12: No GitHub issue yet.
114-
# So, for now, we skip the `incremental=false` tests on Julia 1.11 and 1.12
115-
# But ONLY on GHA (GitHub Actions).
116-
# On PkgEval, we do run these tests. This is intentional - we want PkgEval to
117-
# detect regressions, as well as fixes for those regressions.
118-
@warn "[GHA CI] This is Julia $(VERSION.major).$(VERSION.minor); skipping incremental=false test due to known bug: #976 (for 1.11), issue TODO (for 1.12)"
119-
@test_skip false
120-
continue
121-
end
122106
if is_slow_ci
123107
@warn "Skipping the (incremental=false, filter_stdlibs=false) test because this is \"slow CI\""
124108
@test_skip false
@@ -226,58 +210,36 @@ end
226210
end # testset
227211

228212
if !is_slow_ci
229-
if is_gha_ci && is_julia_1_12
230-
# On Julia 1.12, `incremental=false` is currently broken when doing `create_library()`.
231-
# 1.12: No GitHub issue yet.
232-
# So, for now, we skip the `incremental=false` tests on Julia 1.12 when doing `create_library()`.
233-
# But ONLY on GHA (GitHub Actions).
234-
# On PkgEval, we do run these tests. This is intentional - we want PkgEval to
235-
# detect regressions, as well as fixes for those regressions.
236-
@warn "[GHA CI] This is Julia $(VERSION.major).$(VERSION.minor); skipping incremental=false test when doing `create_library()` due to known bug: issue TODO (for 1.12)"
237-
@test_skip false
238-
else
239-
# Test library creation
240-
lib_source_dir = joinpath(@__DIR__, "..", "examples/MyLib")
241-
lib_target_dir = joinpath(tmp, "MyLibCompiled")
242-
243-
# This is why we have to skip this test on 1.12:
244-
incremental = false
245-
246-
filter = true
247-
lib_name = "inc"
248-
249-
tmp_lib_src_dir = joinpath(tmp, "MyLib")
250-
cp(lib_source_dir, tmp_lib_src_dir)
251-
create_library(tmp_lib_src_dir, lib_target_dir; incremental=incremental, force=true, filter_stdlibs=filter,
252-
precompile_execution_file=joinpath(lib_source_dir, "build", "generate_precompile.jl"),
253-
precompile_statements_file=joinpath(lib_source_dir, "build", "additional_precompile.jl"),
254-
lib_name=lib_name, version=v"1.0.0")
255-
rm(tmp_lib_src_dir; recursive=true)
256-
end
213+
# Test library creation
214+
lib_source_dir = joinpath(@__DIR__, "..", "examples/MyLib")
215+
lib_target_dir = joinpath(tmp, "MyLibCompiled")
216+
217+
# This is why we have to skip this test on 1.12:
218+
incremental = false
219+
220+
filter = true
221+
lib_name = "inc"
222+
223+
tmp_lib_src_dir = joinpath(tmp, "MyLib")
224+
cp(lib_source_dir, tmp_lib_src_dir)
225+
create_library(tmp_lib_src_dir, lib_target_dir; incremental=incremental, force=true, filter_stdlibs=filter,
226+
precompile_execution_file=joinpath(lib_source_dir, "build", "generate_precompile.jl"),
227+
precompile_statements_file=joinpath(lib_source_dir, "build", "additional_precompile.jl"),
228+
lib_name=lib_name, version=v"1.0.0")
229+
rm(tmp_lib_src_dir; recursive=true)
257230
end
258231

259232
# Test creating an empty sysimage
260233
if !is_slow_ci
261-
if is_gha_ci && is_julia_1_12
262-
# On Julia 1.12, `incremental=false` is currently broken when doing `create_library()`.
263-
# 1.12: No GitHub issue yet.
264-
# So, for now, we skip the `incremental=false` tests on Julia 1.12 when doing `create_library()`.
265-
# But ONLY on GHA (GitHub Actions).
266-
# On PkgEval, we do run these tests. This is intentional - we want PkgEval to
267-
# detect regressions, as well as fixes for those regressions.
268-
@warn "[GHA CI] This is Julia $(VERSION.major).$(VERSION.minor); skipping incremental=false test when doing `create_library()` due to known bug: issue TODO (for 1.12)"
269-
@test_skip false
270-
else
271-
tmp = mktempdir()
272-
sysimage_path = joinpath(tmp, "empty." * Libdl.dlext)
273-
foreach(x -> touch(joinpath(tmp, x)), ["Project.toml", "Manifest.toml"])
234+
tmp = mktempdir()
235+
sysimage_path = joinpath(tmp, "empty." * Libdl.dlext)
236+
foreach(x -> touch(joinpath(tmp, x)), ["Project.toml", "Manifest.toml"])
274237

275-
# This is why we need to skip this test on 1.12:
276-
incremental=false
277-
278-
create_sysimage(String[]; sysimage_path=sysimage_path, incremental=incremental, filter_stdlibs=true, project=tmp)
279-
hello = read(`$(Base.julia_cmd()) -J $(sysimage_path) -e 'print("hello, world")'`, String)
280-
@test hello == "hello, world"
281-
end
238+
# This is why we need to skip this test on 1.12:
239+
incremental=false
240+
241+
create_sysimage(String[]; sysimage_path=sysimage_path, incremental=incremental, filter_stdlibs=true, project=tmp)
242+
hello = read(`$(Base.julia_cmd()) -J $(sysimage_path) -e 'print("hello, world")'`, String)
243+
@test hello == "hello, world"
282244
end
283245
end

0 commit comments

Comments
 (0)