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

Make cache mismatch log more informative #48168

Merged
merged 2 commits into from
Jan 8, 2023

Conversation

IanButterworth
Copy link
Member

Master

┌ Debug: Rejecting cache file /tmp/jl_aCrjdm/compiled/v1.9/LibSSH2_jll/K6mup_TmZuG.ji for LibSSH2_jll [29816b5a-b9ab-546f-933c-edad1886dfa8] since the flags are mismatched
│   cachefile_flags = 35
│   current_flags = 51
└ @ Base loading.jl:2526

This PR

% ./julia -O2
julia> using Revise
[ Info: Precompiling Revise [295af30f-e4ad-537b-8983-00126c2a3abe]

% JULIA_DEBUG=loading ./julia -O3
julia> using Revise
┌ Debug: Rejecting cache file /Users/ian/.julia/compiled/v1.10/Revise/M1Qoh_7IH4d.ji for Revise [295af30f-e4ad-537b-8983-00126c2a3abe] since the flags are mismatched
│   current session: use_pkgimages = true, debug_level = 1, check_bounds = false, opt_level = 3
│   cache file:      use_pkgimages = true, debug_level = 1, check_bounds = false, opt_level = 2
└ @ Base loading.jl:2550

@@ -621,6 +621,7 @@ JL_DLLEXPORT uint8_t jl_cache_flags(void)
flags |= (jl_options.opt_level & 3) << 4;
// NOTES:
// In contrast to check-bounds, inline has no "observable effect"
Copy link
Member

Choose a reason for hiding this comment

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

Btw @vchuravy, what does this mean?

Copy link
Member

Choose a reason for hiding this comment

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

Uhm... That I have not used --inline ever.

We should probably still split the cache since if you accidentially compile a pkgimg with --inline it will poison the cache due to

`--compiled-modules`, `--inline`, `--check-bounds`, `--optimize`, `-g`,
&
io = open(pipeline(addenv(`$(julia_cmd(;cpu_target)::Cmd) $(opts)

My original reasoning was that whether we inline or not is not an observable effect, since it is a pure optimization.

Copy link
Member

Choose a reason for hiding this comment

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

it will poison the cache due to

Yeah, I was thinking if you run with --inline=no you poison it with very slow code.

base/loading.jl Outdated Show resolved Hide resolved
@brenhinkeller brenhinkeller added the error messages Better, more actionable error messages label Jan 7, 2023
@DilumAluthge
Copy link
Member

Backportable to 1.9?

@IanButterworth IanButterworth added the backport 1.9 Change should be backported to release-1.9 label Jan 8, 2023
@IanButterworth
Copy link
Member Author

Is there an easy way to get more debug info out of this cache miss point? Why they can't be loaded etc.

@debug "Rejecting cache file $cachefile for $modkey since pkgimage can't be loaded on this target"

@vchuravy
Copy link
Member

vchuravy commented Jan 8, 2023

Not easily no. This relates to multi-versioning and means that the cache file created is not compatible to the current sysimages.

@IanButterworth
Copy link
Member Author

@vchuravy RTM?

@IanButterworth IanButterworth merged commit 0847a7f into JuliaLang:master Jan 8, 2023
@IanButterworth IanButterworth deleted the ib/cache_flags_log branch January 8, 2023 17:42
KristofferC pushed a commit that referenced this pull request Jan 10, 2023
@KristofferC KristofferC mentioned this pull request Jan 10, 2023
41 tasks
@KristofferC KristofferC removed the backport 1.9 Change should be backported to release-1.9 label Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error messages Better, more actionable error messages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants