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)
12641264 open (cachefile, " a+" ) do f
12651265 write (f, _crc32c (seekstart (f)))
12661266 end
1267+ # inherit permission from the source file
1268+ chmod (cachefile, filemode (path) & 0o777 )
12671269 elseif p. exitcode == 125
12681270 return PrecompilableError ()
12691271 else
Original file line number Diff line number Diff line change 797797 end
798798end
799799
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+
800823end # !withenv
You can’t perform that action at this time.
0 commit comments