Skip to content

Commit

Permalink
Merge pull request #18514 from JuliaLang/jn/mdpradeep-18375
Browse files Browse the repository at this point in the history
Check for paths instead of path strings (replace #18375)
  • Loading branch information
tkelman authored Sep 15, 2016
2 parents ad77c0e + 788ce67 commit d52a247
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion base/loading.jl
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ function stale_cachefile(modpath::String, cachefile::String)
end

# now check if this file is fresh relative to its source files
if files[1][1] != modpath
if !samefile(files[1][1], modpath)
DEBUG_LOADING[] && info("JL_DEBUG_LOADING: Rejecting cache file $cachefile because it is for file $(files[1][1])) not file $modpath.")
return true # cache file was compiled from a different path
end
Expand Down
5 changes: 5 additions & 0 deletions test/compile.jl
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,11 @@ try
@test !isdefined(Main, :FooBar)
@test !isdefined(Main, :FooBar1)

relFooBar_file = joinpath(dir, "subfolder", "..", "FooBar.jl")
@test Base.stale_cachefile(relFooBar_file, joinpath(dir, "FooBar.ji")) == !is_windows() # `..` is not a symlink on Windows
mkdir(joinpath(dir, "subfolder"))
@test !Base.stale_cachefile(relFooBar_file, joinpath(dir, "FooBar.ji"))

@eval using FooBar
fb_uuid = Base.module_uuid(Main.FooBar)
sleep(2); touch(FooBar_file)
Expand Down

0 comments on commit d52a247

Please sign in to comment.