Lokyr
Documentation

Contributing to Lokyr

On this page

Thank you for your interest in Lokyr. This guide tells how to set up the project, the rules that the code and the documents follow, and what a pull request needs before it can be merged.

Lokyr is young: its first version is under way, for macOS 26 or later on Apple Silicon. Linux comes later. By taking part, you agree to follow the code of conduct.

Before you start

Setting up

You need:

Then:

cargo run -p lokyr-app   # the terminal, with your login shell
just --list             # the project's recipes
just ci                 # the checks of CI, as the next section tells

Fuzzing uses a nightly Rust, which the justfile pins, and cargo-fuzz; you need it only to work on the fuzzers.

The bundle, target/Lokyr.app, which just bundle builds, is signed with the identity that LOKYR_SIGN_IDENTITY names, as codesign --sign takes it, and ad hoc without it. just and cargo xtask read the variables of the untracked private/lokyr.env, which names the Developer ID and the notary's profile, so that no signing identity, team or credential is in the repository; a variable of the environment wins over the file's. just notarize has Apple notarize the bundle and staples the ticket: it needs the Developer ID and the notary's credentials, an App Store Connect API key where LOKYR_NOTARY_KEY (the .p8 file's path) and LOKYR_NOTARY_KEY_ID name one, with LOKYR_NOTARY_ISSUER for a team's key, or else the keychain's profile lokyr-notary that xcrun notarytool store-credentials makes, or the one that LOKYR_NOTARY_PROFILE names; it sends the bundle to Apple's notary service.

The bundle carries the notices of the licenses of what it holds of other projects, in Contents/Resources/licenses: the symbols' font's, Sparkle's, and in crates every crate's of the binary, with an index, which cargo xtask bundle writes from cargo metadata, of the license that Lokyr takes of each crate's expression among those that deny.toml allows, its own files, or the license's text of SPDX's list, in tools/xtask/licenses, under its authors' copyright where its package has none; a crate that allows none of them fails the bundle, and a license that deny.toml comes to allow needs its text there.

The bundle holds Sparkle's updater, of the release that tools/xtask/src/sparkle.rs pins with its digest, which cargo xtask bundle downloads once into target/sparkle, and signs with the bundle's identity; the app loads it after its first window, and cargo run runs without it. The private EdDSA key that signs the updates is the maintainer's, in the login keychain under the account lokyr of Sparkle's generate_keys, with a copy in the untracked private/; the public one is in sparkle.rs.

just dmg builds target/Lokyr-<version>.dmg of the bundle, the app and a link to Applications over a background, after it has Apple notarize the bundle if it has no ticket yet, and has Apple notarize the image too; cargo xtask dmg --no-notarize builds it of the bundle as it is, to look at it. The window's look is the Finder's own .DS_Store, kept in crates/app/resources/dmg, which cargo xtask dmg layout has the Finder write again, with the background rendered from its SVG by rsvg-convert, when the window's size or the icons' places change; it needs the terminal's permission to control the Finder.

The updates' public feed is an asset of each release, appcast.xml, which https://lokyr.dev/appcast.xml serves of the latest release, site/public/appcast.xml until a release holds one, and the bundle's SUFeedURL names: cargo xtask feed publish target/Lokyr-<X.Y.Z>.dmg puts a release's DMG into the latest release's feed, written into target/releases/<X.Y.Z>/appcast.xml, of Sparkle's generate_appcast in the untracked private/public-feed, which keeps the released DMGs to make the deltas of, each item's DMG and deltas downloaded from its own GitHub release, and the appcast signed with the EdDSA key. The feed of tests is on the maintainer's Mac, in the untracked private/feed: cargo xtask feed add target/Lokyr-<version>.dmg puts a DMG there with its notes, docs/releases/<X.Y.Z>.md or the file that --notes names, and has Sparkle's generate_appcast write the appcast, each DMG and the appcast signed with the EdDSA key, the keychain's or the file that LOKYR_SPARKLE_KEY_FILE names; --channel <name> puts the version in a channel, as a beta's. just feed-serve has Lokyr on that Mac read the feed, through the updater's SUFeedURL in its defaults, and serves it on 127.0.0.1:8123 until Control-C; defaults delete io.github.sephiroth74.lokyr SUFeedURL gives the builds their own feed back.

Releasing covers how a release is made, by the CI or by hand. just release <version> releases a candidate, X.Y.Z-rc.N, or a release, X.Y.Z, of the workspace's version, in the steps of cargo xtask release, check, build and draft, each of which runs alone as cargo xtask release <step> <version>, check first, of no secret, which a release's pull request into main runs, beside build, which the release's workflow runs on GitHub's macOS runner in the environment release, of its secrets and the maintainer's approval: the Developer ID imported into a keychain of the run, deleted at its end, and the notary's API key, the log masking the identity, its team and the notarization's id, the DMG, the dSYM and the bill an artifact of the run, which its draft job, of the EdDSA key, drafts in place of a draft of that tag, the last five released DMGs downloaded for the deltas, and tells the pull request of; at the pull request's merge, its publish job, of the maintainer's approval again, checks that the merge holds the tree that the release built, and that the draft is of the pull request's last commit and holds its DMG and feed, a draft of an earlier push or of a draft that failed refused, waits for a draft that runs, moves the draft to the merge and publishes it (cargo xtask release publish <version> --target <commit> --built <commit>), its tag made there, asks a run of the site of main, which a release's merge does not deploy of its own push, and pushes the tap's cask, the run's summary telling what is left by hand of a step that failed; a release's pull request into test/main, a branch of tests, rehearses it all, the release a pre-release that is never the latest (--rehearsal), the site built and not deployed, the cask pushed to a branch of tests of the tap; from the commit checked out, without changes, once GitHub has it: the bundle built as that version, its build's number above the feed's latest, which it refuses to release without, unless --without-feed, as a feed's first release, and with SOURCE_DATE_EPOCH set, which would give the number, the binary's dSYM, which the release profile makes beside it, and the bill of materials, CycloneDX's JSON of the crates that the binary holds, Sparkle and the symbols' font, kept in target/releases/<version>; the DMG, the bundle and the image notarized; a draft of the GitHub release, v<version>, a candidate's a pre-release, with the DMG, the dSYM and the bill, its notes docs/releases/<X.Y.Z>.md; the DMG in the feed of tests; and a release's, not a candidate's, in the public feed, its deltas and its appcast uploaded to the draft, and its Homebrew cask. A release's commit holds no mark of what no release has yet, which cargo xtask since <X.Y.Z> makes the release's beforehand. Publishing the draft, cargo xtask release publish <version>, makes its tag and the release the latest, whose appcast the site serves once its workflow runs again; then the cask is pushed to the tap. cargo xtask symbolicate <report.ips> reads a crash report of macOS, from ~/Library/Logs/DiagnosticReports: its crashed thread and the main thread, Lokyr's frames told by their functions, files and lines through the dSYM of the binary's UUID, which target/releases keeps, or the one that --dsym names. The app's own log, which a panic writes its backtrace to, is ~/Library/Logs/Lokyr/lokyr.log.

The gate: just ci

just ci runs the checks of CI that a Mac can make, and a pull request needs it green:

CI's macOS job, whose minutes GitHub bills ten times a Linux job's, runs on main's pushes, on pull requests and on the runs that gh workflow run CI --ref <branch> asks for, and only of changes beyond documents, Markdown files and docs/; a phase's branch, as f3, runs its Linux jobs at each push, and the macOS job by hand, as before a release, just ci on the Mac covering it meanwhile.

Two checks of CI are not in it, and run on Linux: the tests of the platform-independent crates, which just ci builds for Linux without running; and the count of the instructions that the terminal's core takes for a set of scenarios, which fails a pull request that raises one by more than 3% over its base, with just instructions <base> where Valgrind runs.

The code

The conventions are the full list. The ones that reviews meet most:

Tests

The documents

Commits

Pull requests

Translations

A translation, a new language or a better one, follows TRANSLATING.md: the catalogs, their format, and the steps of a new language.

Reporting a bug

Open an issue with the bug's template: the macOS version, the Mac, Lokyr's commit, your config, the steps that make the bug happen, and what you expected. A security problem goes privately to the maintainer, through GitHub's private vulnerability reporting, not in a public issue.

License

Lokyr is under the MIT license. By contributing, you agree that your contributions are under the same license.