Statically built .exe program using PackageCompiler.jl has dependency on project toml file?

Back in March 2019 when I was still using Julia 1.0, I built an example script into an executable binary on Windows to showcase the usage of a library I made in a standalone command line EXE. I just followed the tutorial provided with PackageCompiler.jl

The script’s name is “usage_example_5.jl”. By trial and error I found only these files are needed to run the EXE version:

  • usage_example_5.exe
  • usage_example_5.dll
  • libjulia.dll
  • libstdc++-6.dll
  • LLVM.dll

Fast forward to today, I tried running it again for no particular reason, and got this error message:

$ usage_example_5.exe
fatal: error thrown and no exception handler available.
InitError(mod=:Revise, error=Base.SystemError(prefix="opening file C:\Users\zpan\.julia\environments\v1.0\Project.toml", errnum=2, extrainfo=nothing))
rec_backtrace at /home/Administrator/buildbot/worker/package_win64/build/src\stackwalk.c:94
record_backtrace at /home/Administrator/buildbot/worker/package_win64/build/src\task.c:246
jl_throw at /home/Administrator/buildbot/worker/package_win64/build/src\task.c:577
#systemerror#39 at .\error.jl:106
systemerror at .\error.jl:106 [inlined]
#open#293 at .\iostream.jl:283
open at .\iostream.jl:275 [inlined]
#open#294 at .\iostream.jl:367
jl_invoke at /home/Administrator/buildbot/worker/package_win64/build/src\gf.c:42
open at .\iostream.jl:367 [inlined]
project_file_manifest_path at .\loading.jl:369 [inlined]
manifest_file at C:\Users\zpan\.julia\packages\Revise\yp5KG\src\pkgs.jl:259 [inlined]
manifest_file at C:\Users\zpan\.julia\packages\Revise\yp5KG\src\pkgs.jl:266 [inlined]
__init__ at C:\Users\zpan\.julia\packages\Revise\yp5KG\src\Revise.jl:856
jl_apply_generic at /home/Administrator/buildbot/worker/package_win64/build/src\gf.c:2184
jl_apply at /home/Administrator/buildbot/worker/package_win64/build/src\julia.h:1537 [inlined]
jl_module_run_initializer at /home/Administrator/buildbot/worker/package_win64/build/src\toplevel.c:90
_julia_init at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\init.c:813
julia_init__threading at /home/Administrator/buildbot/worker/package_win64/build/src\task.c:302
.text at C:\test\usage_example_5.exe (unknown line)
__tmainCRTStartup at /home/abuild/rpmbuild/BUILD/mingw-w64-crt\crt\crtexe.c:339
mainCRTStartup at /home/abuild/rpmbuild/BUILD/mingw-w64-crt\crt\crtexe.c:223
BaseThreadInitThunk at C:\Windows\System32\KERNEL32.DLL (unknown line)
RtlUserThreadStart at C:\Windows\SYSTEM32\ntdll.dll (unknown line)

The reason is the EXE cannot find a Project.toml file! Since I already uninstalled Julia 1.0 and moved on to newer versions, this file has been deleted.

In near future I need to deliver .exe to colleagues that can be run without dependencies except the ones I already provide in the same ZIP file. How do I make sure this kind of toml file dependency (or any other hidden dependencies) are either satisfied or removed?

Thanks!

That particular error is from the Revise package which you seem to have loaded into your environment. Revise attempts to compute the difference between the source code as it existed at compilation time and what currently exists at runtime and bring your runtime copy up to date in an efficient manner. Obviously it fails at that job if the original source code was deleted.

2 Likes