NHDaly / ApplicationBuilder.jl

[deprecated] Compile, bundle, and release julia software
MIT License
168 stars 15 forks source link

Build hangs #63

Open solcat124 opened 5 years ago

solcat124 commented 5 years ago

I've successfully used ApplicationBuilder on MacOS and Linux Mint using a couple of different source files. (Success meaning the build process completes and I'm able to run the resulting app.) I'm now trying to use the build function on an AWS instance of Linux (Ubuntu 18), but it hangs. (I've let this run for an hour or two). The results below are for the example file commandline_hello.jl.

Any suggestions on how to get this to work?

           _

() | 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 ApplicationBuilder

julia> build_app_bundle("/home/ubuntu/Documents/Software/Julia/Commandline_Hello/commandline_hello.jl", appname="hello") [ Info: Building at path /home/ubuntu/Documents/Software/Julia/Commandline_Hello/builddir/hello [ Info: Copying resources: [ Info: Copying libraries Julia program file: "/home/ubuntu/Documents/Software/Julia/Commandline_Hello/commandline_hello.jl" C program file: "/home/ubuntu/.julia/packages/PackageCompiler/CJQcs/examples/program.c" Build directory: "/home/ubuntu/Documents/Software/Julia/Commandline_Hello/builddir/hello/core"

solcat124 commented 5 years ago

I modified a local copy of ApplicationBuilder to get more output. It appears that the problem occurs within PackageCompiler, where it hangs on append!(Base.atexit_hooks, atexit_hook_copy)

I don't understand why it hangs here, so I'm still unsure what to try next.

Here is the output: julia> build_app_bundle("/home/ubuntu/Documents/Software/Julia/Commandline_Hello/commandline_hello.jl", appname="hello")


~~~~~~ Compiling a binary from '/home/ubuntu/Documents/Software/Julia/Commandline_Hello/commandline_hello.jl'... ~~~~~~~
  PackageCompiler.static_julia(...)
Julia program file:
  "/home/ubuntu/Documents/Software/Julia/Commandline_Hello/commandline_hello.jl"
C program file:
  "/home/ubuntu/Documents/Software/Julia/Commandline_Hello/program.c"
Build directory:
  "/home/ubuntu/Documents/Software/Julia/Commandline_Hello/builddir/hello/bin"
Build static library "commandline_hello.a":
  atexit_hook_copy = copy(Base.atexit_hooks) # make backup
# clean state so that any package we use can carelessly call atexit
empty!(Base.atexit_hooks)
Base.__init__()
Sys.__init__() #fix https://github.com/JuliaLang/julia/issues/30479
using REPL
Base.REPL_MODULE_REF[] = REPL
Mod = @eval module $(gensym("anon_module")) end
# Include into anonymous module to not polute namespace
Mod.include("/home/ubuntu/Documents/Software/Julia/Commandline_Hello/commandline_hello.jl")
Base._atexit() # run all exit hooks we registered during precompile
empty!(Base.atexit_hooks) # don't serialize the exit hooks we run + added
# atexit_hook_copy should be empty, but who knows what base will do in the future
append!(Base.atexit_hooks, atexit_hook_copy)
NHDaly commented 4 years ago

I'm sorry i didn't respond for so long.

I'm not sure why it's hanging.. This isn't a great answer, but PackageCompiler is basically unmaintained at this point, but there is a revival going on in https://github.com/KristofferC/PackageCompilerX.jl. If you still have need of package compilation, you might try looking there?

Thanks! :) ~Nathan