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

Aperta Adatta ai principianti
#749 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
62/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
docker, linux, rust
Ambito
cli

Direzione di ricerca

Il ramo di dispatch si trova in crates/kiri/src/main.rs, limitato a macOS, e il modulo update è dichiarato con lo stesso cfg in mod update; inizia da lì. Leggi update.rs per vedere il ramo Linux di run(), che recupera il feed latest.json e segnala il nuovo .deb/.rpm. Compila update su Linux escludendo con cfg le parti specifiche di macOS (engine_pid, restart_engine). Poi verifica che kiri update --check stampi la versione e l'indicazione per il download. È completato quando il comando funziona su Linux e la build per macOS resta invariata.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Rust
Stelle
7.5k
Fork
329
Merge medio
15h 49m
PR unite (30g)
241

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di libracoder/kiri

Tutte le issue di libracoder/kiri

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.