@@ -16,7 +16,7 @@ using .ConflictingBindings
16
16
dir = mktempdir ()
17
17
dir2 = mktempdir ()
18
18
insert! (LOAD_PATH , 1 , dir)
19
- insert! (Base . LOAD_CACHE_PATH , 1 , dir)
19
+ insert! (DEPOT_PATH , 1 , dir)
20
20
try
21
21
Foo_file = joinpath (dir, " $Foo_module .jl" )
22
22
Foo2_file = joinpath (dir, " $Foo2_module .jl" )
166
166
@test Foo. override (UInt (1 )) == 2
167
167
end
168
168
169
- cachefile = joinpath (dir, " $Foo_module .ji" )
169
+ cachedir = joinpath (dir, " compiled" , " v$(VERSION . major) .$(VERSION . minor) " )
170
+ cachedir2 = joinpath (dir2, " compiled" , " v$(VERSION . major) .$(VERSION . minor) " )
171
+ cachefile = joinpath (cachedir, " $Foo_module .ji" )
170
172
# use _require_from_serialized to ensure that the test fails if
171
173
# the module doesn't reload from the image:
172
174
@test_logs (:warn , " Replacing module `$Foo_module `" ) begin
@@ -293,36 +295,36 @@ try
293
295
""" )
294
296
295
297
Base. compilecache (Base. PkgId (" FooBar" ))
296
- @test isfile (joinpath (dir , " FooBar.ji" ))
297
- @test Base. stale_cachefile (FooBar_file, joinpath (dir , " FooBar.ji" )) isa Vector
298
+ @test isfile (joinpath (cachedir , " FooBar.ji" ))
299
+ @test Base. stale_cachefile (FooBar_file, joinpath (cachedir , " FooBar.ji" )) isa Vector
298
300
@test ! isdefined (Main, :FooBar )
299
301
@test ! isdefined (Main, :FooBar1 )
300
302
301
303
relFooBar_file = joinpath (dir, " subfolder" , " .." , " FooBar.jl" )
302
- @test Base. stale_cachefile (relFooBar_file, joinpath (dir , " FooBar.ji" )) isa (Sys. iswindows () ? Vector : Bool) # `..` is not a symlink on Windows
304
+ @test Base. stale_cachefile (relFooBar_file, joinpath (cachedir , " FooBar.ji" )) isa (Sys. iswindows () ? Vector : Bool) # `..` is not a symlink on Windows
303
305
mkdir (joinpath (dir, " subfolder" ))
304
- @test Base. stale_cachefile (relFooBar_file, joinpath (dir , " FooBar.ji" )) isa Vector
306
+ @test Base. stale_cachefile (relFooBar_file, joinpath (cachedir , " FooBar.ji" )) isa Vector
305
307
306
308
@eval using FooBar
307
309
fb_uuid = Base. module_build_id (FooBar)
308
310
sleep (2 ); touch (FooBar_file)
309
- insert! (Base . LOAD_CACHE_PATH , 1 , dir2)
310
- @test Base. stale_cachefile (FooBar_file, joinpath (dir , " FooBar.ji" )) === true
311
+ insert! (DEPOT_PATH , 1 , dir2)
312
+ @test Base. stale_cachefile (FooBar_file, joinpath (cachedir , " FooBar.ji" )) === true
311
313
@eval using FooBar1
312
- @test ! isfile (joinpath (dir2 , " FooBar.ji" ))
313
- @test ! isfile (joinpath (dir , " FooBar1.ji" ))
314
- @test isfile (joinpath (dir2 , " FooBar1.ji" ))
315
- @test Base. stale_cachefile (FooBar_file, joinpath (dir , " FooBar.ji" )) === true
316
- @test Base. stale_cachefile (FooBar1_file, joinpath (dir2 , " FooBar1.ji" )) isa Vector
314
+ @test ! isfile (joinpath (cachedir2 , " FooBar.ji" ))
315
+ @test ! isfile (joinpath (cachedir , " FooBar1.ji" ))
316
+ @test isfile (joinpath (cachedir2 , " FooBar1.ji" ))
317
+ @test Base. stale_cachefile (FooBar_file, joinpath (cachedir , " FooBar.ji" )) === true
318
+ @test Base. stale_cachefile (FooBar1_file, joinpath (cachedir2 , " FooBar1.ji" )) isa Vector
317
319
@test fb_uuid == Base. module_build_id (FooBar)
318
320
fb_uuid1 = Base. module_build_id (FooBar1)
319
321
@test fb_uuid != fb_uuid1
320
322
321
323
# test checksum
322
- open (joinpath (dir2 , " FooBar1.ji" ), " a" ) do f
324
+ open (joinpath (cachedir2 , " FooBar1.ji" ), " a" ) do f
323
325
write (f, 0x076cac96 ) # append 4 random bytes
324
326
end
325
- @test Base. stale_cachefile (FooBar1_file, joinpath (dir2 , " FooBar1.ji" )) === true
327
+ @test Base. stale_cachefile (FooBar1_file, joinpath (cachedir2 , " FooBar1.ji" )) === true
326
328
327
329
# test behavior of precompile modules that throw errors
328
330
FooBar2_file = joinpath (dir, " FooBar2.jl" )
@@ -373,10 +375,10 @@ try
373
375
end
374
376
""" )
375
377
rm (FooBarT_file)
376
- @test Base. stale_cachefile (FooBarT2_file, joinpath (dir2 , " FooBarT2.ji" )) === true
378
+ @test Base. stale_cachefile (FooBarT2_file, joinpath (cachedir2 , " FooBarT2.ji" )) === true
377
379
@test Base. require (Main, :FooBarT2 ) isa Module
378
380
finally
379
- splice! (Base . LOAD_CACHE_PATH , 1 : 2 )
381
+ splice! (DEPOT_PATH , 1 : 2 )
380
382
splice! (LOAD_PATH , 1 )
381
383
rm (dir, recursive= true )
382
384
rm (dir2, recursive= true )
@@ -398,15 +400,15 @@ let dir = mktempdir(),
398
400
399
401
eval (quote
400
402
insert! (LOAD_PATH , 1 , $ (dir))
401
- insert! (Base . LOAD_CACHE_PATH , 1 , $ (dir))
403
+ insert! (DEPOT_PATH , 1 , $ (dir))
402
404
Base. compilecache (Base. PkgId (" Time4b3a94a1a081a8cb" ))
403
405
end )
404
406
405
407
exename = ` $(Base. julia_cmd ()) --compiled-modules=yes --startup-file=no`
406
408
407
409
testcode = """
408
410
insert!(LOAD_PATH, 1, $(repr (dir)) )
409
- insert!(Base.LOAD_CACHE_PATH , 1, $(repr (dir)) )
411
+ insert!(DEPOT_PATH , 1, $(repr (dir)) )
410
412
using $Time_module
411
413
getfield($Time_module , :time)
412
414
"""
@@ -421,7 +423,7 @@ let dir = mktempdir(),
421
423
@test parse (Float64, t1_no) < parse (Float64, t2_no)
422
424
423
425
finally
424
- splice! (Base . LOAD_CACHE_PATH , 1 )
426
+ splice! (DEPOT_PATH , 1 )
425
427
splice! (LOAD_PATH , 1 )
426
428
rm (dir, recursive= true )
427
429
end
@@ -448,7 +450,7 @@ let dir = mktempdir()
448
450
449
451
testcode = """
450
452
insert!(LOAD_PATH, 1, $(repr (dir)) )
451
- insert!(Base.LOAD_CACHE_PATH , 1, $(repr (dir)) )
453
+ insert!(DEPOT_PATH , 1, $(repr (dir)) )
452
454
using $Test_module
453
455
"""
454
456
481
483
let dir = mktempdir ()
482
484
try
483
485
insert! (LOAD_PATH , 1 , dir)
484
- insert! (Base . LOAD_CACHE_PATH , 1 , dir)
486
+ insert! (DEPOT_PATH , 1 , dir)
485
487
486
488
loaded_modules = Channel {Symbol} (32 )
487
489
callback = (mod:: Base.PkgId ) -> put! (loaded_modules, Symbol (mod. name))
@@ -521,7 +523,7 @@ let dir = mktempdir()
521
523
@test take! (loaded_modules) == Test3_module
522
524
finally
523
525
pop! (Base. package_callbacks)
524
- splice! (Base . LOAD_CACHE_PATH , 1 )
526
+ splice! (DEPOT_PATH , 1 )
525
527
splice! (LOAD_PATH , 1 )
526
528
rm (dir, recursive= true )
527
529
end
563
565
564
566
@everywhere test_workers begin
565
567
pushfirst! (LOAD_PATH , $ load_path)
566
- pushfirst! (Base . LOAD_CACHE_PATH , $ load_cache_path)
568
+ pushfirst! (DEPOT_PATH , $ load_cache_path)
567
569
end
568
570
try
569
571
@eval using $ ModuleB
579
581
finally
580
582
@everywhere test_workers begin
581
583
popfirst! (LOAD_PATH )
582
- popfirst! (Base . LOAD_CACHE_PATH )
584
+ popfirst! (DEPOT_PATH )
583
585
end
584
586
end
585
587
finally
594
596
(f -> f ())() do # wrap in function scope, so we can test world errors
595
597
dir = mktempdir ()
596
598
insert! (LOAD_PATH , 1 , dir)
597
- insert! (Base . LOAD_CACHE_PATH , 1 , dir)
599
+ insert! (DEPOT_PATH , 1 , dir)
598
600
try
599
601
A_module = :Aedb164bd3a126418
600
602
B_module = :Bedb164bd3a126418
642
644
@test Base. invokelatest (B. bnopc, 1 ) == Base. invokelatest (B. bnopc, 1.0 ) == 2
643
645
finally
644
646
popfirst! (LOAD_PATH )
645
- popfirst! (Base . LOAD_CACHE_PATH )
647
+ popfirst! (DEPOT_PATH )
646
648
rm (dir, recursive= true )
647
649
end
648
650
662
664
""" )
663
665
664
666
pushfirst! (LOAD_PATH , load_path)
665
- pushfirst! (Base . LOAD_CACHE_PATH , load_cache_path)
667
+ pushfirst! (DEPOT_PATH , load_cache_path)
666
668
667
669
l0 = length (Base. package_callbacks)
668
670
@eval using $ ModuleA
700
702
""" )
701
703
702
704
pushfirst! (LOAD_PATH , load_path)
703
- pushfirst! (Base . LOAD_CACHE_PATH , load_cache_path)
705
+ pushfirst! (DEPOT_PATH , load_cache_path)
704
706
705
707
Base. compilecache (Base. PkgId (" A25604" ))
706
708
@test_nowarn @eval using A25604
0 commit comments