UndefVarError(:JULIA_HOME) when building user image involving Compat

I am trying to build a userimage by running

include(joinpath(JULIA_HOME, Base.DATAROOTDIR, "julia", "build_sysimg.jl"))
build_sysimg(default_sysimg_path(), "native", "userimage.jl", force=true)

where the file userimage.jl contains some using PackageName statements. This has worked well for me before, but now I get UndefVarError(:JULIA_HOME) that originates in the Compat package. Full error below. I tried building an image without userimage.jl which worked fine, but as soon as Compat is loaded it fails. Any ideas on how to resolve this? Thanks!

/home/fredrikb/julia/share/julia/base/precompile.jl
LoadError("sysimg.jl", 411, LoadError("/home/fredrikb/julia/share/julia/base/userimg.jl", 1, LoadError("/home/fredrikb/.julia/v0.6/StatsBase/src/StatsBase.jl", 8, LoadError("/home/fredrikb/.julia/v0.6/DataStructures/src/DataStructures.jl", 19, LoadError("/home/fredrikb/.julia/v0.6/Compat/src/Compat.jl", 589, UndefVarError(:JULIA_HOME))))))
ERROR: failed process: Process(`/home/fredrikb/julia/bin/julia -C native --output-ji /home/fredrikb/julia/lib/julia/sys.ji --output-o /home/fredrikb/julia/lib/julia/sys.o -J /home/fredrikb/julia/lib/julia/inference.ji --startup-file=no sysimg.jl`, ProcessExited(1)) [1]
Stacktrace:
 [1] pipeline_error(::Base.Process) at ./process.jl:682
 [2] run(::Cmd) at ./process.jl:651
 [3] (::##12#13{Bool,String})() at /home/fredrikb/julia/share/julia/build_sysimg.jl:81
 [4] cd(::##12#13{Bool,String}, ::String) at ./file.jl:70
 [5] #build_sysimg#11(::Bool, ::Bool, ::Function, ::String, ::String, ::String) at /home/fredrikb/julia/share/julia/build_sysimg.jl:48
 [6] (::#kw##build_sysimg)(::Array{Any,1}, ::#build_sysimg, ::String, ::String, ::String) at ./<missing>:0

See https://github.com/JuliaLang/Compat.jl/pull/439

1 Like

Thanks! I guess it will be resolved shortly then =)