Building the examples/QMLApp example with the juliaimg bundler works when invoked via julia -m AppBundler build ..., but fails with ERROR: Unknown package: QMLApp when invoked through the appbundler CLI entry point using the same arguments.
Environment
- AppBundler:
~/.julia/packages/AppBundler/CNmKH
- Platform: macOS aarch64
- Julia (sysimg target): 1.12.5
Steps to reproduce
Works:
julia -m AppBundler build examples/QMLApp -Dbundler="juliaimg" --selfsign
Fails:
appbundler build examples/QMLApp -Dbundler="juliaimg" --selfsign
Expected behavior
Both invocations should produce an identical DMG. The appbundler CLI should be a thin wrapper over julia -m AppBundler build and should resolve the project/package context the same way.
Actual behavior
During compile_sysimg, the bundled Julia is invoked with --project pointing at the example directory, but Pkg.precompile(["QMLApp"]) fails because Pkg does not see QMLApp as part of the active project:
Fetching sources for julia-1.12.5-Pkg.BinaryPlatforms.MacOS(Platform("aarch64", "macos"; ))
Compiling sysimage for ["QMLApp"]...
Precompiling Pkg finished.
1 dependency successfully precompiled in 21 seconds
ERROR: Unknown package: QMLApp
ERROR: failed process: Process(`.../QMLApp.app/Contents/Libraries/bin/julia --startup-file=no --pkgimages=no --project=/Users/jerdmanis/BtSync/PeaceFounder/Github/AppBundler/examples/QMLApp --eval 'import Pkg; Pkg.precompile(["QMLApp"])'`, ProcessExited(1))
Full stacktrace points to JuliaImg.compile_sysimg at src/bundlers/JuliaImg/JuliaImg.jl:245.
Analysis / hypothesis
Likely a DEPOT_PATH / LOAD_PATH discrepancy between the two entry points. The appbundler CLI probably alters (or fails to propagate) these env vars when spawning the sysimg-compilation subprocess, so the child Julia ends up without the depot/load context needed to resolve QMLApp from the example's project.
Workaround
Use julia -m AppBundler build ... directly.
Building the
examples/QMLAppexample with thejuliaimgbundler works when invoked viajulia -m AppBundler build ..., but fails withERROR: Unknown package: QMLAppwhen invoked through theappbundlerCLI entry point using the same arguments.Environment
~/.julia/packages/AppBundler/CNmKHSteps to reproduce
Works:
Fails:
Expected behavior
Both invocations should produce an identical DMG. The
appbundlerCLI should be a thin wrapper overjulia -m AppBundler buildand should resolve the project/package context the same way.Actual behavior
During
compile_sysimg, the bundled Julia is invoked with--projectpointing at the example directory, butPkg.precompile(["QMLApp"])fails because Pkg does not seeQMLAppas part of the active project:Full stacktrace points to
JuliaImg.compile_sysimgatsrc/bundlers/JuliaImg/JuliaImg.jl:245.Analysis / hypothesis
Likely a
DEPOT_PATH/LOAD_PATHdiscrepancy between the two entry points. The appbundler CLI probably alters (or fails to propagate) these env vars when spawning the sysimg-compilation subprocess, so the child Julia ends up without the depot/load context needed to resolveQMLAppfrom the example's project.Workaround
Use
julia -m AppBundler build ...directly.