You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# used to optionally track dependencies when requiring a module:
1156
-
const _concrete_dependencies = Pair{PkgId,UInt64}[] # these dependency versions are "set in stone", and the process should try to avoid invalidating them
1156
+
const _concrete_dependencies = Pair{PkgId,UInt128}[] # these dependency versions are "set in stone", and the process should try to avoid invalidating them
1157
1157
const _require_dependencies = Any[] # a list of (mod, path, mtime) tuples that are the file dependencies of the module currently being precompiled
1158
1158
const _track_dependencies = Ref(false) # set this to true to track the list of file dependencies
1159
1159
function _include_dependency(mod::Module, _path::AbstractString)
@@ -1406,7 +1406,7 @@ function _require(pkg::PkgId, env=nothing)
1406
1406
1407
1407
# attempt to load the module file via the precompile cache locations
1408
1408
if JLOptions().use_compiled_modules !=0
1409
-
m = _require_search_from_serialized(pkg, path, UInt64(0))
1409
+
m = _require_search_from_serialized(pkg, path, UInt128(0))
1410
1410
if m isa Module
1411
1411
return m
1412
1412
end
@@ -1416,7 +1416,7 @@ function _require(pkg::PkgId, env=nothing)
1416
1416
# but it was not handled by the precompile loader, complain
1417
1417
for (concrete_pkg, concrete_build_id) in _concrete_dependencies
1418
1418
if pkg == concrete_pkg
1419
-
@warn """Module $(pkg.name) with build ID $concrete_build_id is missing from the cache.
1419
+
@warn """Module $(pkg.name) with build ID $((UUID(concrete_build_id))) is missing from the cache.
1420
1420
This may mean $pkg does not support precompilation but is imported by a module that does."""
1421
1421
if JLOptions().incremental !=0
1422
1422
# during incremental precompilation, this should be fail-fast
@@ -1785,9 +1785,13 @@ function compilecache(pkg::PkgId, path::String, internal_stderr::IO = stderr, in
1785
1785
close(tmpio)
1786
1786
p = create_expr_cache(pkg, path, tmppath, concrete_deps, internal_stderr, internal_stdout)
1787
1787
if success(p)
1788
-
# append checksum to the end of the .ji file:
1789
-
open(tmppath, "a+") do f
1790
-
write(f, _crc32c(seekstart(f)))
1788
+
# append extra crc to the end of the .ji file:
1789
+
open(tmppath, "r+") do f
1790
+
if iszero(isvalid_cache_header(f))
1791
+
error("Invalid header for $pkg in new cache file $(repr(tmppath)).")
1792
+
end
1793
+
seekstart(f)
1794
+
write(f, _crc32c(f))
1791
1795
end
1792
1796
# inherit permission from the source file (and make them writable)
1793
1797
chmod(tmppath, filemode(path) &0o777|0o200)
@@ -1807,7 +1811,7 @@ function compilecache(pkg::PkgId, path::String, internal_stderr::IO = stderr, in
1807
1811
end
1808
1812
end
1809
1813
1810
-
# this is atomic according to POSIX:
1814
+
# this is atomic according to POSIX (not Win32):
1811
1815
rename(tmppath, cachefile; force=true)
1812
1816
return cachefile
1813
1817
end
@@ -1817,13 +1821,16 @@ function compilecache(pkg::PkgId, path::String, internal_stderr::IO = stderr, in
1817
1821
if p.exitcode ==125
1818
1822
return PrecompilableError()
1819
1823
else
1820
-
error("Failed to precompile $pkg to $tmppath.")
1824
+
error("Failed to precompile $pkg to $(repr(tmppath)).")
1821
1825
end
1822
1826
end
1823
1827
1824
-
module_build_id(m::Module) = ccall(:jl_module_build_id, UInt64, (Any,), m)
1828
+
function module_build_id(m::Module)
1829
+
hi, lo = ccall(:jl_module_build_id, NTuple{2,UInt64}, (Any,), m)
0 commit comments