GR.jl icon indicating copy to clipboard operation
GR.jl copied to clipboard

precompilation always fails

Open valerianfaber opened this issue 3 years ago • 13 comments
trafficstars

I work on a Macbook Pro, OS X 10.13.6 High Sierra. I have freshly installed Julia 1.7.1. Then tried to install GR.jl using the package manager ( "] add GR" ). Compilation fails: Precompiling project... ✗ GR_jll 0 dependencies successfully precompiled in 4 seconds (79 already precompiled) I then completely removed Julia and the .julia folder and tried again. Still compilation fails. Searched the internet and found many people having the same issue. Tried several suggestions but nothing helped. Please fix this problem as being able to output graphics is crucial to many people. Without proper graphics output Julia becomes useless for most of us.

valerianfaber avatar Feb 01 '22 23:02 valerianfaber

Unfortunately, I can't reproduce the problem.

Could you please start Julia this way : env JULIA_GR_PROVIDER="GR" julia and then ] add GR?

jheinen avatar Feb 02 '22 00:02 jheinen

I just tested it on macOS 10.15.7 - I don't have an older system - and it worked fine, no matter which GR provider I use. Same for BigSur, Monterey (12.2 or 12.3 Beta) using Julia 1.7.1 or Julia 1.8.0-DEV.1440 (both architectures, x86_64 and arm64).

jheinen avatar Feb 02 '22 07:02 jheinen

I tried your suggested steps but GR still does not compile. Please find attached a text file containing the terminal session. Is there a way to make Julia provide more information on why GR does not compile (something like a compiler log)?

Last login: Wed Feb 2 11:31:04 on console Bea:~ frank$ env JULIA_GR_PROVIDER="GR" TERM_PROGRAM=Apple_Terminal SHELL=/bin/bash TERM=xterm-256color TMPDIR=/var/folders/l4/5rg100251z5by7b83w63wlnw0000gn/T/ Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.JLY7rHfQw5/Render TERM_PROGRAM_VERSION=404.1 TERM_SESSION_ID=EDA5E25D-F1B6-4E82-BAA9-35536AD06F14 USER=frank SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.RXNwBGUBUl/Listeners PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin PWD=/Users/frank LANG=de_DE.UTF-8 XPC_FLAGS=0x0 XPC_SERVICE_NAME=0 SHLVL=1 HOME=/Users/frank LOGNAME=frank DISPLAY=/private/tmp/com.apple.launchd.DA7D32kc3E/org.macosforge.xquartz:0 =/usr/bin/env JULIA_GR_PROVIDER=GR Bea:~ frank$ julia _ _ _ () | Documentation: https://docs.julialang.org () | () () | _ _ | | __ _ | Type "?" for help, "]?" for Pkg help. | | | | | | |/ ` | | | | || | | | (| | | Version 1.7.1 (2021-12-22) / |_'|||_'_| | Official https://julialang.org/ release |__/ |

@.***) pkg> add GR Updating registry at ~/.julia/registries/General.toml Resolving package versions... No Changes to ~/.julia/environments/v1.7/Project.toml No Changes to ~/.julia/environments/v1.7/Manifest.toml

@.***) pkg> precompile Precompiling project... ✗ GR_jll 0 dependencies successfully precompiled in 4 seconds (98 already precompiled)

@.***) pkg>

Am 02.02.2022 um 01:47 schrieb Josef Heinen @.***>:

Unfortunately, I can't reproduce the problem.

Could you please start Julia this way : env JULIA_GR_PROVIDER="GR" julia and then ] add GR?

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.

valerianfaber avatar Feb 02 '22 10:02 valerianfaber

I can confirm that GR does compile on an iMac with M1 processor running OS Monterey 12.2 using the experimental macOS ARM version of Julia.

But what can be the reason that it does not compile on my MacBook Pro running High Sierra?

Am 02.02.2022 um 08:19 schrieb Josef Heinen @.***>:

I just tested it on macOS 10.15.7 - I don't have an older system - and it worked fine, no matter which GR provider I use. Same for BigSur, Monterey (12.2 or 12.3 Beta) using Julia 1.7.1 or Julia 1.8.0-DEV.1440 (both architectures, x86_64 and arm64).

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.

valerianfaber avatar Feb 02 '22 10:02 valerianfaber

In the meantime, I found a macOS 10.13.6 host and could reproduce the problem. According to my tests, GR_jll requires at least macOS 10.14. This seems to be a problem with one of the dependencies provided by BinaryBuilder.jl.

With env JULIA_GR_PROVIDER=GR julia ... you can apparently ignore the error - at least I could generate plots. With this environment, "our" binaries are downloaded and used during run-time.

    Building GR → `~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/4a740db447aae0fbeb3ee730de1afbb14ac798a1/build.log`
Precompiling project...
  ✗ GR_jll
  79 dependencies successfully precompiled in 21 seconds
  1 dependency errored. To see a full report either run `import Pkg; Pkg.precompile()` or load the package

julia> using GR
julia> version()
"0.63.1"
julia> inline("svg")
"svg"
julia> plot(randn(10))
GR.SVG(UInt8[0x3c, 0x3f, 0x78, 0x6d, 0x6c, 0x20, 0x76, 0x65, 0x72, 0x73  …  0x2f, 0x3e, 0x0a, 0x3c, 0x2f, 0x73, 0x76, 0x67, 0x3e, 0x0a])

jheinen avatar Feb 02 '22 12:02 jheinen

Many thanks for your prompt support!

I don’t know if there is a chance that BinaryBuilder will be improved to remedy this issue. If not, it may be worth to add a notice or warning that GR.jl requires at least macOS 10.14. That would save especially beginners like me from hours of frustration.

valerianfaber avatar Feb 02 '22 13:02 valerianfaber

I am also seeing a precompile error. The error message is a bit more explicit:

ERROR: LoadError: ArgumentError: not a path: `C:\Users\DNF\.julia\packages\GR\KPElO\deps\deps.jl

And, indeed, there is no file deps.jl in that location, only a single file, build.jl.

This is with GR v0.63.1 and Julia v1.7.1 on Windows 10.

Adding a blank deps.jl file to this folder triggered a successful rebuild, and GR now seems to work. But it's a strange thing. I removed and re-added GR several times, updated Julia, etc. but nothing worked until I added that blank file.

DNF2 avatar Feb 08 '22 09:02 DNF2

I am also seeing a precompile error. The error message is a bit more explicit:

ERROR: LoadError: ArgumentError: not a path: `C:\Users\DNF\.julia\packages\GR\KPElO\deps\deps.jl

Same error for me on Windows:

julia> using GR
 │ Package GR not found, but a package named GR is available from a registry. 
 │ Install package?
 │   (v1.7) pkg> add GR
 └ (y/n) [y]: y
    Updating registry at `d:\julia_depot\registries\General.toml`
   Resolving package versions...
    Updating `D:\julia_depot\environments\v1.7\Project.toml`
  [28b8d3ca] + GR v0.64.0
  No Changes to `D:\julia_depot\environments\v1.7\Manifest.toml`
Precompiling project...
  ✗ GR
  ✗ Plots
  57 dependencies successfully precompiled in 69 seconds (69 already precompiled)
  2 dependencies errored. To see a full report either run `import Pkg; Pkg.precompile()` or load the packages
[ Info: Precompiling GR [28b8d3ca-fb5f-59d9-8090-bfdbd6d07a71]
ERROR: LoadError: ArgumentError: not a path: `d:\julia_depot\packages\GR\jpQcZ\deps\deps.jl`
Stacktrace:
 [1] RelocatableFolders.Path(mod::Module, dir::String, path::String)
   @ RelocatableFolders d:\julia_depot\packages\RelocatableFolders\PYUl8\src\RelocatableFolders.jl:51
 [2] top-level scope
   @ d:\julia_depot\packages\GR\jpQcZ\src\GR.jl:36
 [3] include
   @ .\Base.jl:418 [inlined]
 [4] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::Nothing)
   @ Base .\loading.jl:1318
 [5] top-level scope
   @ none:1
 [6] eval
   @ .\boot.jl:373 [inlined]
 [7] eval(x::Expr)
   @ Base.MainInclude .\client.jl:453
 [8] top-level scope
   @ none:1
in expression starting at d:\julia_depot\packages\GR\jpQcZ\src\GR.jl:2
ERROR: Failed to precompile GR [28b8d3ca-fb5f-59d9-8090-bfdbd6d07a71] to d:\julia_depot\compiled\v1.7\GR\jl_5A1E.tmp.Stacktrace:
 [1] error(s::String)
   @ Base .\error.jl:33
 [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, ignore_loaded_modules::Bool)
   @ Base .\loading.jl:1466
 [3] compilecache(pkg::Base.PkgId, path::String)
   @ Base .\loading.jl:1410
 [4] _require(pkg::Base.PkgId)
   @ Base .\loading.jl:1120
 [5] require(uuidkey::Base.PkgId)
   @ Base .\loading.jl:1013
 [6] require(into::Module, mod::Symbol)
   @ Base .\loading.jl:997

epogrebnyak avatar Mar 06 '22 12:03 epogrebnyak

After providing empty deps.jl file as @DNF2 suggested precompilation passes:

julia> using GR
[ Info: Precompiling GR [28b8d3ca-fb5f-59d9-8090-bfdbd6d07a71]
Your GR installation is incomplete. Rerunning build step for GR package.
┌ Info: Creating depsfile. GR provider is BinaryBuilder
│   provider = "BinaryBuilder"
└   depsfile = "d:\\julia_depot\\packages\\GR\\jpQcZ\\deps\\deps.jl"
[ Info: GR was successfully rebuilt

epogrebnyak avatar Mar 06 '22 12:03 epogrebnyak

Maybe it is worth considering adding empty deps\\deps.jl to source in this repo?

epogrebnyak avatar Mar 06 '22 12:03 epogrebnyak

I'm running into the same issue but wasn't running into it a few months ago. Is there a official way to resolve this issue? It's harder for me to make changes like "create a deps.jl file" on a users machine.

kdheepak avatar May 24 '22 22:05 kdheepak

I had to do this for this to work: ENV["JULIA_GR_REBUILD"] = true; using Pkg; Pkg.build("GR").

kdheepak avatar May 24 '22 23:05 kdheepak

@kdheepak Suggestion didn't work for me.

I still end up with:

using GR
ERROR: InitError: UndefVarError: GR_jll not defined
Stacktrace:
 [1] __init__()
   @ GR.GRPreferences ~/.julia/packages/GR/uzy0J/src/preferences.jl:36
 [2] _include_from_serialized(pkg::Base.PkgId, path::String, depmods::Vector{Any})
   @ Base ./loading.jl:831
 [3] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt64)
   @ Base ./loading.jl:1039
 [4] _require(pkg::Base.PkgId)
   @ Base ./loading.jl:1315
 [5] _require_prelocked(uuidkey::Base.PkgId)
   @ Base ./loading.jl:1200
 [6] macro expansion
   @ ./loading.jl:1180 [inlined]
 [7] macro expansion
   @ ./lock.jl:223 [inlined]
 [8] require(into::Module, mod::Symbol)
   @ Base ./loading.jl:1144
during initialization of module GRPreferences

lewisl avatar Nov 02 '22 01:11 lewisl