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

precompilepkgs: respect loaded dependencies when precompiling for load #56901

Conversation

IanButterworth
Copy link
Member

With this Pkg.precompile still precompiles for a clean session with the existing warning about different loaded versions, but now load-time precompilation precompiles for the current session respecting the loaded versions of deps.

So the old style precompilation is avoided at load-time now.

However, there's still no warning at load time about the wrong dep version being used, but at least it's clearer at install-time now.

Screenshot 2024-12-24 at 8 40 40 AM

@IanButterworth IanButterworth added packages Package management and loading backport 1.11 Change should be backported to release-1.11 labels Dec 24, 2024
@IanButterworth IanButterworth force-pushed the ib/precompile_respect_loaded_loading branch from 56b416b to 2066d21 Compare December 24, 2024 13:42
@@ -1158,7 +1160,7 @@ function precompile_pkgs_maybe_cachefile_lock(f, io::IO, print_lock::ReentrantLo
# wait until the lock is available
@invokelatest Base.mkpidlock_hook(() -> begin
# double-check in case the other process crashed or the lock expired
if Base.isprecompiled(pkg; ignore_loaded=true, flags=cacheflags) # don't use caches for this as the env state will have changed
if Base.isprecompiled(pkg; ignore_loaded, flags=cacheflags) # don't use caches for this as the env state will have changed
Copy link
Member Author

Choose a reason for hiding this comment

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

I don't recall a reason for this to be forced false. I'm assuming it was just missed.

staledeps = stale_cachefile(sourcepath, path_to_try, ignore_loaded = true, requested_flags=flags)
staledeps = stale_cachefile(sourcepath, path_to_try; ignore_loaded, requested_flags=flags)
Copy link
Member

Choose a reason for hiding this comment

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

IIUC, this was to allow the user to compute the best pkg to load for compilecache_path, even if it is currently loaded at a different version?

Copy link
Member

Choose a reason for hiding this comment

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

Or maybe it was just missed originally? c24136d

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it could've been. It's not mentioned in the PR #50218

@IanButterworth
Copy link
Member Author

I've expanded the explanation at Pkg time to explain why further precompilation may be hit at load time.

Screenshot 2024-12-27 at 7 38 25 PM

@IanButterworth IanButterworth force-pushed the ib/precompile_respect_loaded_loading branch from 65009dc to 9a10434 Compare December 30, 2024 03:00
@IanButterworth IanButterworth added the merge me PR is reviewed. Merge when all tests are passing label Dec 30, 2024
@IanButterworth IanButterworth merged commit 27ebbf0 into JuliaLang:master Dec 30, 2024
8 checks passed
@inkydragon inkydragon removed the merge me PR is reviewed. Merge when all tests are passing label Jan 2, 2025
@KristofferC KristofferC mentioned this pull request Jan 2, 2025
51 tasks
KristofferC pushed a commit that referenced this pull request Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 1.11 Change should be backported to release-1.11 packages Package management and loading
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants