Gtk.jl
Gtk.jl copied to clipboard
Move from MutableArtifacts.toml to Scratch.jl?
In general, package directories are supposed to be immutable and static. This makes it for example work with PackageCompiler. However, trying to run the tests on a package compiled instance of Gtk (https://s3.amazonaws.com/julialang-reports/nanosoldier/pkgeval/by_hash/dd0c14b_vs_dd0c14b/Gtk.primary.log) gives
fatal: error thrown and no exception handler available.
InitError(mod=:Gtk, error=Base.SystemError(prefix="opening file "/home/pkgeval/.julia/packages/Gtk/vBOOU/MutableArtifacts.toml"", errnum=2, extrainfo=nothing))
#systemerror#79 at ./error.jl:176
systemerror##kw at ./error.jl:176
systemerror##kw at ./error.jl:176
#systemerror#78 at ./error.jl:175 [inlined]
systemerror at ./error.jl:175 [inlined]
#open#658 at ./iostream.jl:293
open##kw at ./iostream.jl:282 [inlined]
#open#659 at ./iostream.jl:355
open at ./iostream.jl:355
jfptr_open_41474 at /sysimage/sysimg.so (unknown line)
_jl_invoke at /workspace/srcdir/src/gf.c:2304 [inlined]
ijl_apply_generic at /workspace/srcdir/src/gf.c:2486
#open#369 at ./io.jl:382
open at ./io.jl:382 [inlined]
#bind_artifact!#5 at /workspace/srcdir/usr/share/julia/stdlib/v1.8/Pkg/src/Artifacts.jl:245
bind_artifact!##kw at /workspace/srcdir/usr/share/julia/stdlib/v1.8/Pkg/src/Artifacts.jl:188 [inlined]
__init__ at /home/pkgeval/.julia/packages/Gtk/vBOOU/src/Gtk.jl:117
...
The issue is https://github.com/JuliaGraphics/Gtk.jl/blob/530da45c952cdc88671a8e739d09cd94e3b5639c/src/Gtk.jl#L91 where the absolute path of the package is stored during precompile time of the package.
I think it would be preferable to move to use Scratch.jl (https://github.com/JuliaPackaging/Scratch.jl) where there is no assumption about the path of the package itself.
cc @staticfloat
I've started the process here: https://github.com/JuliaGraphics/Gtk.jl/pull/619
I've also simplified some other things; once we can verify that this simplified process works, let's take a second look at whether this fixes relocation issues properly. There are definitely some issues with that (gdk-pixbuf-query-loaders generates absolute paths) but if the scratchspace is just not copied from machine to machine and gets generated on first run, that should be sufficient.