From 467b90b2d6c2489b475a288f04bb9c6a50947b8b Mon Sep 17 00:00:00 2001 From: Gabriel Baraldi Date: Tue, 15 Oct 2024 21:47:00 -0300 Subject: [PATCH] Change naming convention of object files to follow what Base Julia does (#930) * Change naming convention of object files to follow what Base Julia does * Add some comments linking to the PR and the bug report Thus, future readers of the source code will understand why we use this naming convention. [Applies suggestions from code review.] * CI: Resume testing on Intel macOS (#967) --------- Co-authored-by: Dilum Aluthge --- .github/workflows/ci.yml | 2 +- src/PackageCompiler.jl | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e55dcc97..fe926c50 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,7 +57,7 @@ jobs: os: - ubuntu-latest - windows-latest - # - macos-13 # macos-13 = Intel. # TODO: uncomment this line once we merge #930 + - macos-13 # macos-13 = Intel. # TODO: uncomment the next line, so that we can start testing on macos-14: # - macos-14 # macos-14 = Apple Silicon. coverage: diff --git a/src/PackageCompiler.jl b/src/PackageCompiler.jl index a6a41155..631536c5 100644 --- a/src/PackageCompiler.jl +++ b/src/PackageCompiler.jl @@ -225,7 +225,11 @@ function create_fresh_base_sysimage(stdlibs::Vector{String}; cpu_target::String, sysimg_source_path = Base.find_source_file("sysimg.jl") base_dir = dirname(sysimg_source_path) tmp_corecompiler_ji = joinpath(tmp, "corecompiler.ji") - tmp_sys_o = joinpath(tmp, "sys.o") + tmp_sys_o = joinpath(tmp, "sys-o.a") + # This naming convention (`sys-o.a`) is necessary to make the sysimage + # work on macOS. + # Bug report: https://github.com/JuliaLang/PackageCompiler.jl/issues/738 + # PR: https://github.com/JuliaLang/PackageCompiler.jl/pull/930 tmp_sys_sl = joinpath(tmp, "sys." * Libdl.dlext) compiler_source_path = joinpath(base_dir, "compiler", "compiler.jl") @@ -639,7 +643,11 @@ function create_sysimage(packages::Union{Nothing, Symbol, Vector{String}, Vector end # Create the sysimage - object_file = tempname() * ".o" + object_file = tempname() * "-o.a" + # This naming convention (`-o.a`) is necessary to make the sysimage + # work on macOS. + # Bug report: https://github.com/JuliaLang/PackageCompiler.jl/issues/738 + # PR: https://github.com/JuliaLang/PackageCompiler.jl/pull/930 create_sysimg_object_file(object_file, packages, packages_sysimg; project, @@ -1428,7 +1436,7 @@ function bundle_julia_libexec(ctx, dest_dir) p7zip_exe = basename(p7zip_path) cp(p7zip_path, joinpath(bundle_libexec_dir, p7zip_exe)) - return + return end function recursive_dir_size(path)