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

cache compile dep tracking #18150

Merged
merged 4 commits into from
Aug 25, 2016
Merged

cache compile dep tracking #18150

merged 4 commits into from
Aug 25, 2016

Conversation

vtjnash
Copy link
Sponsor Member

@vtjnash vtjnash commented Aug 19, 2016

This implements the dependency tracking for compilecache that I was envisioning from the beginning. The idea here is to not only fix #18069 (the first commit), but also to make sure the situation seen on JuliaBox can't happen. Instead, it will prefer using a stale cache over replacing it with one that can't be loaded into the current session. In a different (new) session, it will rebuild the whole cache as normal.

For example, after this PR, the following works, whereas in the existing design, loading FixedPointNumbers would require first calling reload(:Compat):

julia> using Compat
shell> touch ~/.julia/v0.6/Compat/src/Compat.jl
julia> using FixedPointNumbers # needs Compat

@vtjnash vtjnash added backport pending 0.4 needs tests Unit tests are required for this change needs docs Documentation for this change is required labels Aug 19, 2016
end
provides_concrete && return false # this is the file we want

# now check if this file is fresh relative to it's source files
Copy link
Contributor

Choose a reason for hiding this comment

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

its

@tkelman
Copy link
Contributor

tkelman commented Aug 19, 2016

Please elaborate in some comments what is meant by "concrete dependency." That term is used many times here but not explained at all.

@ViralBShah
Copy link
Member

@tkelman We will need a new release of 0.4 based on this - perhaps this and any other things can form the basis of a final 0.4 release.

For now, we have a temporary workaround on JuliaBox.

@ViralBShah
Copy link
Member

Cc @nkottary @tanmaykm

@vtjnash vtjnash force-pushed the jn/cache-compile-dep-tracking branch from b83891f to d2d520e Compare August 22, 2016 19:28
end

# these return either the array of modules loaded from the path / content given
# an Exception that describes why it couldn't be loaded
Copy link
Contributor

Choose a reason for hiding this comment

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

or an Exception ?

@vtjnash vtjnash removed needs docs Documentation for this change is required needs tests Unit tests are required for this change labels Aug 22, 2016
@vtjnash vtjnash changed the title wip: cache compile dep tracking cache compile dep tracking Aug 22, 2016
@ViralBShah
Copy link
Member

Merge?

@ViralBShah ViralBShah added this to the 0.5.x milestone Aug 23, 2016
@vtjnash vtjnash force-pushed the jn/cache-compile-dep-tracking branch from d2d520e to ba9a921 Compare August 23, 2016 17:41
For file dependencies, a change is determined by examining whether the modification time
of each file loaded by `include` or added explicity by ``include_dependency`` is unchanged,
or equal to the modification time truncated to the nearest second
(to accomodate systems that can't copy mtime with sub-second accuracy).
Copy link
Contributor

Choose a reason for hiding this comment

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

accommodate has 2 m's, and should spell out mtime otherwise it's jargon

@vtjnash vtjnash force-pushed the jn/cache-compile-dep-tracking branch from ba9a921 to b104b5f Compare August 23, 2016 19:38
or explicit dependencies declared by ``include_dependency(path)`` in the module file(s).

For file dependencies, a change is determined by examining whether the modification time (mtime)
of each file loaded by `include` or added explicity by ``include_dependency`` is unchanged,
Copy link
Contributor

Choose a reason for hiding this comment

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

rst, needs double backticks

this gives the caller more control over when an how errors get printed
…pile caches

this ensures that we only recompile a dependency if either:
it can be loaded into the current session, or
the user explicitly requests it (via reload)

thereby reducing the occurrences and improving the accuracy
of the "uuid didn't match" error message :)
@ViralBShah
Copy link
Member

@tkelman Is this PR included in 0.5rc3? If not, are you thinking to put out 0.5rc4 with this included - or is this slated for 0.5.1?

tkelman pushed a commit that referenced this pull request Aug 29, 2016
tkelman pushed a commit that referenced this pull request Aug 29, 2016
this gives the caller more control over when an how errors get printed

(cherry picked from commit 5abccb6)
ref #18150
tkelman pushed a commit that referenced this pull request Aug 29, 2016
…pile caches

this ensures that we only recompile a dependency if either:
it can be loaded into the current session, or
the user explicitly requests it (via reload)

thereby reducing the occurrences and improving the accuracy
of the "uuid didn't match" error message :)

(cherry picked from commit 0df6e61)
ref #18150
tkelman pushed a commit that referenced this pull request Aug 29, 2016
@tkelman
Copy link
Contributor

tkelman commented Aug 29, 2016

#18276

tkelman added a commit that referenced this pull request Aug 29, 2016
so `JULIA_CPU_CORES=1 ./julia test/runtests.jl core compile` passes
after #18150
tkelman added a commit that referenced this pull request Aug 29, 2016
so `JULIA_CPU_CORES=1 ./julia test/runtests.jl core compile` passes
after #18150

(cherry picked from commit cfceca4)
ref #18279
stevengj pushed a commit that referenced this pull request Aug 29, 2016
so `JULIA_CPU_CORES=1 ./julia test/runtests.jl core compile` passes
after #18150
tkelman added a commit that referenced this pull request Aug 29, 2016
so `JULIA_CPU_CORES=1 ./julia test/runtests.jl core compile` passes
after #18150
(cherry picked from commit 10f3c35)
vtjnash added a commit that referenced this pull request Aug 30, 2016
vtjnash added a commit that referenced this pull request Aug 30, 2016
mfasi pushed a commit to mfasi/julia that referenced this pull request Sep 5, 2016
so `JULIA_CPU_CORES=1 ./julia test/runtests.jl core compile` passes
after JuliaLang#18150
vtjnash added a commit that referenced this pull request Sep 5, 2016
also add plenty of helpful debugging information enabled by the environment variable:
JULIA_DEBUG_LOADING

this bug would cause compilation to become confused
and likely tardy at recompiling files when it should
that would up with longer dependency chains where one
of the files had been updated

this is a fix for #18150
vtjnash added a commit that referenced this pull request Sep 6, 2016
also add plenty of helpful debugging information enabled by the environment variable:
JULIA_DEBUG_LOADING

this bug would cause compilation to become confused
and likely tardy at recompiling files when it should
that would up with longer dependency chains where one
of the files had been updated

this is a fix for #18150
vtjnash added a commit that referenced this pull request Sep 6, 2016
also add plenty of helpful debugging information enabled by the environment variable:
JULIA_DEBUG_LOADING

this bug would cause compilation to become confused
and likely tardy at recompiling files when it should
that would up with longer dependency chains where one
of the files had been updated

this is a fix for #18150
vtjnash added a commit that referenced this pull request Sep 7, 2016
also add plenty of helpful debugging information enabled by the environment variable:
JULIA_DEBUG_LOADING

this bug would cause compilation to become confused
and likely tardy at recompiling files when it should
that would up with longer dependency chains where one
of the files had been updated

this is a fix for #18150
vtjnash added a commit that referenced this pull request Sep 7, 2016
also add plenty of helpful debugging information enabled by the environment variable:
JULIA_DEBUG_LOADING

this bug would cause compilation to become confused
and likely tardy at recompiling files when it should
that would up with longer dependency chains where one
of the files had been updated

this is a fix for #18150
tkelman pushed a commit that referenced this pull request Sep 7, 2016
also add plenty of helpful debugging information enabled by the environment variable:
JULIA_DEBUG_LOADING

this bug would cause compilation to become confused
and likely tardy at recompiling files when it should
that would up with longer dependency chains where one
of the files had been updated

this is a fix for #18150
tkelman pushed a commit that referenced this pull request Sep 7, 2016
also add plenty of helpful debugging information enabled by the environment variable:
JULIA_DEBUG_LOADING

this bug would cause compilation to become confused
and likely tardy at recompiling files when it should
that would up with longer dependency chains where one
of the files had been updated

this is a fix for #18150
(cherry picked from commit 718bd3e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

precompile loads the wrong library after recompile_stale
5 participants