Skip to content

Commit 9d87f97

Browse files
wip
1 parent 5be9ff1 commit 9d87f97

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

base/loading.jl

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2444,7 +2444,21 @@ function compilecache(pkg::PkgId, path::String, internal_stderr::IO = stderr, in
24442444
# create a temporary file in `cachepath` directory, write the cache in it,
24452445
# write the checksum, _and then_ atomically move the file to `cachefile`.
24462446
mkpath(cachepath)
2447-
cache_objects = JLOptions().use_pkgimages != 0
2447+
if JLOptions().use_pkgimages == 0
2448+
cache_objects = false
2449+
else
2450+
if JLOptions().tracked_path == C_NULL
2451+
cache_objects = true
2452+
else
2453+
tracked_path = unsafe_string(JLOptions().tracked_path)
2454+
# disable pkgimages if srcpath falls within a code-coverage or allocation-tracking path
2455+
# TODO: disable if any includes fall within tracked_path, not just the srcpath
2456+
# harder because includes aren't currently known before cache generation
2457+
# or implement https://github.com/JuliaLang/julia/issues/51412
2458+
cache_objects = !startswith(path, tracked_path)
2459+
end
2460+
end
2461+
24482462
tmppath, tmpio = mktemp(cachepath)
24492463

24502464
if cache_objects
@@ -3170,6 +3184,7 @@ end
31703184
if isempty(modules)
31713185
return true # ignore empty file
31723186
end
3187+
# TODO: Before merge.. Allow not matching use_pkgimages if package falls in tracked_path
31733188
if ccall(:jl_match_cache_flags, UInt8, (UInt8,), flags) == 0
31743189
@debug """
31753190
Rejecting cache file $cachefile for $modkey since the flags are mismatched

src/staticdata_utils.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ JL_DLLEXPORT uint8_t jl_cache_flags(void)
599599
{
600600
// OOICCDDP
601601
uint8_t flags = 0;
602-
flags |= (jl_options.use_pkgimages & 1); // 0-bit
602+
flags |= ((jl_options.outputo == NULL || jl_options.outputo[0] == '\0') | 1); // 0-bit
603603
flags |= (jl_options.debug_level & 3) << 1; // 1-2 bit
604604
flags |= (jl_options.check_bounds & 3) << 3; // 3-4 bit
605605
flags |= (jl_options.can_inline & 1) << 5; // 5-bit

0 commit comments

Comments
 (0)