`kiri update --check` is unreachable on Linux, though update.rs is written for it

Open Beginner friendly
#749 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
62/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
docker, linux, rust
Domain
cli

Research direction

The dispatch arm is in crates/kiri/src/main.rs, gated to macOS, and the update module is declared with the same cfg in mod update; start there. Read update.rs to see the Linux branch of run() that fetches the latest.json feed and reports the new .deb/.rpm. Compile update on Linux with the macOS-only pieces (engine_pid, restart_engine) gated out, then check that kiri update --check prints the version and download hint. Done when the command works on Linux and the macOS build is unchanged.

Written by the indexing model from the issue text.

Description

What happens

On Linux, kiri update --check does not check for updates: it falls through to docker's update and fails.

$ kiri update --check
kiri: Kiri isn't running. Open Kiri, or start it with `kiri daemon`

kiri --help advertised kiri update [--check] until now (the help is a separate report), and crates/kiri/src/main.rs has the arm only for macOS:

#[cfg(target_os = "macos")]
Some("update") if !docker::is_container_update(&args[1..]) => update::run(&args[1..]),

Why it is a bug rather than "not for Linux"

update.rs is written for a Linux build: it reads https://download.runkiri.com/latest.json under #[cfg(target_os = "linux")], and run() has the branch that tells you to fetch the new .deb/.rpm. All of that is dead code today, because the module is #[cfg(target_os = "macos")] (mod update;) and no arm reaches it.

So a Linux user has no way to ask "is there a newer Kiri?" from the CLI, though the feed and the code to answer exist.

What would fix it

Compiling update on Linux and matching it the way macOS does, with run()'s existing Linux branch (report the version, tell the user where to download). engine_pid()/restart_engine() are the macOS-only parts (SOL_LOCAL, codesign, spctl) and would need #[cfg], or run() could be split so only the version check and the message build on Linux.

Environment

Linux x86-64, main @ 7898c46, built from source.

Dominant language
Rust
Stars
7.5k
Forks
329
Avg merge
15h 49m
Merged PRs (30d)
241

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from libracoder/kiri

All issues in libracoder/kiri

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.