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

compilecache should use same path as require, and treat cache as stale if path changes #12725

Merged
merged 1 commit into from
Aug 21, 2015

Conversation

stevengj
Copy link
Member

This fixes #12722: Base.compilecache should use same path as require (in particular, it shouldn't look in . if that is not in LOAD_PATH). Also, .ji files should be considered stale if the module is no longer found at the same path as when the .ji file was compiled.

@stevengj stevengj added the compiler:precompilation Precompilation of modules label Aug 21, 2015
@stevengj stevengj changed the title fix #12723: compilecache should use same path as require compilecache should use same path as require, and treat cache as stale if path changes Aug 21, 2015
static jl_value_t *unique_func = NULL;
if (!unique_func)
unique_func = jl_get_global(jl_base_module, jl_symbol("unique"));
jl_array_t *udeps = deps && unique_func ? (jl_array_t *) jl_apply((jl_function_t*)unique_func, (jl_value_t**)&deps, 1) : NULL;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

although I think it's safe here since we don't allocate any other memory before being done with this array, I'd be more comfortable if we rooted it anyway. That way it wont blow up if someone changes the code later to allocate something.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I've added JL_GC_PUSH/JL_GC_POP.

@stevengj stevengj force-pushed the precompile_path branch 2 times, most recently from b22d195 to 19e1737 Compare August 21, 2015 13:41
jl_array_t *udeps = deps && unique_func ? (jl_array_t *) jl_apply((jl_function_t*)unique_func, (jl_value_t**)&deps, 1) : NULL;

if (udeps) {
JL_GC_PUSH(udeps);
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be &udeps

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whoops, will fix.

@JeffBezanson
Copy link
Sponsor Member

LGTM.

…d .ji files should be considered stale if the module is no longer found at the same path
@stevengj
Copy link
Member Author

Rebased after #12723.

stevengj added a commit that referenced this pull request Aug 21, 2015
compilecache should use same path as require, and treat cache as stale if path changes
@stevengj stevengj merged commit 7994909 into JuliaLang:master Aug 21, 2015
@stevengj stevengj deleted the precompile_path branch August 21, 2015 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:precompilation Precompilation of modules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

inconsistent search path for compilecache (still looks in .)
3 participants