PeaceFounder / AppBundler.jl

Bundle your Julia application
MIT License
53 stars 3 forks source link

First try on MacOS #1

Closed mpeters2 closed 9 months ago

mpeters2 commented 9 months ago

Julia 1.9.3. MacOS 14.0 ARM64

I entered the following from the terminal:

julia> import AppBundler
julia> import Pkg.BinaryPlatforms: Linux, MacOS, Windows
julia> AppBundler.bundle_app(MacOS(:x86_64), "/Users/.../AppBuilder Version/trichromacy", "/Users/.../AppBuilder Version/trichromacy.app")

(paths edited to maintain privacy).

AppBundler.bundle_app(MacOS(:x86_64), "/Users/.../AppBuilder Version/trichromacy", "/Users/.../AppBuilder Version/trichromacy.app")
[ Info: Rule with origin macos/Resources is skipped as not found in default or override path.
[ Info: Rule with origin precompile.jl is skipped as not found in default or override path.
ERROR: IOError: mkdir("/Users/.../AppBuilder Version/trichromacy.app/Contents/Libraries/startup/SplashScreen"; mode=0o777): no such file or directory (ENOENT)
Stacktrace:
 [1] uv_error
   @ ./libuv.jl:100 [inlined]
 [2] mkdir(path::String; mode::UInt16)
   @ Base.Filesystem ./file.jl:185
 [3] mkdir
   @ ./file.jl:177 [inlined]
 [4] merge(source::String, target::String)
   @ AppBundler ~/.julia/packages/AppBundler/7VFZ4/src/bundler.jl:64
 [5] build(bundle::AppBundler.Bundle, destination::String, parameters::Dict{String, Any})
   @ AppBundler ~/.julia/packages/AppBundler/7VFZ4/src/bundler.jl:121
 [6] bundle_app(platform::MacOS, source::String, destination::String; julia_version::VersionNumber, with_splash_screen::Nothing)
   @ AppBundler ~/.julia/packages/AppBundler/7VFZ4/src/recepies.jl:34
 [7] bundle_app(platform::MacOS, source::String, destination::String)
   @ AppBundler ~/.julia/packages/AppBundler/7VFZ4/src/recepies.jl:1
 [8] top-level scope
   @ REPL[23]:1

It does create a MacOS application package containing:

Contents
...Libraries
...Resources
......icon.icns

It looks like it is trying to make a splash screen, despite the parameter set to "nothing".

JanisErdmanis commented 9 months ago

This is unexpected. I see that the Contents/Libraries/startup folder is not created, so the mkdir of the SplashScreen folder has failed. This directory would be created independently from the with_splash_screen parameter as it is around 1KB, and I did not mind bothering. It only affects additional dependecies which need to be installed for the SplashScreen to work.

Can you print out a tree of the meta folder to see what is being overridden or try to reproduce the error by manipulating one of the examples so I can reproduce the error locally?

mpeters2 commented 9 months ago

(1) Should meta be in my project folder, or in the app it is building?

(2) Last night I added some println()'s to bundler.jl (lines 64, 80, and 120) to try to figure out what was going on. I failed, but I think it is accessing the default meta directory that came with AppBundler. Below is the output:

julia> AppBundler.bundle_app(MacOS(:aarch64), "/Users/…/AppBuilderVersion/Trichromacy", "/Users/…/AppBuilderVersion/Trichromacy.app")

[line 80 of build()]
Parameters = Dict{String, Any}("APP_SUMMARY" => "This is a default app summary", "BUILD_NUMBER" => 0, "BUNDLE_IDENTIFIER" => "org.appbundler.trichromacy", "PUBLISHER_DISPLAY_NAME" => "AppBundler", "APP_DESCRIPTION" => "A longer description of the app", "APP_DISPLAY_NAME" => "trichromacy", "APP_VERSION" => "0.1.0", "PUBLISHER" => "CN=AppBundler", "APP_NAME" => "trichromacy", "WITH_SPLASH_SCREEN" => "false")

[ Info: Rule with origin macos/Resources is skipped as not found in default or override path.
[line 120 of build()]
bundle.override, rule.origin), dest_path: /Users/…/AppBuilderVersion/Trichromacy/meta, icon.icns, /Users/…/AppBuilderVersion/Trichromacy.app/Contents/Resources/icon.icns
bundle.default, rule.origin), dest_path: /Users/…/.julia/packages/AppBundler/7VFZ4/recepies, icon.icns, /Users/…/AppBuilderVersion/Trichromacy.app/Contents/Resources/icon.icns

[ Info: Rule with origin precompile.jl is skipped as not found in default or override path.
[line 120 of build()]
bundle.override, rule.origin), dest_path: /Users/…/Trichromacy/meta, startup, /Users/…/Trichromacy.app/Contents/Libraries/startup
bundle.default, rule.origin), dest_path: /Users/…/.julia/packages/AppBundler/7VFZ4/recepies, startup, /Users/…/AppBuilderVersion/Trichromacy.app/Contents/Libraries/startup

[line 64 of merge()]
>>> dest_path: /Users/…/AppBuilderVersion/Trichromacy.app/Contents/Libraries/startup/SplashScreen
>>> src_path : /Users/…/.julia/packages/AppBundler/7VFZ4/recepies/startup/SplashScreen
ERROR: IOError: mkdir("/Users/…/AppBuilderVersion/Trichromacy.app/Contents/Libraries/startup/SplashScreen"; mode=0o777): no such file or directory (ENOENT)
JanisErdmanis commented 9 months ago

Ok. I reproduced the bug. As a quick workaround create an empty precompile.jl file until I make a fix.

JanisErdmanis commented 9 months ago

The issue should be resolved with AppBundler 0.1.2, which will be registered in a few minutes.

Edit: the fix is merged with AppBundler 0.1.1