Skip to content

Commit

Permalink
update ccalls to Julia upstream changes
Browse files Browse the repository at this point in the history
- JuliaLang/julia#52123: Added the
  `int ignore_native` argument to jl_restore_package_image_from_file
- JuliaLang/julia#49538: Added the
  `const char *pkgname` argument to jl_restore_package_image_from_file
  and jl_restore_incremental.
  • Loading branch information
fatteneder committed May 12, 2024
1 parent 7f6ede5 commit bff61fb
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/PkgCacheInspector.jl
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,19 @@ end

function info_cachefile(pkg::PkgId, path::String, depmods::Vector{Any}, isocache::Bool=false)
if isocache
sv = ccall(:jl_restore_package_image_from_file, Any, (Cstring, Any, Cint), path, depmods, true)
@static if VERSION >= v"1.11.0-DEV.922" # https://github.com/JuliaLang/julia/pull/52123
sv = ccall(:jl_restore_package_image_from_file, Any, (Cstring, Any, Cint, Cstring, Cint), path, depmods, true, pkg.name, false)
elseif VERSION >= v"1.10.0-DEV.1145" # https://github.com/JuliaLang/julia/pull/49538
sv = ccall(:jl_restore_package_image_from_file, Any, (Cstring, Any, Cint, Cstring), path, depmods, true, pkg.name)
else
sv = ccall(:jl_restore_package_image_from_file, Any, (Cstring, Any, Cint), path, depmods, true)
end
else
sv = ccall(:jl_restore_incremental, Any, (Cstring, Any, Cint), path, depmods, true)
if VERSION >= v"1.10.0-DEV.1145" # https://github.com/JuliaLang/julia/pull/49538
sv = ccall(:jl_restore_incremental, Any, (Cstring, Any, Cint, Cstring), path, depmods, true, pkg.name)
else
sv = ccall(:jl_restore_incremental, Any, (Cstring, Any, Cint), path, depmods, true)
end
end
if isa(sv, Exception)
throw(sv)
Expand Down

0 comments on commit bff61fb

Please sign in to comment.