File tree 2 files changed +15
-6
lines changed
2 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -540,13 +540,10 @@ end
540
540
function recompile_stale (mod, cachefile)
541
541
path = find_in_path (string (mod), nothing )
542
542
if path === nothing
543
- rm (cachefile)
544
- error (" module $mod not found in current path; removed orphaned cache file $cachefile " )
543
+ error (" module $mod not found in current path; you should rm(\" $(escape_string (cachefile)) \" ) to remove the orphaned cache file" )
545
544
end
546
545
if stale_cachefile (path, cachefile)
547
546
info (" Recompiling stale cache file $cachefile for module $mod ." )
548
- if ! success (create_expr_cache (path, cachefile))
549
- error (" Failed to precompile $mod to $cachefile " )
550
- end
547
+ compilecache (mod)
551
548
end
552
549
end
Original file line number Diff line number Diff line change 3
3
using Base. Test
4
4
5
5
dir = mktempdir ()
6
+ dir2 = mktempdir ()
6
7
insert! (LOAD_PATH , 1 , dir)
7
8
insert! (Base. LOAD_CACHE_PATH, 1 , dir)
8
9
Foo_module = :Foo4b3a94a1a081a8cb
71
72
end
72
73
Base. compilecache (" FooBar" )
73
74
sleep (2 )
75
+ @test isfile (joinpath (dir, " FooBar.ji" ))
76
+
77
+ touch (FooBar_file)
78
+ insert! (Base. LOAD_CACHE_PATH, 1 , dir2)
79
+ Base. recompile_stale (:FooBar , joinpath (dir, " FooBar.ji" ))
80
+ sleep (2 )
81
+ @test isfile (joinpath (dir2, " FooBar.ji" ))
82
+ @test Base. stale_cachefile (FooBar_file, joinpath (dir, " FooBar.ji" ))
83
+ @test ! Base. stale_cachefile (FooBar_file, joinpath (dir2, " FooBar.ji" ))
84
+
74
85
open (FooBar_file, " w" ) do f
75
86
print (f, """
76
87
__precompile__(true)
83
94
@test_throws ErrorException Base. require (:FooBar )
84
95
85
96
finally
86
- splice! (Base. LOAD_CACHE_PATH, 1 )
97
+ splice! (Base. LOAD_CACHE_PATH, 1 : 2 )
87
98
splice! (LOAD_PATH , 1 )
88
99
rm (dir, recursive= true )
100
+ rm (dir2, recursive= true )
89
101
end
90
102
91
103
# test --compilecache=no command line option
You can’t perform that action at this time.
0 commit comments