Skip to content

Commit

Permalink
Bump julia [compat] to 1.10 (and drop support for 1.6 through 1.9) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
KristofferC authored Nov 25, 2024
1 parent 530b392 commit 6777978
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 93 deletions.
9 changes: 0 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ jobs:
fail-fast: false
matrix:
julia-version:
- '1.6' # previous LTS
- '1.10' # current LTS
- '1.11' # current stable
#
Expand All @@ -74,14 +73,6 @@ jobs:
coverage:
- 'true'
exclude:
# Julia 1.6 did not support Apple Silicon:
- github-runner: macos-14 # macos-14 = Apple Silicon.
julia-version: '1.6'
#
# To save some CI time, on Julia 1.6 we only run the 64-bit job (and skip the 32-bit job).
- julia-version: '1.6'
julia-wordsize: '32'
#
# We don't have 32-bit builds of Julia for Intel macOS:
- github-runner: macos-13 # macos-13 = Intel.
julia-wordsize: '32'
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Printf = "1"
RelocatableFolders = "0.1, 0.3, 1"
TOML = "<0.0.1, 1"
UUIDs = "<0.0.1, 1"
julia = "1.6"
julia = "1.10"

[extras]
Example = "7876af07-990d-54b4-ab0e-23690620f79a"
Expand Down
20 changes: 6 additions & 14 deletions examples/MyApp/src/MyApp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,7 @@ using HelloWorldC_jll
using Artifacts
using Distributed
using Random

# We seem to get problems with LLVMExtra_jll on Julia 1.6 and 1.9
# Issue for 1.6: https://github.com/JuliaLang/PackageCompiler.jl/issues/706
# There's no GitHub Issue for 1.9
@static if (VERSION.major, VERSION.minor) ((1, 6), (1, 9),)
using LLVMExtra_jll
end
using LLVMExtra_jll

using micromamba_jll

Expand Down Expand Up @@ -66,7 +60,7 @@ function real_main()

println("Running the artifact")
res = readchomp(`$(hello_world_path())`)
println("Artifact printed: $res")
println("Artifact printed: $res")

@show unsafe_string(Base.JLOptions().image_file)
@show Example.domath(5)
Expand All @@ -89,12 +83,10 @@ function real_main()
@eval @everywhere using Example
@everywhere println(Example.domath(3))

@static if (VERSION.major, VERSION.minor) ((1, 6), (1, 9),)
if isfile(LLVMExtra_jll.libLLVMExtra_path)
println("LLVMExtra path: ok!")
else
println("LLVMExtra path: fail!")
end
if isfile(LLVMExtra_jll.libLLVMExtra_path)
println("LLVMExtra path: ok!")
else
println("LLVMExtra path: fail!")
end

if isfile(micromamba_jll.micromamba_path)
Expand Down
31 changes: 5 additions & 26 deletions src/PackageCompiler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ include("library_selection.jl")
##############

const NATIVE_CPU_TARGET = "native"
const TLS_SYNTAX = VERSION >= v"1.7.0-DEV.1205" ? `-DNEW_DEFINE_FAST_TLS_SYNTAX` : ``
const TLS_SYNTAX = `-DNEW_DEFINE_FAST_TLS_SYNTAX`

const DEFAULT_EMBEDDING_WRAPPER = @path joinpath(@__DIR__, "embedding_wrapper.c")
const DEFAULT_JULIA_INIT = @path joinpath(@__DIR__, "julia_init.c")
Expand Down Expand Up @@ -78,22 +78,18 @@ function create_pkg_context(project)
end

function load_all_deps(ctx)
ctx_or_env = VERSION <= v"1.7.0-" ? ctx : ctx.env
env = ctx.env
if isdefined(Pkg.Operations, :load_all_deps!)
pkgs = Pkg.Types.PackageSpec[]
Pkg.Operations.load_all_deps!(ctx_or_env, pkgs)
Pkg.Operations.load_all_deps!(env, pkgs)
else
pkgs = Pkg.Operations.load_all_deps(ctx_or_env)
pkgs = Pkg.Operations.load_all_deps(env)
end
return pkgs
end

function source_path(ctx, pkg)
if VERSION <= v"1.7.0-"
Pkg.Operations.source_path(ctx, pkg)
else
Pkg.Operations.source_path(ctx.env.project_file, pkg)
end
Pkg.Operations.source_path(ctx.env.project_file, pkg)
end

const _STDLIBS = readdir(Sys.STDLIB)
Expand Down Expand Up @@ -379,28 +375,11 @@ function create_sysimg_object_file(object_file::String,
isexpr(ps, :call) || continue
popfirst!(ps.args) # precompile(...)
ps.head = :tuple
@static if VERSION <= v"1.9.0"
l = ps.args[end]
if (isexpr(l, :tuple) || isexpr(l, :curly)) && length(l.args) > 0 # Tuple{...} or (...)
# XXX: precompile doesn't currently handle overloaded Vararg arguments very well.
# Replacing N with a large number works around it.
l = l.args[end]
if isexpr(l, :curly) && length(l.args) == 2 && l.args[1] === :Vararg # Vararg{T}
push!(l.args, 100) # form Vararg{T, 100} instead
end
end
end
# println(ps)
local ps
while true
try
ps = Core.eval(PrecompileStagingArea, ps)
@static if VERSION <= v"1.9.0-beta1"
# XXX: precompile doesn't currently handle overloaded nospecialize arguments very well.
# Skipping them avoids the warning.
ms = length(ps) == 1 ? Base._methods_by_ftype(ps[1], 1, Base.get_world_counter()) : Base.methods(ps...)
ms isa Vector || @goto skip_precompile
end
break
catch e
if e isa UndefVarError
Expand Down
6 changes: 1 addition & 5 deletions src/library_selection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,4 @@ const required_libraries = Dict(
"mac" => ["libLLVM", "libatomic", "libdSFMT", "libgcc_s", "libgfortran", "libgmp", "libgmpxx", "libgomp", "libjulia-codegen", "libjulia-internal", "libmpfr", "libopenlibm", "libpcre2-8", "libquadmath", "libssp", "libstdc++", "libuv", "libz"]
)
push!(required_libraries["windows"], "libgcc_s_jlj")
if Sys.VERSION < v"1.7.0"
push!(required_libraries["mac"], "libosxunwind")
else
push!(required_libraries["mac"], "libunwind")
end
push!(required_libraries["mac"], "libunwind")
42 changes: 4 additions & 38 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ Base.init_depot_path()
# If I recall correctly, Julia's PkgEval.jl also sets it.
const is_ci = tryparse(Bool, get(ENV, "CI", "")) === true

# GHA = GitHub Actions
const is_gha_ci = tryparse(Bool, get(ENV, "GITHUB_ACTIONS", "")) === true

# In order to be "slow CI", we must meet all of the following:
# 1. We are running on CI.
# 2. We are running on aarch64 (arm64).
Expand All @@ -30,34 +27,14 @@ const is_gha_ci = tryparse(Bool, get(ENV, "GITHUB_ACTIONS", "")) === true
# macOS runners seem to be quite fast.)
const is_slow_ci = is_ci && Sys.ARCH == :aarch64 && !Sys.isapple()

const is_julia_1_6 = VERSION.major == 1 && VERSION.minor == 6
const is_julia_1_9 = VERSION.major == 1 && VERSION.minor == 9

if is_ci || is_gha_ci
@info "This is a CI job" Sys.ARCH VERSION is_ci is_gha_ci
if is_ci
@info "This is a CI job" Sys.ARCH VERSION is_ci
end

if is_slow_ci
@warn "This is \"slow CI\" (defined as any non-macOS CI running on aarch64). Some tests will be skipped or modified." Sys.ARCH
end

const jlver_some_tests_skipped = [
is_julia_1_6,
is_julia_1_9,
]

if any(jlver_some_tests_skipped)
@warn "This is Julia $(VERSION.major).$(VERSION.minor). Some tests will be skipped or modified." VERSION
end

function remove_llvmextras(project_file)
proj = TOML.parsefile(project_file)
delete!(proj["deps"], "LLVMExtra_jll")
open(project_file, "w") do io
TOML.print(io, proj)
end
end

@testset "PackageCompiler.jl" begin
@testset "create_sysimage" begin
new_project = mktempdir()
Expand Down Expand Up @@ -117,12 +94,6 @@ end
@info "starting: create_app testset" incremental filter
tmp_app_source_dir = joinpath(tmp, "MyApp")
cp(app_source_dir, tmp_app_source_dir)
if is_gha_ci && (is_julia_1_6 || is_julia_1_9)
# Julia 1.6: Issue #706 "Cannot locate artifact 'LLVMExtra'" on 1.6 so remove.
# Julia 1.9: There's no GitHub Issue, but it seems we hit a similar problem.
@test_skip false
remove_llvmextras(joinpath(tmp_app_source_dir, "Project.toml"))
end
try
create_app(tmp_app_source_dir, app_compiled_dir; incremental=incremental, force=true, filter_stdlibs=filter, include_lazy_artifacts=true,
precompile_execution_file=joinpath(app_source_dir, "precompile_app.jl"),
Expand Down Expand Up @@ -176,13 +147,8 @@ end
@test occursin("From worker 4:\t8", app_output)
@test occursin("From worker 5:\t8", app_output)

if is_julia_1_6 || is_julia_1_9
# Julia 1.6: Issue #706 "Cannot locate artifact 'LLVMExtra'" on 1.6 so remove.
# Julia 1.9: There's no GitHub Issue, but it seems we hit a similar problem.
@test_skip false
else
@test occursin("LLVMExtra path: ok!", app_output)
end

@test occursin("LLVMExtra path: ok!", app_output)
@test occursin("micromamba_jll path: ok!", app_output)

# Test second app
Expand Down

0 comments on commit 6777978

Please sign in to comment.