Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inconsistent search path for compilecache (still looks in .) #12722

Closed
stevengj opened this issue Aug 21, 2015 · 4 comments · Fixed by #12725
Closed

inconsistent search path for compilecache (still looks in .) #12722

stevengj opened this issue Aug 21, 2015 · 4 comments · Fixed by #12725
Labels
bug Indicates an unexpected problem or unintended behavior compiler:precompilation Precompilation of modules
Milestone

Comments

@stevengj
Copy link
Member

After #12695 and 75ab360, require no longer looks in the current directory. However, Base.compilecache uses include and so it still looks in the current directory.

This inconsistency needs to be fixed by 0.4, I think.

@stevengj stevengj added bug Indicates an unexpected problem or unintended behavior compiler:precompilation Precompilation of modules labels Aug 21, 2015
@stevengj stevengj added this to the 0.4.0 milestone Aug 21, 2015
@JeffBezanson
Copy link
Sponsor Member

Actually I think the real problem is

path = find_in_path(name)

compilecache uses include, but it passes it an absolute path. However it should pass nothing as the working directory to find_in_path the way require does.

@stevengj
Copy link
Member Author

Right, that should do it.

@stevengj
Copy link
Member Author

Note that recompiling a stale cache file still works even if the module is no longer in the path, because the cache file embeds the absolute path of the module it came from. This leads to the odd situation where using Foo works if Foo was ever in the path and was compiled, but ceases to work if the cache file is deleted.

This would be solved by making the LOAD_PATH part of the .ji file header, but I think it would be annoying to have to recompile all your packages whenever you change the load path. A nicer alternative: when loading Foo.ji, consider it stale if the stored path of Foo.jl does not match what find_in_path(Foo.jl) returns.

@stevengj
Copy link
Member Author

(I should have a PR shortly.)

stevengj added a commit to stevengj/julia that referenced this issue Aug 21, 2015
…d .ji files should be considered stale if the module is no longer found at the same path
stevengj added a commit to stevengj/julia that referenced this issue Aug 21, 2015
…d .ji files should be considered stale if the module is no longer found at the same path
stevengj added a commit to stevengj/julia that referenced this issue Aug 21, 2015
…d .ji files should be considered stale if the module is no longer found at the same path
stevengj added a commit to stevengj/julia that referenced this issue Aug 21, 2015
…d .ji files should be considered stale if the module is no longer found at the same path
stevengj added a commit to stevengj/julia that referenced this issue Aug 21, 2015
…d .ji files should be considered stale if the module is no longer found at the same path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior compiler:precompilation Precompilation of modules
Projects
None yet
2 participants