Error "isjulia_display not defined" while trying compile_incremental PyPlot package

HI, I am trying using PackageCompiler to compile_incremental PyPlot package, using predefined snoopfile (runtests.jl), but got following error:

Project.toml:

name = "helloPkg"
uuid = "04847676-9f50-11e9-38a1-b1b365cc1e58"
authors = ["kest <kest@lsmuni.lt>"]
version = "0.1.0"

runtests.jl:

using PyPlot
println("Testing..")
PyPlot.pygui(true)
PyPlot.plot(rand(100))

Compiling:

julia> compile_incremental("/home/kest/Projects/gjJulia/helloPkg/Project.toml","/home/kest/Projects/gjJulia/helloPkg/tests/runtests.jl")
Testing..
ERROR: LoadError: LoadError: UndefVarError: isjulia_display not defined
Stacktrace:
 [1] pygui(::Bool) at /home/kest/.julia/packages/PyPlot/cdCMF/src/init.jl:207
 [2] top-level scope at none:0
 [3] include at ./boot.jl:326 [inlined]
 [4] include_relative(::Module, ::String) at ./loading.jl:1038
 [5] include at ./sysimg.jl:29 [inlined]
 [6] include(::String) at /home/kest/.julia/packages/PackageCompiler/UQ5UO/sysimg/run_julia_code.jl:16
 [7] top-level scope at none:0
 [8] include at ./boot.jl:326 [inlined]
 [9] include_relative(::Module, ::String) at ./loading.jl:1038
 [10] include(::Module, ::String) at ./sysimg.jl:29
 [11] exec_options(::Base.JLOptions) at ./client.jl:267
 [12] _start() at ./client.jl:436
 [13] jl_apply at /buildworker/worker/package_linux64/build/ui/../src/julia.h:1571 [inlined]
 [14] true_main at /buildworker/worker/package_linux64/build/ui/repl.c:96
 [15] main at /buildworker/worker/package_linux64/build/ui/repl.c:217
in expression starting at /home/kest/Projects/gjJulia/helloPkg/tests/runtests.jl:3
in expression starting at /home/kest/.julia/packages/PackageCompiler/UQ5UO/sysimg/run_julia_code.jl:18
ERROR: failed process: Process(`/home/kest/Downloads/julia-1.1.1/bin/julia --optimize=3 --output-o=/home/kest/.julia/packages/PackageCompiler/UQ5UO/sysimg/sys.a -g1 --track-allocation=none --startup-file=no --code-coverage=none --history-file=yes --inline=yes --math-mode=ieee --handle-signals=yes --warn-overwrite=no --project=/home/kest/.julia/environments/v1.1 --compile=yes --depwarn=yes --cpu-target=native --track-allocation=none --sysimage-native-code=yes --sysimage=/home/kest/Downloads/julia-1.1.1/lib/julia/sys.so -g1 --compiled-modules=yes --optimize=2 /home/kest/.julia/packages/PackageCompiler/UQ5UO/sysimg/run_julia_code.jl`, ProcessExited(1)) [1]
Stacktrace:
 [1] error(::String, ::Base.Process, ::String, ::Int64, ::String) at ./error.jl:42
 [2] pipeline_error at ./process.jl:785 [inlined]
 [3] #run#515(::Bool, ::Function, ::Cmd) at ./process.jl:726
 [4] run at ./process.jl:724 [inlined]
 [5] #run_julia#1 at /home/kest/.julia/packages/PackageCompiler/UQ5UO/src/compiler_flags.jl:225 [inlined]
 [6] #run_julia at ./none:0 [inlined]
 [7] #compile_incremental#166(::Bool, ::Bool, ::Bool, ::Nothing, ::Function, ::String, ::String) at /home/kest/.julia/packages/PackageCompiler/MQLET/src/incremental.jl:137
 [8] compile_incremental(::String, ::String) at /home/kest/.julia/packages/PackageCompiler/MQLET/src/incremental.jl:134
 [9] top-level scope at none:0

julia>

Where problem could be?

Actually it is compiling using PackageCompiler#sd-notoml branch! :wink:

julia> compile_incremental(:PyPlot)
┌ Warning: The following test dependencies are not installed: Pkg.Types.PackageSpec[].
│         Snooping based on test scripts will likely fail.
│         Please use `install = true` or install those packages manually
└ @ PackageCompiler ~/.julia/packages/PackageCompiler/UQ5UO/src/snooping.jl:146
[ Info: PyPlot is using Matplotlib 3.1.0 with Python 3.7.3
Build shared library "/home/kest/.julia/packages/PackageCompiler/UQ5UO/sysimg/sys.so":
  `cc -shared '-DJULIAC_PROGRAM_LIBNAME="/home/kest/.julia/packages/PackageCompiler/UQ5UO/sysimg/sys.so"' -o /home/kest/.julia/packages/PackageCompiler/UQ5UO/sysimg/sys.so -Wl,--whole-archive /home/kest/.julia/packages/PackageCompiler/UQ5UO/sysimg/sys.a -Wl,--no-whole-archive -std=gnu99 -I/home/kest/Downloads/julia-1.1.1/include/julia -DJULIA_ENABLE_THREADING=1 -fPIC -L/home/kest/Downloads/julia-1.1.1/lib -Wl,--export-dynamic -Wl,-rpath,/home/kest/Downloads/julia-1.1.1/lib -Wl,-rpath,/home/kest/Downloads/julia-1.1.1/lib/julia -ljulia -m64 -O3`
("/home/kest/.julia/packages/PackageCompiler/UQ5UO/sysimg/sys.so", "/home/kest/.julia/packages/PackageCompiler/MQLET/sysimg/sys.so")

It works very fast, but behaves like pygui(true) was not set - no plot window is displayed:

[kest@archlinux ~]$  /home/kest/Downloads/julia-1.1.1/bin/julia -J /home/kest/.julia/packages/PackageCompiler/UQ5UO/sysimg/sys.so
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.1.1 (2019-05-16)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> using PyPlot

julia> pygui(true)
true

julia> plot(rand(10))
1-element Array{PyCall.PyObject,1}:
 PyObject <matplotlib.lines.Line2D object at 0x7f3a9ca22f98>

julia> 

Any ideas?

If somebody finds it useful, solved here https://github.com/JuliaLang/PackageCompiler.jl/issues/226#issuecomment-509654827