cirruslabs / tart

macOS and Linux VMs on Apple Silicon to use in CI and other automations
https://tart.run
Other
3.8k stars 112 forks source link

Improve macOS app integration #746

Closed torarnv closed 6 months ago

torarnv commented 7 months ago

Tart is now a proper application bundle, with the name and icon declared in the Info.plist, which we were missing.

This also allows us to declare the app as LSBackgroundOnly as a default, which means that 'tart create' and similar background commands will not show the application icon in the dock, while 'tart run' will, thanks to it overriding the activation policy of the app.

For now the logic of creating the Tart.app bundle is duplicated between the CI packaging scripts and the run-signed.sh script. Now that these scripts are growing, it makes sense to look at whether we can share the logic somehow, e.g. by building the application bundle directly during build, and packaging that, instead of creating it as a post install step.

torarnv commented 7 months ago

Proper branding in the UI:

image image

No change to command line assumptions about the name:

image
torarnv commented 6 months ago

Hmm, looks like this actually regressed our app integration. The homebrew formula apparently doesn't install the Info.plist or app icon:

❯ find /opt/homebrew/Cellar/tart/2.7.0
/opt/homebrew/Cellar/tart/2.7.0
/opt/homebrew/Cellar/tart/2.7.0/INSTALL_RECEIPT.json
/opt/homebrew/Cellar/tart/2.7.0/LICENSE
/opt/homebrew/Cellar/tart/2.7.0/bin
/opt/homebrew/Cellar/tart/2.7.0/bin/tart
/opt/homebrew/Cellar/tart/2.7.0/.brew
/opt/homebrew/Cellar/tart/2.7.0/.brew/tart.rb
/opt/homebrew/Cellar/tart/2.7.0/libexec
/opt/homebrew/Cellar/tart/2.7.0/libexec/tart.app
/opt/homebrew/Cellar/tart/2.7.0/libexec/tart.app/Contents
/opt/homebrew/Cellar/tart/2.7.0/libexec/tart.app/Contents/MacOS
/opt/homebrew/Cellar/tart/2.7.0/libexec/tart.app/Contents/MacOS/tart
/opt/homebrew/Cellar/tart/2.7.0/libexec/tart.app/Contents/embedded.provisionprofile

@fkorotkov @edigaryev What is https://github.com/cirruslabs/tart/blob/main/.ci/create-pkg.sh used for, and what is the relationship to the homebrew packaging? My assumption was that changing https://github.com/cirruslabs/tart/blob/main/.ci/create-pkg.sh and https://github.com/cirruslabs/tart/blob/main/scripts/run-signed.sh was enough to cover both development and production scenarios.

Without the Info.plist and app icon https://github.com/cirruslabs/tart/pull/746/files#diff-b0065f20172c946df326dee83abae39247b506400501d85c82272ef63211daa1 results in now always bringing up the Dock icon, even for headless runs, and the Dock icon is always missing Tart branded icon 😢

I'm going to clean up and fix this, sorry for the fallout.

My initial plan here is to:

Thoughts?

torarnv commented 6 months ago

Ah, and I see you already fixed the main issue in https://github.com/cirruslabs/tart/pull/756 . Thank you!