JuliaLang / PackageCompiler.jl

Compile your Julia Package
https://julialang.github.io/PackageCompiler.jl/dev/
MIT License
1.41k stars 189 forks source link

v2.1.6 can not `create_app` #812

Closed ctarn closed 1 year ago

ctarn commented 1 year ago

I upgraded PackageCompiler to v2.1.6 and found out that my apps can not be successfully built. I re-tested it on examples/MyApp and it failed again.

versioninfo

julia> versioninfo()
Julia Version 1.9.0
Commit 8e630552924 (2023-05-07 11:25 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin22.4.0)
  CPU: 16 × Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, skylake)
  Threads: 1 on 16 virtual cores
Environment:
  JULIA_IMAGE_THREADS = 1

prepare

julia> using Pkg

julia> Pkg.status()
Project MyApp v0.1.0
Status `~/tmp/PackageCompiler.jl/examples/MyApp/Project.toml`
  [a8cc5b0e] Crayons v4.1.1
  [7876af07] Example v0.5.3
  [dca1746e] HelloWorldC_jll v1.2.1+1
  [dad2f222] LLVMExtra_jll v0.0.21+0
  [f8abcde7] micromamba_jll v1.4.3+0
  [56f22d72] Artifacts
  [8ba89e20] Distributed
  [9a3f8284] Random

julia> Pkg.instantiate()
    Updating registry at `~/.julia/registries/General.toml`
   Installed micromamba_jll ── v1.4.3+0
   Installed LLVMExtra_jll ─── v0.0.21+0
   Installed Example ───────── v0.5.3
   Installed HelloWorldC_jll ─ v1.2.1+1
  Downloaded artifact: LLVMExtra
  Downloaded artifact: HelloWorldC
  Downloaded artifact: fooifier
    Updating `~/tmp/PackageCompiler.jl/examples/MyApp/Project.toml`
  [a8cc5b0e] + Crayons v4.1.1
  [7876af07] + Example v0.5.3
  [dca1746e] + HelloWorldC_jll v1.2.1+1
  [dad2f222] + LLVMExtra_jll v0.0.21+0
  [f8abcde7] + micromamba_jll v1.4.3+0
    Updating `~/tmp/PackageCompiler.jl/examples/MyApp/Manifest.toml`
  [a8cc5b0e] + Crayons v4.1.1
  [7876af07] + Example v0.5.3
  [692b3bcd] + JLLWrappers v1.4.1
  [21216c6a] + Preferences v1.4.0
  [dca1746e] + HelloWorldC_jll v1.2.1+1
  [dad2f222] + LLVMExtra_jll v0.0.21+0
  [f8abcde7] + micromamba_jll v1.4.3+0
  [0dad84c5] + ArgTools v1.1.1
  [56f22d72] + Artifacts
  [2a0f44e3] + Base64
  [ade2ca70] + Dates
  [8ba89e20] + Distributed
  [f43a241f] + Downloads v1.6.0
  [7b1f6079] + FileWatching
  [b77e0a4c] + InteractiveUtils
  [4af54fe1] + LazyArtifacts
  [b27032c2] + LibCURL v0.6.3
  [76f85450] + LibGit2
  [8f399da3] + Libdl
  [56ddb016] + Logging
  [d6f4376e] + Markdown
  [ca575930] + NetworkOptions v1.2.0
  [44cfe95a] + Pkg v1.9.0
  [de0858da] + Printf
  [3fa0cd96] + REPL
  [9a3f8284] + Random
  [ea8e919c] + SHA v0.7.0
  [9e88b42a] + Serialization
  [6462fe0b] + Sockets
  [fa267f1f] + TOML v1.0.3
  [a4e569a6] + Tar v1.10.0
  [cf7118a7] + UUIDs
  [4ec0a83e] + Unicode
  [deac9b47] + LibCURL_jll v7.84.0+0
  [29816b5a] + LibSSH2_jll v1.10.2+0
  [c8ffd9c3] + MbedTLS_jll v2.28.2+0
  [14a3606d] + MozillaCACerts_jll v2022.10.11
  [83775a58] + Zlib_jll v1.2.13+0
  [8e850ede] + nghttp2_jll v1.48.0+0
  [3f19e933] + p7zip_jll v17.4.0+0
Precompiling project...
  5 dependencies successfully precompiled in 12 seconds. 6 already precompiled.
  1 dependency had warnings during precompilation:
┌ MyApp [f943f3d7-887a-4ed5-b0c0-a1d6899aa8f5]
│   Downloading artifact: micromamba
└  

error log

julia> import PackageCompiler

julia> PackageCompiler.create_app(".", "build.tmp", force=true)
PackageCompiler: bundled artifacts:
  ├── HelloWorldC_jll - 23.669 KiB
  ├── LLVMExtra_jll - 95.938 KiB
  └── MyApp
      └── fooifier - 14.124 KiB
  Total artifact file size: 133.730 KiB
✔ [02m:32s] PackageCompiler: compiling base system image (incremental=false)
Precompiling project...
  11 dependencies successfully precompiled in 46 seconds
⢰ [00m:12s] PackageCompiler: compiling nonincremental system imageUndefVarError: `MyApp` not defined
Stacktrace:
 [1] top-level scope
   @ /var/folders/r3/y1sclb514fxbrwhgpk1vk2x00000gn/T/jl_E7IPmXOVi5:115
⣄ [00m:13s] PackageCompiler: compiling nonincremental system imageModule, e::Any)
   @ Core ./boot.jl:370
 [3] top-level scope
   @ /var/folders/r3/y1sclb514fxbrwhgpk1vk2x00000gn/T/jl_E7IPmXOVi5:114
 [4] eval(m::Module, e::Any)
   @ Core ./boot.jl:370
 [5] top-level scope
   @ /var/folders/r3/y1sclb514fxbrwhgpk1vk2x00000gn/T/jl_E7IPmXOVi5:49
in expression starting at /var/folders/r3/y1sclb514fxbrwhgpk1vk2x00000gn/T/jl_E7IPmXOVi5:49
✖ [00m:13s] PackageCompiler: compiling nonincremental system image
ERROR: failed process: Process(`/Users/i/.julia/juliaup/julia-1.9.0+0.x64.apple.darwin14/bin/julia --color=yes --startup-file=no --pkgimages=no '--cpu-target=generic;sandybridge,-xsaveopt,clone_all;haswell,-rdrnd,base(1)' --sysimage=/var/folders/r3/y1sclb514fxbrwhgpk1vk2x00000gn/T/jl_mSq9e6/sys.ji --project=/Users/i/tmp/PackageCompiler.jl/examples/MyApp --output-o=/var/folders/r3/y1sclb514fxbrwhgpk1vk2x00000gn/T/jl_IhsvsjeV6h.o /var/folders/r3/y1sclb514fxbrwhgpk1vk2x00000gn/T/jl_E7IPmXOVi5`, ProcessExited(1)) [1]

Stacktrace:
  [1] pipeline_error
    @ ./process.jl:565 [inlined]
  [2] run(::Cmd; wait::Bool)
    @ Base ./process.jl:480
  [3] run
    @ ./process.jl:477 [inlined]
  [4] #20
    @ ~/.julia/packages/PackageCompiler/3niuD/ext/TerminalSpinners.jl:157 [inlined]
  [5] spin(f::PackageCompiler.var"#20#22"{Cmd}, s::PackageCompiler.TerminalSpinners.Spinner{Base.TTY})
    @ PackageCompiler.TerminalSpinners ~/.julia/packages/PackageCompiler/3niuD/ext/TerminalSpinners.jl:164
  [6] macro expansion
    @ ~/.julia/packages/PackageCompiler/3niuD/ext/TerminalSpinners.jl:157 [inlined]
  [7] create_sysimg_object_file(object_file::String, packages::Vector{String}, packages_sysimg::Set{Base.PkgId}; project::String, base_sysimage::String, precompile_execution_file::Vector{String}, precompile_statements_file::Vector{String}, cpu_target::String, script::Nothing, sysimage_build_args::Cmd, extra_precompiles::String, incremental::Bool)
    @ PackageCompiler ~/.julia/packages/PackageCompiler/3niuD/src/PackageCompiler.jl:128
  [8] create_sysimg_object_file
    @ ~/.julia/packages/PackageCompiler/3niuD/src/PackageCompiler.jl:290 [inlined]
  [9] create_sysimage(packages::Vector{String}; sysimage_path::String, project::String, precompile_execution_file::Vector{String}, precompile_statements_file::Vector{String}, incremental::Bool, filter_stdlibs::Bool, cpu_target::String, script::Nothing, sysimage_build_args::Cmd, include_transitive_dependencies::Bool, base_sysimage::Nothing, julia_init_c_file::Nothing, version::Nothing, soname::Nothing, compat_level::String, extra_precompiles::String)
    @ PackageCompiler ~/.julia/packages/PackageCompiler/3niuD/src/PackageCompiler.jl:586
 [10] create_sysimage
    @ ~/.julia/packages/PackageCompiler/3niuD/src/PackageCompiler.jl:484 [inlined]
 [11] create_app(package_dir::String, app_dir::String; executables::Nothing, precompile_execution_file::Vector{String}, precompile_statements_file::Vector{String}, incremental::Bool, filter_stdlibs::Bool, force::Bool, c_driver_program::String, cpu_target::String, include_lazy_artifacts::Bool, sysimage_build_args::Cmd, include_transitive_dependencies::Bool, script::Nothing)
    @ PackageCompiler ~/.julia/packages/PackageCompiler/3niuD/src/PackageCompiler.jl:809
 [12] top-level scope
    @ REPL[4]:1
ctarn commented 1 year ago

I tested both the example app and my own app with v.2.1.5, and both can be successfully built. I also created a mini app as below. It can also be built with v.2.1.5 but not v.2.1.6.

prepare

i@ctarn ~/t/P/e/MiniApp (master)> ls . src
.:
Project.toml  src/

src:
MiniApp.jl

i@ctarn ~/t/P/e/MiniApp (master)> cat Project.toml 
name = "MiniApp"
uuid = "f943f3d7-887a-4ed5-b0c0-a1d6899aa8f6"
version = "0.1.0"

i@ctarn ~/t/P/e/MiniApp (master)> cat src/MiniApp.jl
module MiniApp

function julia_main()::Cint
    println("this is MiniApp")
    return 0
end

end

build with v2.1.6

i@ctarn ~/t/P/e/MiniApp (master)> julia --project=.
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.9.0 (2023-05-07)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

(MiniApp) pkg> add PackageCompiler@2.1.6
   Resolving package versions...
    Updating `~/tmp/PackageCompiler.jl/examples/MiniApp/Project.toml`
  [9b87118b] + PackageCompiler v2.1.6
    Updating `~/tmp/PackageCompiler.jl/examples/MiniApp/Manifest.toml`
  [9b87118b] + PackageCompiler v2.1.6
  [05181044] + RelocatableFolders v1.0.0
  [6c6a2e73] + Scratch v1.2.0
  [0dad84c5] + ArgTools v1.1.1
  [56f22d72] + Artifacts
  [2a0f44e3] + Base64
  [ade2ca70] + Dates
  [f43a241f] + Downloads v1.6.0
  [7b1f6079] + FileWatching
  [b77e0a4c] + InteractiveUtils
  [4af54fe1] + LazyArtifacts
  [b27032c2] + LibCURL v0.6.3
  [76f85450] + LibGit2
  [8f399da3] + Libdl
  [56ddb016] + Logging
  [d6f4376e] + Markdown
  [ca575930] + NetworkOptions v1.2.0
  [44cfe95a] + Pkg v1.9.0
  [de0858da] + Printf
  [3fa0cd96] + REPL
  [9a3f8284] + Random
  [ea8e919c] + SHA v0.7.0
  [9e88b42a] + Serialization
  [6462fe0b] + Sockets
  [fa267f1f] + TOML v1.0.3
  [a4e569a6] + Tar v1.10.0
  [cf7118a7] + UUIDs
  [4ec0a83e] + Unicode
  [deac9b47] + LibCURL_jll v7.84.0+0
  [29816b5a] + LibSSH2_jll v1.10.2+0
  [c8ffd9c3] + MbedTLS_jll v2.28.2+0
  [14a3606d] + MozillaCACerts_jll v2022.10.11
  [83775a58] + Zlib_jll v1.2.13+0
  [8e850ede] + nghttp2_jll v1.48.0+0
  [3f19e933] + p7zip_jll v17.4.0+0

julia> import PackageCompiler

julia> PackageCompiler.create_app(".", "build.tmp", force=true)
✔ [02m:38s] PackageCompiler: compiling base system image (incremental=false)
Precompiling project...
  7 dependencies successfully precompiled in 43 seconds
⣄ [00m:13s] PackageCompiler: compiling nonincremental system imageUndefVarError: `MiniApp` not defined
Stacktrace:
 [1] top-level scope
⡆ [00m:13s] PackageCompiler: compiling nonincremental system image   @ /var/folders/r3/y1sclb514fxbrwhgpk1vk2x00000gn/T/jl_zu5Inu3uhe:110
⠋ [00m:13s] PackageCompiler: compiling nonincremental system imageModule, e::Any)
   @ Core ./boot.jl:370
 [3] top-level scope
   @ /var/folders/r3/y1sclb514fxbrwhgpk1vk2x00000gn/T/jl_zu5Inu3uhe:109
 [4] eval(m::Module, e::Any)
   @ Core ./boot.jl:370
 [5] top-level scope
   @ /var/folders/r3/y1sclb514fxbrwhgpk1vk2x00000gn/T/jl_zu5Inu3uhe:44
in expression starting at /var/folders/r3/y1sclb514fxbrwhgpk1vk2x00000gn/T/jl_zu5Inu3uhe:44
✖ [00m:13s] PackageCompiler: compiling nonincremental system image
ERROR: failed process: Process(`/Users/i/.julia/juliaup/julia-1.9.0+0.x64.apple.darwin14/bin/julia --color=yes --startup-file=no --pkgimages=no '--cpu-target=generic;sandybridge,-xsaveopt,clone_all;haswell,-rdrnd,base(1)' --sysimage=/var/folders/r3/y1sclb514fxbrwhgpk1vk2x00000gn/T/jl_8f3pFX/sys.ji --project=/Users/i/tmp/PackageCompiler.jl/examples/MiniApp --output-o=/var/folders/r3/y1sclb514fxbrwhgpk1vk2x00000gn/T/jl_dYb0jWZGHS.o /var/folders/r3/y1sclb514fxbrwhgpk1vk2x00000gn/T/jl_zu5Inu3uhe`, ProcessExited(1)) [1]

Stacktrace:
  [1] pipeline_error
    @ ./process.jl:565 [inlined]
  [2] run(::Cmd; wait::Bool)
    @ Base ./process.jl:480
  [3] run
    @ ./process.jl:477 [inlined]
  [4] #20
    @ ~/.julia/packages/PackageCompiler/3niuD/ext/TerminalSpinners.jl:157 [inlined]
  [5] spin(f::PackageCompiler.var"#20#22"{Cmd}, s::PackageCompiler.TerminalSpinners.Spinner{Base.TTY})
    @ PackageCompiler.TerminalSpinners ~/.julia/packages/PackageCompiler/3niuD/ext/TerminalSpinners.jl:164
  [6] macro expansion
    @ ~/.julia/packages/PackageCompiler/3niuD/ext/TerminalSpinners.jl:157 [inlined]
  [7] create_sysimg_object_file(object_file::String, packages::Vector{String}, packages_sysimg::Set{Base.PkgId}; project::String, base_sysimage::String, precompile_execution_file::Vector{String}, precompile_statements_file::Vector{String}, cpu_target::String, script::Nothing, sysimage_build_args::Cmd, extra_precompiles::String, incremental::Bool)
    @ PackageCompiler ~/.julia/packages/PackageCompiler/3niuD/src/PackageCompiler.jl:128
  [8] create_sysimg_object_file
    @ ~/.julia/packages/PackageCompiler/3niuD/src/PackageCompiler.jl:290 [inlined]
  [9] create_sysimage(packages::Vector{String}; sysimage_path::String, project::String, precompile_execution_file::Vector{String}, precompile_statements_file::Vector{String}, incremental::Bool, filter_stdlibs::Bool, cpu_target::String, script::Nothing, sysimage_build_args::Cmd, include_transitive_dependencies::Bool, base_sysimage::Nothing, julia_init_c_file::Nothing, version::Nothing, soname::Nothing, compat_level::String, extra_precompiles::String)
    @ PackageCompiler ~/.julia/packages/PackageCompiler/3niuD/src/PackageCompiler.jl:586
 [10] create_sysimage
    @ ~/.julia/packages/PackageCompiler/3niuD/src/PackageCompiler.jl:484 [inlined]
 [11] create_app(package_dir::String, app_dir::String; executables::Nothing, precompile_execution_file::Vector{String}, precompile_statements_file::Vector{String}, incremental::Bool, filter_stdlibs::Bool, force::Bool, c_driver_program::String, cpu_target::String, include_lazy_artifacts::Bool, sysimage_build_args::Cmd, include_transitive_dependencies::Bool, script::Nothing)
    @ PackageCompiler ~/.julia/packages/PackageCompiler/3niuD/src/PackageCompiler.jl:809
 [12] top-level scope
    @ REPL[2]:1

build with v2.1.5

i@ctarn ~/t/P/e/MiniApp (master)> julia --project=.
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.9.0 (2023-05-07)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

(MiniApp) pkg> add PackageCompiler@2.1.5
   Resolving package versions...
    Updating `~/tmp/PackageCompiler.jl/examples/MiniApp/Project.toml`
⌃ [9b87118b] ↓ PackageCompiler v2.1.6 ⇒ v2.1.5
    Updating `~/tmp/PackageCompiler.jl/examples/MiniApp/Manifest.toml`
⌃ [9b87118b] ↓ PackageCompiler v2.1.6 ⇒ v2.1.5
        Info Packages marked with ⌃ have new versions available and may be upgradable.

julia> import PackageCompiler

julia> PackageCompiler.create_app(".", "build.tmp", force=true)
✔ [02m:36s] PackageCompiler: compiling base system image (incremental=false)
Precompiling project...
  7 dependencies successfully precompiled in 43 seconds
✔ [01m:17s] PackageCompiler: compiling nonincremental system image

julia> 
i@ctarn ~/t/P/e/MiniApp (master)> ./build.tmp/bin/MiniApp 
this is MiniApp
KristofferC commented 1 year ago

I understand why this happens. It currently will only happen if you have no precompile statements at all coming from the app so it is unlikely to happen in real use cases. But should be fixed nonetheless.

ctarn commented 1 year ago

Thanks for your response! Actually, I never use a precompile file in my project. Why is it necessary? Could you please provide me with some references?

13299118606 commented 1 year ago

I also encountered this problem, and I said that I couldn’t find a solution to the problem, and I thought it was because of the problem of julia 1.9.0. I rolled back to 1.7.0, and 1.8.3 did not solve the problem. It turned out to be the package Version problem, thank you very much for your solution, I rolled back PackageCompiler to 2.1.5 to solve this problem!

Felix-Gauthier commented 1 year ago

Thanks for reporting the issue, I'm impacted as well.

StefanPofahl commented 1 year ago

Unfortunatly my example is rather complex, nothing to share here ... But I can confirm, with the new version, I encounter issues, with both Julia versions: v1.8.5 as well as v1.9.0 If relevant, I can share more information or can run specific tests.

KristofferC commented 1 year ago

https://github.com/JuliaLang/PackageCompiler.jl/pull/813 should fix this.

ctarn commented 1 year ago

Thanks for your efforts. It does work perfectly now.

StefanPofahl commented 1 year ago

Thanks a lot for the new version!!! Unfortunately, my issue is not yet resolved by #813. I hope the following messages might be helpful:

┌ Debug: running `'C:\bin\juliaRC\bin\julia.exe' --color=yes --startup-file=no --pkgimages=no '--cpu-target=generic;sandybridge,-xsaveopt,clone_all;haswell,-rdrnd,base(1)' '--sysimage=C:\Users\STEFAN~1\AppData\Local\Temp\jl_z2jXSO\sys.ji' '--project=C:\data\git_repos\hycenta_stefan_pofahl\julia_apps\tmp_RC_InteractiveNyquist' '--output-o=C:\Users\STEFAN~1\AppData\Local\Temp\jl_SDEn0xexYP.o' 'C:\Users\STEFAN~1\AppData\Local\Temp\jl_OPabUjgnU5'`
└ @ PackageCompiler C:\Users\stefanpofahl\.julia\packages\PackageCompiler\3niuD\src\PackageCompiler.jl:428
⠙ [00m:36s] PackageCompiler: compiling nonincremental system imageUndefVarError: `InteractiveNyquist` not defined
Stacktrace:
 [1] top-level scope
   @ C:\Users\STEFAN~1\AppData\Local\Temp\jl_OPabUjgnU5:340
⣠ [00m:36s] PackageCompiler: compiling nonincremental system imageModule, e::Any)
   @ Core .\boot.jl:370
 [3] top-level scope
   @ C:\Users\STEFAN~1\AppData\Local\Temp\jl_OPabUjgnU5:339
 [4] eval(m::Module, e::Any)
   @ Core .\boot.jl:370
 [5] top-level scope
   @ C:\Users\STEFAN~1\AppData\Local\Temp\jl_OPabUjgnU5:274
in expression starting at C:\Users\STEFAN~1\AppData\Local\Temp\jl_OPabUjgnU5:274
✖ [00m:36s] PackageCompiler: compiling nonincremental system image
ERROR: LoadError: failed process: Process(`'C:\bin\juliaRC\bin\julia.exe' --color=yes --startup-file=no --pkgimages=no '--cpu-target=generic;sandybridge,-xsaveopt,clone_all;haswell,-rdrnd,base(1)' '--sysimage=C:\Users\STEFAN~1\AppData\Local\Temp\jl_z2jXSO\sys.ji' '--project=C:\data\git_repos\hycenta_stefan_pofahl\julia_apps\tmp_RC_InteractiveNyquist' '--output-o=C:\Users\STEFAN~1\AppData\Local\Temp\jl_SDEn0xexYP.o' 'C:\Users\STEFAN~1\AppData\Local\Temp\jl_OPabUjgnU5'`, ProcessExited(1)) [1]

Stacktrace:
  [1] pipeline_error
    @ .\process.jl:565 [inlined]
  [2] run(::Cmd; wait::Bool)
    @ Base .\process.jl:480
  [3] run
    @ .\process.jl:477 [inlined]
  [4] #20
    @ C:\Users\stefanpofahl\.julia\packages\PackageCompiler\3niuD\ext\TerminalSpinners.jl:157 [inlined]
  [5] spin(f::PackageCompiler.var"#20#22"{Cmd}, s::PackageCompiler.TerminalSpinners.Spinner{Base.TTY})
    @ PackageCompiler.TerminalSpinners C:\Users\stefanpofahl\.julia\packages\PackageCompiler\3niuD\ext\TerminalSpinners.jl:164
  [6] macro expansion
    @ C:\Users\stefanpofahl\.julia\packages\PackageCompiler\3niuD\ext\TerminalSpinners.jl:157 [inlined]
  [7] create_sysimg_object_file(object_file::String, packages::Vector{String}, packages_sysimg::Set{Base.PkgId}; project::String, base_sysimage::String, precompile_execution_file::Vector{String}, precompile_statements_file::Vector{String}, cpu_target::String, script::Nothing, sysimage_build_args::Cmd, extra_precompiles::String, incremental::Bool)
    @ PackageCompiler C:\Users\stefanpofahl\.julia\packages\PackageCompiler\3niuD\src\PackageCompiler.jl:128
  [8] create_sysimg_object_file
    @ C:\Users\stefanpofahl\.julia\packages\PackageCompiler\3niuD\src\PackageCompiler.jl:290 [inlined]
  [9] create_sysimage(packages::Vector{String}; sysimage_path::String, project::String, precompile_execution_file::Vector{String}, precompile_statements_file::Vector{String}, incremental::Bool, filter_stdlibs::Bool, cpu_target::String, script::Nothing, sysimage_build_args::Cmd, include_transitive_dependencies::Bool, base_sysimage::Nothing, julia_init_c_file::Nothing, version::Nothing, soname::Nothing, compat_level::String, extra_precompiles::String)
    @ PackageCompiler C:\Users\stefanpofahl\.julia\packages\PackageCompiler\3niuD\src\PackageCompiler.jl:586
 [10] create_sysimage
    @ C:\Users\stefanpofahl\.julia\packages\PackageCompiler\3niuD\src\PackageCompiler.jl:484 [inlined]
 [11] create_app(package_dir::String, app_dir::String; executables::Vector{Pair{String, String}}, precompile_execution_file::Vector{String}, precompile_statements_file::Vector{String}, incremental::Bool, filter_stdlibs::Bool, force::Bool, c_driver_program::String, cpu_target::String, include_lazy_artifacts::Bool, sysimage_build_args::Cmd, include_transitive_dependencies::Bool, script::Nothing)
    @ PackageCompiler C:\Users\stefanpofahl\.julia\packages\PackageCompiler\3niuD\src\PackageCompiler.jl:809
 [12] create_app
    @ C:\Users\stefanpofahl\.julia\packages\PackageCompiler\3niuD\src\PackageCompiler.jl:759 [inlined]
 [13] compile_it()
    @ Main C:\data\git_repos\hycenta_stefan_pofahl\julia_apps\tmp_start_PC_RC_c#4.jl:23
 [14] top-level scope
    @ .\timing.jl:273
in expression starting at C:\data\git_repos\hycenta_stefan_pofahl\julia_apps\tmp_start_PC_RC_c#4.jl:26

C:\data\git_repos\hycenta_stefan_pofahl\julia_apps>
KristofferC commented 1 year ago

Do you have code that reproduces that problem that I can run?

StefanPofahl commented 1 year ago

Sure :-) As I wrote, it is far away from a minimal example. The Repo is here: https://github.com/StefanPofahl/Stefans_Julia_RePo My compilation script is here: https://github.com/StefanPofahl/Stefans_Julia_RePo/blob/main/AppDir/compile_app.jl

Currently I work with a slightly modified version on my computer at work.

I will run the script above and will see, if the error message / the problem occurs also on Linux (on my home PC). The project that crashes during compilation is: https://github.com/StefanPofahl/Stefans_Julia_RePo/blob/main/AppDir/InteractiveNyquist/src/InteractiveNyquist.jl

I will let you know about the outcome.

StefanPofahl commented 1 year ago

Under Ubuntu 22.04 I had no problems to compile "case_nr = 5": s_app = "InteractiveNyquist" :-) MS-Window-Test is still running ...

StefanPofahl commented 1 year ago

Ok, it is unfortunatly not the same behaviour under Linux and Windows. On windows, the version shared with you crashes with the following messages:

✔ [03m:32s] PackageCompiler: compiling base system image (incremental=false)
┌ Debug: ensurecompiled: running `'C:\bin\juliaRC\bin\julia.exe' --color=yes --startup-file=no --pkgimages=no '--sysimage=C:\Users\STEFAN~1\AppData\Local\Temp\jl_oVefDX\sys.ji' -e 'using Pkg; Pkg.precompile()'`
│   JULIA_LOAD_PATH = "C:\\data\\git_repos\\own_repos\\Stefans_Julia_RePo\\AppDir\\tmp_RC_InteractiveNyquist;@stdlib"
└ @ PackageCompiler C:\Users\stefanpofahl\.julia\packages\PackageCompiler\3niuD\src\PackageCompiler.jl:269
Precompiling project...
  ✗ GLMakie
  ✗ InteractiveNyquist
  238 dependencies successfully precompiled in 1855 seconds

ERROR: The following 2 direct dependencies failed to precompile:

GLMakie [e9467ef8-e4e7-5192-8a1a-b1aee30e663a]

Failed to precompile GLMakie [e9467ef8-e4e7-5192-8a1a-b1aee30e663a] to "C:\\Users\\stefanpofahl\\.julia\\compiled\\v1.9\\GLMakie\\jl_E707.tmp".
┌ Warning:     GLFW couldn't create an OpenGL window.
│     This likely means, you don't have an OpenGL capable Graphic Card,
│     or you don't have an OpenGL 3.3 capable video driver installed.
│     Have a look at the troubleshooting section in the GLMakie readme:
│     https://github.com/MakieOrg/Makie.jl/tree/master/GLMakie#troubleshooting-opengl.
└ @ GLMakie C:\Users\stefanpofahl\.julia\packages\GLMakie\pyNln\src\screen.jl:228
ERROR: LoadError: GLFWError (API_UNAVAILABLE): WGL: The driver does not appear to support OpenGL
Stacktrace:
  [1] _ErrorCallbackWrapper(code::Int32, description::Cstring)
    @ GLFW C:\Users\stefanpofahl\.julia\packages\GLFW\BWxfF\src\callback.jl:43
  [2] CreateWindow(width::Int64, height::Int64, title::String, monitor::GLFW.Monitor, share::GLFW.Window)
    @ GLFW C:\Users\stefanpofahl\.julia\packages\GLFW\BWxfF\src\glfw3.jl:499
  [3] GLFW.Window(; name::String, resolution::Tuple{Int64, Int64}, debugging::Bool, major::Int64, minor::Int64, windowhints::Vector{Tuple{UInt32, Int64}}, contexthints::Vector{Tuple{UInt32, Integer}}, visible::Bool, focus::Bool, fullscreen::Bool, monitor::Nothing, share::GLFW.Window)
    @ GLFW C:\Users\stefanpofahl\.julia\packages\GLFW\BWxfF\src\glfw3.jl:344
  [4] Window
    @ C:\Users\stefanpofahl\.julia\packages\GLFW\BWxfF\src\glfw3.jl:302 [inlined]
  [5] empty_screen(debugging::Bool; reuse::Bool)
    @ GLMakie C:\Users\stefanpofahl\.julia\packages\GLMakie\pyNln\src\screen.jl:219
  [6] empty_screen
    @ C:\Users\stefanpofahl\.julia\packages\GLMakie\pyNln\src\screen.jl:202 [inlined]
  [7] singleton_screen(debugging::Bool)
    @ GLMakie C:\Users\stefanpofahl\.julia\packages\GLMakie\pyNln\src\screen.jl:304
  [8] macro expansion
    @ C:\Users\stefanpofahl\.julia\packages\GLMakie\pyNln\src\precompiles.jl:18 [inlined]
  [9] macro expansion
    @ C:\Users\stefanpofahl\.julia\packages\PrecompileTools\EqjW2\src\workloads.jl:74 [inlined]
 [10] macro expansion
    @ C:\Users\stefanpofahl\.julia\packages\GLMakie\pyNln\src\precompiles.jl:16 [inlined]
 [11] macro expansion
    @ C:\Users\stefanpofahl\.julia\packages\PrecompileTools\EqjW2\src\workloads.jl:136 [inlined]
 [12] top-level scope
    @ C:\Users\stefanpofahl\.julia\packages\GLMakie\pyNln\src\precompiles.jl:14
 [13] include(mod::Module, _path::String)
    @ Base .\Base.jl:457
 [14] include(x::String)
    @ GLMakie C:\Users\stefanpofahl\.julia\packages\GLMakie\pyNln\src\GLMakie.jl:1
 [15] top-level scope
    @ C:\Users\stefanpofahl\.julia\packages\GLMakie\pyNln\src\GLMakie.jl:59
 [16] include
    @ .\Base.jl:457 [inlined]
 [17] 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, UInt128}}, source::Nothing)
    @ Base .\loading.jl:2010
 [18] top-level scope
    @ stdin:2
in expression starting at C:\Users\stefanpofahl\.julia\packages\GLMakie\pyNln\src\precompiles.jl:13
in expression starting at C:\Users\stefanpofahl\.julia\packages\GLMakie\pyNln\src\GLMakie.jl:1
in expression starting at stdin:2

InteractiveNyquist [e46285bd-e45a-4455-baf4-b9d01c2699a4]

Failed to precompile InteractiveNyquist [e46285bd-e45a-4455-baf4-b9d01c2699a4] to "C:\\Users\\stefanpofahl\\.julia\\compiled\\v1.9\\InteractiveNyquist\\jl_829C.tmp".
┌ Warning:     GLFW couldn't create an OpenGL window.
│     This likely means, you don't have an OpenGL capable Graphic Card,
│     or you don't have an OpenGL 3.3 capable video driver installed.
│     Have a look at the troubleshooting section in the GLMakie readme:
│     https://github.com/MakieOrg/Makie.jl/tree/master/GLMakie#troubleshooting-opengl.
└ @ GLMakie C:\Users\stefanpofahl\.julia\packages\GLMakie\pyNln\src\screen.jl:228
ERROR: LoadError: GLFWError (API_UNAVAILABLE): WGL: The driver does not appear to support OpenGL
Stacktrace:
  [1] _ErrorCallbackWrapper(code::Int32, description::Cstring)
    @ GLFW C:\Users\stefanpofahl\.julia\packages\GLFW\BWxfF\src\callback.jl:43
  [2] CreateWindow(width::Int64, height::Int64, title::String, monitor::GLFW.Monitor, share::GLFW.Window)
    @ GLFW C:\Users\stefanpofahl\.julia\packages\GLFW\BWxfF\src\glfw3.jl:499
  [3] GLFW.Window(; name::String, resolution::Tuple{Int64, Int64}, debugging::Bool, major::Int64, minor::Int64, windowhints::Vector{Tuple{UInt32, Int64}}, contexthints::Vector{Tuple{UInt32, Integer}}, visible::Bool, focus::Bool, fullscreen::Bool, monitor::Nothing, share::GLFW.Window)
    @ GLFW C:\Users\stefanpofahl\.julia\packages\GLFW\BWxfF\src\glfw3.jl:344
  [4] Window
    @ C:\Users\stefanpofahl\.julia\packages\GLFW\BWxfF\src\glfw3.jl:302 [inlined]
  [5] empty_screen(debugging::Bool; reuse::Bool)
    @ GLMakie C:\Users\stefanpofahl\.julia\packages\GLMakie\pyNln\src\screen.jl:219
  [6] empty_screen
    @ C:\Users\stefanpofahl\.julia\packages\GLMakie\pyNln\src\screen.jl:202 [inlined]
  [7] singleton_screen(debugging::Bool)
    @ GLMakie C:\Users\stefanpofahl\.julia\packages\GLMakie\pyNln\src\screen.jl:304
  [8] macro expansion
    @ C:\Users\stefanpofahl\.julia\packages\GLMakie\pyNln\src\precompiles.jl:18 [inlined]
  [9] macro expansion
    @ C:\Users\stefanpofahl\.julia\packages\PrecompileTools\EqjW2\src\workloads.jl:74 [inlined]
 [10] macro expansion
    @ C:\Users\stefanpofahl\.julia\packages\GLMakie\pyNln\src\precompiles.jl:16 [inlined]
 [11] macro expansion
    @ C:\Users\stefanpofahl\.julia\packages\PrecompileTools\EqjW2\src\workloads.jl:136 [inlined]
 [12] top-level scope
    @ C:\Users\stefanpofahl\.julia\packages\GLMakie\pyNln\src\precompiles.jl:14
 [13] include(mod::Module, _path::String)
    @ Base .\Base.jl:457
 [14] include(x::String)
    @ GLMakie C:\Users\stefanpofahl\.julia\packages\GLMakie\pyNln\src\GLMakie.jl:1
 [15] top-level scope
    @ C:\Users\stefanpofahl\.julia\packages\GLMakie\pyNln\src\GLMakie.jl:59
 [16] include
    @ .\Base.jl:457 [inlined]
 [17] 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, UInt128}}, source::String)
    @ Base .\loading.jl:2010
 [18] top-level scope
    @ stdin:2
in expression starting at C:\Users\stefanpofahl\.julia\packages\GLMakie\pyNln\src\precompiles.jl:13
in expression starting at C:\Users\stefanpofahl\.julia\packages\GLMakie\pyNln\src\GLMakie.jl:1
in expression starting at stdin:2
ERROR: LoadError: Failed to precompile GLMakie [e9467ef8-e4e7-5192-8a1a-b1aee30e663a] to "C:\\Users\\stefanpofahl\\.julia\\compiled\\v1.9\\GLMakie\\jl_C29E.tmp".
Stacktrace:
  [1] error(s::String)
    @ Base .\error.jl:35
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool)
    @ Base .\loading.jl:2260
  [3] compilecache
    @ .\loading.jl:2127 [inlined]
  [4] _require(pkg::Base.PkgId, env::String)
    @ Base .\loading.jl:1770
  [5] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base .\loading.jl:1625
  [6] macro expansion
    @ .\loading.jl:1613 [inlined]
  [7] macro expansion
    @ .\lock.jl:267 [inlined]
  [8] require(into::Module, mod::Symbol)
    @ Base .\loading.jl:1576
  [9] include
    @ .\Base.jl:457 [inlined]
 [10] 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, UInt128}}, source::Nothing)
    @ Base .\loading.jl:2010
 [11] top-level scope
    @ stdin:2
in expression starting at C:\data\git_repos\own_repos\Stefans_Julia_RePo\AppDir\tmp_RC_InteractiveNyquist\src\InteractiveNyquist.jl:1
in expression starting at stdin:2

Stacktrace:
 [1] pkgerror(msg::String)
   @ Pkg.Types C:\bin\juliaRC\share\julia\stdlib\v1.9\Pkg\src\Types.jl:69
 [2] precompile(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; internal_call::Bool, strict::Bool, warn_loaded::Bool, already_instantiated::Bool, timing::Bool, kwargs::Base.Pairs{Symbol, Base.TTY, Tuple{Symbol}, NamedTuple{(:io,), Tuple{Base.TTY}}})
   @ Pkg.API C:\bin\juliaRC\share\julia\stdlib\v1.9\Pkg\src\API.jl:1568
 [3] precompile(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.TTY, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ Pkg.API C:\bin\juliaRC\share\julia\stdlib\v1.9\Pkg\src\API.jl:156
 [4] precompile(pkgs::Vector{Pkg.Types.PackageSpec})
   @ Pkg.API C:\bin\juliaRC\share\julia\stdlib\v1.9\Pkg\src\API.jl:145
 [5] precompile(; name::Nothing, uuid::Nothing, version::Nothing, url::Nothing, rev::Nothing, path::Nothing, mode::Pkg.Types.PackageMode, subdir::Nothing, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ Pkg.API C:\bin\juliaRC\share\julia\stdlib\v1.9\Pkg\src\API.jl:171
 [6] precompile()
   @ Pkg.API C:\bin\juliaRC\share\julia\stdlib\v1.9\Pkg\src\API.jl:162
 [7] top-level scope
   @ none:1
ERROR: LoadError: failed process: Process(setenv(`'C:\bin\juliaRC\bin\julia.exe' --color=yes --startup-file=no --pkgimages=no '--sysimage=C:\Users\STEFAN~1\AppData\Local\Temp\jl_oVefDX\sys.ji' -e 'using Pkg; Pkg.precompile()'`,["WINDIR=C:\\Windows", "PATH=C:\\Users\\stefanpofahl\\.julia\\conda\\3\\Library\\bin;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Windows\\System32\\OpenSSH\\;C:\\Program Files (x86)\\Webex\\Plugins;C:\\Program Files\\TortoiseSVN\\bin;C:\\Program Files\\dotnet\\;C:\\Program Files (x86)\\IVI Foundation\\IVI\\bin;C:\\Program Files\\IVI Foundation\\IVI\\bin;C:\\Program Files (x86)\\IVI Foundation\\VISA\\WinNT\\Bin;C:\\Program Files\\IVI Foundation\\VISA\\Win64\\Bin\\;C:\\Program Files (x86)\\IVI Foundation\\VISA\\WinNT\\Bin\\;C:\\Program Files (x86)\\dotnet\\;C:\\Program Files\\PuTTY\\;C:\\Users\\stefanpofahl\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\stefanpofahl\\AppData\\Local\\atom\\bin", "MODERNGL_DEBUGGING=true", "USERDOMAIN_ROAMINGPROFILE=VKMTHD", "ZES_ENABLE_SYSMAN=1", "IVIROOTDIR32=C:\\Program Files (x86)\\IVI Foundation\\IVI\\", "LOCALAPPDATA=C:\\Users\\stefanpofahl\\AppData\\Local", "HOMEPATH=\\Users\\stefanpofahl", "PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 142 Stepping 12, GenuineIntel", "NIEXTCCOMPILERSUPP=C:\\Program Files (x86)\\National Instruments\\Shared\\ExternalCompilerSupport\\C\\"  …  "AVL_LICENSE_FILE=27000@129.27.109.200", "=C:=C:\\data\\git_repos\\own_repos\\Stefans_Julia_RePo\\AppDir", "FPS_BROWSER_APP_PROFILE_STRING=Internet Explorer", "JULIA_DEBUG=PackageCompiler", "PROGRAMW6432=C:\\Program Files", "TEMP=C:\\Users\\STEFAN~1\\AppData\\Local\\Temp", "HOMEDRIVE=C:", "IVIROOTDIR64=C:\\Program Files\\IVI Foundation\\IVI\\", "OPENBLAS_MAIN_FREE=1", "PROCESSOR_ARCHITECTURE=AMD64"]), ProcessExited(1)) [1]

Stacktrace:
  [1] pipeline_error
    @ .\process.jl:565 [inlined]
  [2] run(::Cmd; wait::Bool)
    @ Base .\process.jl:480
  [3] run
    @ .\process.jl:477 [inlined]
  [4] ensurecompiled(project::String, packages::Vector{String}, sysimage::String)
    @ PackageCompiler C:\Users\stefanpofahl\.julia\packages\PackageCompiler\3niuD\src\PackageCompiler.jl:271
  [5] create_sysimage(packages::Vector{String}; sysimage_path::String, project::String, precompile_execution_file::Vector{String}, precompile_statements_file::Vector{String}, incremental::Bool, filter_stdlibs::Bool, cpu_target::String, script::Nothing, sysimage_build_args::Cmd, include_transitive_dependencies::Bool, base_sysimage::Nothing, julia_init_c_file::Nothing, version::Nothing, soname::Nothing, compat_level::String, extra_precompiles::String)
    @ PackageCompiler C:\Users\stefanpofahl\.julia\packages\PackageCompiler\3niuD\src\PackageCompiler.jl:541
  [6] create_sysimage
    @ C:\Users\stefanpofahl\.julia\packages\PackageCompiler\3niuD\src\PackageCompiler.jl:484 [inlined]
  [7] create_app(package_dir::String, app_dir::String; executables::Vector{Pair{String, String}}, precompile_execution_file::Vector{String}, precompile_statements_file::Vector{String}, incremental::Bool, filter_stdlibs::Bool, force::Bool, c_driver_program::String, cpu_target::String, include_lazy_artifacts::Bool, sysimage_build_args::Cmd, include_transitive_dependencies::Bool, script::Nothing)
    @ PackageCompiler C:\Users\stefanpofahl\.julia\packages\PackageCompiler\3niuD\src\PackageCompiler.jl:809
  [8] create_app
    @ C:\Users\stefanpofahl\.julia\packages\PackageCompiler\3niuD\src\PackageCompiler.jl:759 [inlined]
  [9] compile_it()
    @ Main C:\data\git_repos\own_repos\Stefans_Julia_RePo\AppDir\tmp_start_PC_RC.jl:21
 [10] top-level scope
    @ .\timing.jl:273
in expression starting at C:\data\git_repos\own_repos\Stefans_Julia_RePo\AppDir\tmp_start_PC_RC.jl:23

C:\data\git_repos\own_repos\Stefans_Julia_RePo\AppDir>
StefanPofahl commented 1 year ago

Recently I tested also the two simple examples of my repo mentioned above: case_nr = 1 (MyAppHelloTulip) case_nr = 2 (MyTOML) Both are crashing as well on my machine under Windows:

julia> versioninfo()
Julia Version 1.9.0
Commit 8e63055292 (2023-05-07 11:25 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 8 × Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, skylake)
  Threads: 1 on 8 virtual cores
Environment:
  JULIA_SSL_CA_ROOTS_PATH =
StefanPofahl commented 1 year ago

@KristofferC: Hi Kristoffer! The two examples mentioned above are really some kind of minimal examples. May I ask, if you found the time to investigate?

StefanPofahl commented 1 year ago

@KristofferC Hi Kristoffer!

The issue under MS-WIN seems to be fixed with the new Julia version v9.1!

Looking forward to the next PackageCompiler.jl-Version :-)

Regards,

Stefan