File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -1264,6 +1264,8 @@ function compilecache(pkg::PkgId, path::String)
1264
1264
open (cachefile, " a+" ) do f
1265
1265
write (f, _crc32c (seekstart (f)))
1266
1266
end
1267
+ # inherit permission from the source file
1268
+ chmod (cachefile, filemode (path) & 0o777 )
1267
1269
elseif p. exitcode == 125
1268
1270
return PrecompilableError ()
1269
1271
else
Original file line number Diff line number Diff line change 797
797
end
798
798
end
799
799
800
+ # Issue #25971
801
+ let
802
+ load_path = mktempdir ()
803
+ load_cache_path = mktempdir ()
804
+ try
805
+ pushfirst! (LOAD_PATH , load_path)
806
+ pushfirst! (DEPOT_PATH , load_cache_path)
807
+ sourcefile = joinpath (load_path, " Foo25971.jl" )
808
+ write (sourcefile, " module Foo25971 end" )
809
+ chmod (sourcefile, 0o666 )
810
+ cachefile = Base. compilecache (Base. PkgId (" Foo25971" ))
811
+ @test filemode (sourcefile) == filemode (cachefile)
812
+ chmod (sourcefile, 0o600 )
813
+ cachefile = Base. compilecache (Base. PkgId (" Foo25971" ))
814
+ @test filemode (sourcefile) == filemode (cachefile)
815
+ finally
816
+ rm (load_path, recursive= true )
817
+ rm (load_cache_path, recursive= true )
818
+ filter! ((≠ )(load_path), LOAD_PATH )
819
+ filter! ((≠ )(load_cache_path), DEPOT_PATH )
820
+ end
821
+ end
822
+
800
823
end # !withenv
You can’t perform that action at this time.
0 commit comments