Skip to content

utc-status 0.2.0

Choose a tag to compare

@lispnik lispnik released this 08 Sep 22:34
· 8 commits to master since this release

Release 0.2.0 -- a signed bundle, an icon, and preferences

The headline is that the .app can now be signed, which 0.1.0 could not manage
and which is the difference between an application and a thing that only runs
where it was built.

SIGNING. An SBCL image dumped with :EXECUTABLE T cannot be codesigned at all:
SAVE-LISP-AND-DIE appends the core to the runtime's Mach-O past the end of
__LINKEDIT and past the code signature -- measured, both end at byte 410,952 of
a 47,782,952-byte image -- and codesign refuses 47MB of trailing data it cannot
cover, with "main executable failed strict validation", for a Developer ID as
much as for ad hoc.

asdf-macos-app now ships the core as a sealed resource with the SBCL runtime as
the executable and a relative symlink between them. The runtime finds a core
named sbcl.core beside itself with no arguments, which is what LaunchServices
gives a double-clicked app; the core cannot live in MacOS/ because codesign
treats everything there as nested code; a symlink is found by one and sealed by
the other. No C launcher, so still no C toolchain in the build.

The result signs with the hardened runtime, passes codesign --verify --deep
--strict, launches through LaunchServices, and detects a modified core. Ad hoc
is enough to run locally; a Developer ID in utc-status-app-bundle.asd is all
that notarisation needs.

AN ICON, drawn rather than checked in. tools/icon.lisp uses the same objc
bindings the application is built on: a grey clock face -- ring, twelve marks,
hour and minute hands at ten past ten -- under a gold TZ monogram. `make icon'
draws the PNG and asdf-macos-app converts it to an .icns, so changing the colour
is an edit and there is no binary artwork in the repository.

PREFERENCES. Show Seconds and Show UTC Label, checkable in the menu and stored
in com.lispnik.utc-status. Absent means "follow the system", so the first click
writes the opposite of whatever is on screen; an explicit off is not the same as
never having chosen, which matters on a Mac whose own clock shows seconds.

AND IT FOLLOWS SETTINGS CHANGED UNDER IT. Turning on 24-Hour Time in System
Settings used to leave the menu bar the wrong shape until the next launch; the
clock re-reads every ten seconds and rebuilds its formatter only when the
preferences actually differ. Polling rather than a notification, deliberately:
NSUserDefaultsDidChangeNotification is posted for changes made in THIS process,
and the change worth reacting to happens in another.

Three bugs found by running it as a real bundle rather than as a binary:
-initWithSuiteName: returns nil for your own bundle identifier, and the next
message sent to that nil was a crash on every launch; SB-EXT:EXIT left a
buffered log stream unflushed, so --print wrote nowhere at all; and
:DEFSYSTEM-DEPENDS-ON is resolved when an .asd is read, which made
asdf-macos-app a hard requirement for loading the library.

109 checks, 107 without the clipboard ones. Green on arm64 and Intel.