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

ERROR: UndefVarError: build_executable not defined

Open rezaeir opened this issue 5 years ago • 5 comments

I'm trying to learn how to use ApplicationBuilder.jl to build a standalone fully independent application for windows. for example, the following function could be the code for the app:

function Hello()
    println("Hello World")
end

then based on the ApplicationBuilder documentation the whole thing should be wrapped around a main function like this:

include("helloexe.jl") #address of the file containing the above Hello() function
Base.@ccallable function julia_main(ARGS::Vector{String})::Cint
    return Hello()
end

When I run the

using ApplicationBuilder
build_app_bundle("D:\\Julia\\my_julia_main.jl", appname="Hello")

it gives me the following error:

build_app_bundle("D:\\Julia\\my_julia_main.jl", appname="Hello")
[ Info: Building at path D:\Julia\builddir\Hello
[ Info: Copying resources:
[ Info: Copying libraries
ERROR: UndefVarError: build_executable not defined
Stacktrace:
 [1] build_app_bundle(::String; resources::Array{String,1}, libraries::Array{String,1}, builddir::String, appname::String, create_installer::Bool) at C:\Users\Reza\.julia\packages\ApplicationBuilder\kMUzZ\src\bundle.jl:44
 [2] top-level scope at REPL[25]:1

What does 'build_executable not defined' mean and how can I fix it? I asked the question on StackOverflow and someone said it is a dependency problem with "PackageCompiler". Is it so?

rezaeir avatar May 14 '20 13:05 rezaeir

I have the exact issue too.

ZHIWEN-PING avatar May 16 '20 01:05 ZHIWEN-PING

I have this issue as well (trying to produce a self-contained application on Windows, and getting build_executable not defined error).

anhinga avatar May 26 '20 04:05 anhinga

I'm having the same problem on MacOS, using the "hello.jl" example supplied with the package.

julia> using ApplicationBuilder julia> build_app_bundle("/Users/rogers/.julia/packages/ApplicationBuilder/kMUzZ/examples/hello.jl", appname="HelloWorld", verbose=true); Using calculated bundle_identifier: 'com.rogers.helloworld'

~~~~~~ Compiling a binary from '/Users/rogers/.julia/packages/ApplicationBuilder/kMUzZ/examples/hello.jl'... ~~~~~~~
  PackageCompiler.static_julia(...)
ERROR: UndefVarError: build_executable not defined
Stacktrace:
 [1] getproperty at ./Base.jl:26 [inlined]
 [2] (::ApplicationBuilder.var"#2#7"{String,Bool,String,String,String,String})() at /Users/rogers/.julia/packages/ApplicationBuilder/kMUzZ/src/ApplicationBuilder.jl:166
 [3] withenv(::ApplicationBuilder.var"#2#7"{String,Bool,String,String,String,String}, ::Pair{String,String}, ::Vararg{Pair{String,String},N} where N) at ./env.jl:161
 [4] build_app_bundle(::String; appname::String, builddir::String, binary_name::String, resources::Array{String,1}, libraries::Array{String,1}, verbose::Bool, bundle_identifier::Nothing, app_version::String, icns_file::Nothing, certificate::Nothing, entitlements_file::Nothing, snoopfile::Nothing, autosnoop::Bool, commandline_app::Bool, cpu_target::String) at /Users/rogers/.julia/packages/ApplicationBuilder/kMUzZ/src/ApplicationBuilder.jl:162
 [5] top-level scope at REPL[2]:1

alanrogers avatar Jun 27 '20 22:06 alanrogers

Same here. Was this issue ever resolved?

MacOS 12.6

`build_app_bundle("my_julia_main.jl", appname="MyCode", verbose = true); Using calculated bundle_identifier: 'com.mattpetersonsaccount.mycode'

~~~~~~ Compiling a binary from 'my_julia_main.jl'... ~~~~~~~
  PackageCompiler.static_julia(...)
ERROR: UndefVarError: build_executable not defined
Stacktrace:
 [1] getproperty
   @ ./Base.jl:31 [inlined]
 [2] (::ApplicationBuilder.var"#3#9"{String, Bool, String, String, String, String})()
   @ ApplicationBuilder ~/.julia/packages/ApplicationBuilder/kMUzZ/src/ApplicationBuilder.jl:166
 [3] withenv(::ApplicationBuilder.var"#3#9"{String, Bool, String, String, String, String}, ::Pair{String, String}, ::Vararg{Pair{String, String}})
   @ Base ./env.jl:172
 [4] build_app_bundle(juliaprog_main::String; appname::String, builddir::String, binary_name::String, resources::Vector{String}, libraries::Vector{String}, verbose::Bool, bundle_identifier::Nothing, app_version::String, icns_file::Nothing, certificate::Nothing, entitlements_file::Nothing, snoopfile::Nothing, autosnoop::Bool, commandline_app::Bool, cpu_target::String)
   @ ApplicationBuilder ~/.julia/packages/ApplicationBuilder/kMUzZ/src/ApplicationBuilder.jl:162
 [5] top-level scope
   @ REPL[12]:1`

mpeters2 avatar Nov 23 '22 16:11 mpeters2