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

Precompilation: Fix recognizing when new versions of already loaded packages are already precompiled #2753

Conversation

IanButterworth
Copy link
Sponsor Member

Issue

A MWE should be easy for this issue that @kleinschmidt posted on slack

add Makie
   Resolving package versions...
    Updating `~/stuff/Project.toml`
  [ee78f7c6] + Makie v0.15.2
  No Changes to `~/stuff/Manifest.toml`
Precompiling project...

i.e. The specific Makie version was already in the Manifest where no changes were needed, however precompilation still did work.
I've also seen this in the wild.

Fix

I believe this PR should be the fix, but I've not tested it yet

This disables the Base.stale_cachefile loaded module shortcut during stale cache checks
Depends on https://github.com/IanButterworth/julia/tree/ib/stale_cachefile_ignore_loaded

Basically Base.stale_cachefile was shortcutting the stale check if the package was loaded already because there used to be no reason to do anything else, so once users see those yellow check marks, they keep seeing them any time Pkg.precompile is called, until restarting the session.

@IanButterworth

This comment has been minimized.

@IanButterworth IanButterworth marked this pull request as draft October 6, 2021 16:12
@IanButterworth
Copy link
Sponsor Member Author

IanButterworth commented Oct 8, 2021

This is now working (pushed an update to the julia branch)

Master

(@v1.8) pkg> activate --temp
  Activating new project at `/var/folders/_6/1yf6sj0950vcg4t91m9ltb5w0000gn/T/jl_JD7jtW`

(jl_JD7jtW) pkg> add CSV
    Updating registry at `~/.julia/registries/General.toml`
   Resolving package versions...
    Updating `/private/var/folders/_6/1yf6sj0950vcg4t91m9ltb5w0000gn/T/jl_JD7jtW/Project.toml`
  [336ed68f] + CSV v0.9.6
    Updating `/private/var/folders/_6/1yf6sj0950vcg4t91m9ltb5w0000gn/T/jl_JD7jtW/Manifest.toml`
  [336ed68f] + CSV v0.9.6
  [944b1d66] + CodecZlib v0.7.0
  [9a962f9c] + DataAPI v1.9.0
  [e2d170a0] + DataValueInterfaces v1.0.0
  [48062228] + FilePathsBase v0.9.12
...
Precompiling project...
  18 dependencies successfully precompiled in 12 seconds

julia> using CSV

(jl_JD7jtW) pkg> st --manifest FilePathsBase
Status `/private/var/folders/_6/1yf6sj0950vcg4t91m9ltb5w0000gn/T/jl_JD7jtW/Manifest.toml`
  [48062228] FilePathsBase v0.9.12

(jl_JD7jtW) pkg> add FilePathsBase@0.9.11
   Resolving package versions...
    Updating `/private/var/folders/_6/1yf6sj0950vcg4t91m9ltb5w0000gn/T/jl_JD7jtW/Project.toml`
  [48062228] + FilePathsBase v0.9.11
    Updating `/private/var/folders/_6/1yf6sj0950vcg4t91m9ltb5w0000gn/T/jl_JD7jtW/Manifest.toml`
  [48062228]  FilePathsBase v0.9.12  v0.9.11
Precompiling project...
  ✓ FilePathsBase
  ✓ CSV
  2 dependencies successfully precompiled in 8 seconds (16 already precompiled)
  2 dependencies precompiled but different versions are currently loaded. Restart julia to access the new versions

(jl_JD7jtW) pkg> precompile
Precompiling project...
  ✓ CSV
  1 dependency successfully precompiled in 6 seconds (17 already precompiled)
  1 dependency precompiled but a different version is currently loaded. Restart julia to access the new version

(jl_JD7jtW) pkg> precompile
Precompiling project...
  ✓ CSV
  1 dependency successfully precompiled in 6 seconds (17 already precompiled)
  1 dependency precompiled but a different version is currently loaded. Restart julia to access the new version

This PR

julia> import Pkg
[ Info: Precompiling Pkg [44cfe95a-1eb2-52ea-b672-e2afdf69b79f]

(Pkg) pkg> activate --temp
  Activating new project at `/var/folders/_6/1yf6sj0950vcg4t91m9ltb5w0000gn/T/jl_wqj0rN`

(jl_wqj0rN) pkg> add CSV
    Updating registry at `~/.julia/registries/General.toml`
   Resolving package versions...
    Updating `/private/var/folders/_6/1yf6sj0950vcg4t91m9ltb5w0000gn/T/jl_wqj0rN/Project.toml`
  [336ed68f] + CSV v0.9.6
    Updating `/private/var/folders/_6/1yf6sj0950vcg4t91m9ltb5w0000gn/T/jl_wqj0rN/Manifest.toml`
  [336ed68f] + CSV v0.9.6
  [944b1d66] + CodecZlib v0.7.0
  [9a962f9c] + DataAPI v1.9.0
  [e2d170a0] + DataValueInterfaces v1.0.0
  [48062228] + FilePathsBase v0.9.12
...
Precompiling project...
  18 dependencies successfully precompiled in 13 seconds

julia> using CSV

(jl_wqj0rN) pkg> add FilePathsBase@0.9.11
   Resolving package versions...
    Updating `/private/var/folders/_6/1yf6sj0950vcg4t91m9ltb5w0000gn/T/jl_wqj0rN/Project.toml`
  [48062228] + FilePathsBase v0.9.11
    Updating `/private/var/folders/_6/1yf6sj0950vcg4t91m9ltb5w0000gn/T/jl_wqj0rN/Manifest.toml`
  [48062228]  FilePathsBase v0.9.12  v0.9.11
Precompiling project...
  ✓ FilePathsBase
  ✓ CSV
  2 dependencies successfully precompiled in 8 seconds (16 already precompiled)
  2 dependencies precompiled but different versions are currently loaded. Restart julia to access the new versions

(jl_wqj0rN) pkg> precompile

(jl_wqj0rN) pkg> precompile

@IanButterworth
Copy link
Sponsor Member Author

@kleinschmidt does the above behavior look right to you?

@IanButterworth IanButterworth added backport 1.6 Change should be backported to release-1.6 backport 1.7 Change should be backported to release-1.7 labels Oct 9, 2021
@IanButterworth
Copy link
Sponsor Member Author

JuliaLang/julia#42545 has merged and hit nightly, and tests pass now, so should be good

@IanButterworth IanButterworth merged commit 6e7bf7b into JuliaLang:master Oct 9, 2021
@IanButterworth IanButterworth deleted the ib/precomp_loaded_module_stale_fix branch October 9, 2021 23:10
KristofferC pushed a commit that referenced this pull request Nov 9, 2021
…ackages are already precompiled (#2753)

(cherry picked from commit 6e7bf7b)
@KristofferC KristofferC removed the backport 1.7 Change should be backported to release-1.7 label Nov 10, 2021
@fredrikekre
Copy link
Member

Backported to 1.6 in #2843 AFAICT.

@fredrikekre fredrikekre removed the backport 1.6 Change should be backported to release-1.6 label Mar 18, 2022
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.

3 participants