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

Base.Filesystem.TEMP_CLEANUP not empty after generating sysimage #43702

Closed
vtjnash opened this issue Jan 7, 2022 · 4 comments · Fixed by #43761
Closed

Base.Filesystem.TEMP_CLEANUP not empty after generating sysimage #43702

vtjnash opened this issue Jan 7, 2022 · 4 comments · Fixed by #43761
Labels
regression Regression in behavior compared to a previous version

Comments

@vtjnash
Copy link
Member

vtjnash commented Jan 7, 2022

$ julia-1.6.4  -E 'Base.Filesystem.TEMP_CLEANUP'
Dict{String, Bool}("/tmp/jl_yLYZab" => 0, "/tmp/jl_MkvBa2" => 0)
$ julia-1.6.4  -E 'Base.Filesystem.TEMP_CLEANUP'
Dict{String, Bool}("/tmp/jl_yLYZab" => 0, "/tmp/jl_MkvBa2" => 0)
$ julia-1.6.4  -E 'Base.Filesystem.TEMP_CLEANUP'
Dict{String, Bool}("/tmp/jl_yLYZab" => 0, "/tmp/jl_MkvBa2" => 0)
$ ./julia -q -E 'Base.Filesystem.TEMP_CLEANUP'
Dict{String, Bool}("/var/folders/r7/k49rwnbx0w15d55pw31jlrrr0000gn/T/jl_2StMMx/jl_pn2QMwQbLq" => 0, "/var/folders/r7/k49rwnbx0w15d55pw31jlrrr0000gn/T/jl_2StMMx/jl_9WqJ99NSqZ" => 0)
$ ./julia -q -E 'Base.Filesystem.TEMP_CLEANUP'
Dict{String, Bool}("/var/folders/r7/k49rwnbx0w15d55pw31jlrrr0000gn/T/jl_2StMMx/jl_pn2QMwQbLq" => 0, "/var/folders/r7/k49rwnbx0w15d55pw31jlrrr0000gn/T/jl_2StMMx/jl_9WqJ99NSqZ" => 0)
$ ./julia -q -E 'Base.Filesystem.TEMP_CLEANUP'
Dict{String, Bool}("/var/folders/r7/k49rwnbx0w15d55pw31jlrrr0000gn/T/jl_2StMMx/jl_pn2QMwQbLq" => 0, "/var/folders/r7/k49rwnbx0w15d55pw31jlrrr0000gn/T/jl_2StMMx/jl_9WqJ99NSqZ" => 0)
$ ./julia -e 'using InteractiveUtils; versioninfo()'
Julia Version 1.8.0-DEV.1238
Commit 45faa5c59c* (2022-01-07 04:26 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin21.1.0)
  CPU: Intel(R) Core(TM) i7-8559U CPU @ 2.70GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.0 (ORCJIT, skylake)

(since 1.6, including 1.7, and master)

@vtjnash vtjnash added the regression Regression in behavior compared to a previous version label Jan 7, 2022
@martinholters
Copy link
Member

These paths seem to be left over in the sysimg from:

tmp_prec = tempname(prec_path)
tmp_proc = tempname(prec_path)

Possible simple fix:

diff --git a/contrib/generate_precompile.jl b/contrib/generate_precompile.jl
index 00bbdc2652..b89265ef62 100644
--- a/contrib/generate_precompile.jl
+++ b/contrib/generate_precompile.jl
@@ -430,4 +430,5 @@ empty!(Base.ARGS)
 empty!(Core.ARGS)
 
 end # @eval
+Base.Filesystem.temp_cleanup_purge(force=true)
 end

Or would that have any downsides?

@KristofferC KristofferC changed the title every time I close julia now, it tries to delete the same folders Base.Filesystem.TEMP_CLEANUP not empty after generating sysimage Jan 11, 2022
@KristofferC
Copy link
Member

KristofferC commented Jan 11, 2022

How about just having the delete! in

!ispath(path) && delete!(TEMP_CLEANUP, path)

execute unconditionally?

@martinholters
Copy link
Member

AFAICT that line is never invoked for the paths in question before the system image is written, so modifying it is unlikely to help.

@KristofferC
Copy link
Member

KristofferC commented Jan 11, 2022

I would have thought that the atexit_hooks would still run. Guess I will just try it out :)

Edit: You seem to be right, even though the atexit hook run, it is too late.

KristofferC added a commit that referenced this issue Jan 20, 2022
KristofferC added a commit that referenced this issue Jan 20, 2022
LilithHafner pushed a commit to LilithHafner/julia that referenced this issue Mar 8, 2022
staticfloat pushed a commit that referenced this issue Dec 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression Regression in behavior compared to a previous version
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants