Skip to content

Commit

Permalink
Check for paths instead of path strings
Browse files Browse the repository at this point in the history
  • Loading branch information
mdpradeep authored and vtjnash committed Sep 14, 2016
1 parent c722b13 commit 788ce67
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 788ce67

Please sign in to comment.