CI / test (push) Canceled after 17m11s
V: "kwi not starting from app menu or dock". Kwi is a Flatpak, and bwrap died
before it opened a window ("Can't find source path /run/user/1000/doc/by-app/
org.kde.kwi"); Chandra forked apps and forgot them, so the failure only reached
the session log and the click did nothing visible.
Every app the Applications menu, the dock, Super+1..9 and session restore start
now runs under a small monitor (sys spawn-watch, compositor/sys/sys_stub.c): it
copies the app's output to the session log as before, keeps its last 2 KiB,
and reports how sh -c CMD exited on a socket the main loop wakes on. The shell
(compositor/shell/launch.mbt) shows a red error notice for 15 s, and logs it,
when the app exits non-zero or by a signal within 30 s, or exits 0 without ever
opening a window here (after a 2 s grace for single-instance hand-offs): the
first line says what happened, then the command and the last lines it printed,
repeats folded ("(3 times)"). Status 127/126 say "command not found" / "not
executable". Launched apps no longer inherit the compositor's fds.
chandra-ctl launch ID starts a desktop app exactly as the dock does.
Tests: compositor/host/launch_test.mbt (bwrap-style failure incl. drawn notice,
127, SIGSEGV, exit 0 without a window, an app that keeps running), unit tests
in launch.mbt. Checked end to end with build/wasmhost + compositor.wasm
headless and a Flatpak-style kwi desktop file: chandra-ctl launch org.kde.kwi
shows the notice.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hiGJWeuHiTgtoyB4kb
140 lines
4.2 KiB
MoonBit
140 lines
4.2 KiB
MoonBit
// Generated by `wit-bindgen` 0.63.0. DO NOT EDIT!
|
|
|
|
///|
|
|
fn wasmImportUnixListen(p0 : Int, p1 : Int) -> Int = "chandra:host/sys@0.1.0" "unix-listen"
|
|
|
|
///|
|
|
fn wasmImportUnixAccept(p0 : Int) -> Int = "chandra:host/sys@0.1.0" "unix-accept"
|
|
|
|
///|
|
|
fn wasmImportUnixConnect(p0 : Int, p1 : Int) -> Int = "chandra:host/sys@0.1.0" "unix-connect"
|
|
|
|
///|
|
|
fn wasmImportCloseFd(p0 : Int) = "chandra:host/sys@0.1.0" "close-fd"
|
|
|
|
///|
|
|
fn wasmImportUnlink(p0 : Int, p1 : Int) = "chandra:host/sys@0.1.0" "unlink"
|
|
|
|
///|
|
|
fn wasmImportPollRead(p0 : Int, p1 : Int) -> Int = "chandra:host/sys@0.1.0" "poll-read"
|
|
|
|
///|
|
|
fn wasmImportWaitReadable(p0 : Int, p1 : Int, p2 : Int) -> Int = "chandra:host/sys@0.1.0" "wait-readable"
|
|
|
|
///|
|
|
fn wasmImportRecvmsg(p0 : Int, p1 : Int, p2 : Int) = "chandra:host/sys@0.1.0" "recvmsg"
|
|
|
|
///|
|
|
fn wasmImportTakeFd(p0 : Int) -> Int = "chandra:host/sys@0.1.0" "take-fd"
|
|
|
|
///|
|
|
fn wasmImportSendmsg(p0 : Int, p1 : Int, p2 : Int, p3 : Int) -> Int = "chandra:host/sys@0.1.0" "sendmsg"
|
|
|
|
///|
|
|
fn wasmImportMemfdCreate(p0 : Int, p1 : Int, p2 : Int) -> Int = "chandra:host/sys@0.1.0" "memfd-create"
|
|
|
|
///|
|
|
fn wasmImportPwrite(p0 : Int, p1 : Int, p2 : Int, p3 : Int) -> Int = "chandra:host/sys@0.1.0" "pwrite"
|
|
|
|
///|
|
|
fn wasmImportMmapRead(p0 : Int, p1 : Int, p2 : Int) = "chandra:host/sys@0.1.0" "mmap-read"
|
|
|
|
///|
|
|
fn wasmImportMmapReadAt(p0 : Int, p1 : Int, p2 : Int, p3 : Int) = "chandra:host/sys@0.1.0" "mmap-read-at"
|
|
|
|
///|
|
|
fn wasmImportReadFile(p0 : Int, p1 : Int, p2 : Int) = "chandra:host/sys@0.1.0" "read-file"
|
|
|
|
///|
|
|
fn wasmImportWriteFile(p0 : Int, p1 : Int, p2 : Int, p3 : Int) -> Int = "chandra:host/sys@0.1.0" "write-file"
|
|
|
|
///|
|
|
fn wasmImportAppendFile(p0 : Int, p1 : Int, p2 : Int, p3 : Int) -> Int = "chandra:host/sys@0.1.0" "append-file"
|
|
|
|
///|
|
|
fn wasmImportReadProc(p0 : Int, p1 : Int, p2 : Int) = "chandra:host/sys@0.1.0" "read-proc"
|
|
|
|
///|
|
|
fn wasmImportMkdirP(p0 : Int, p1 : Int) -> Int = "chandra:host/sys@0.1.0" "mkdir-p"
|
|
|
|
///|
|
|
fn wasmImportListDesktopFiles(p0 : Int, p1 : Int, p2 : Int) = "chandra:host/sys@0.1.0" "list-desktop-files"
|
|
|
|
///|
|
|
fn wasmImportSleepMs(p0 : Int) = "chandra:host/sys@0.1.0" "sleep-ms"
|
|
|
|
///|
|
|
fn wasmImportMonotonicMs() -> Int64 = "chandra:host/sys@0.1.0" "monotonic-ms"
|
|
|
|
///|
|
|
fn wasmImportLog(p0 : Int, p1 : Int) = "chandra:host/sys@0.1.0" "log"
|
|
|
|
///|
|
|
fn wasmImportGetpid() -> Int = "chandra:host/sys@0.1.0" "getpid"
|
|
|
|
///|
|
|
fn wasmImportWallTimeField(p0 : Int) -> Int = "chandra:host/sys@0.1.0" "wall-time-field"
|
|
|
|
///|
|
|
fn wasmImportGetenv(p0 : Int, p1 : Int, p2 : Int) = "chandra:host/sys@0.1.0" "getenv"
|
|
|
|
///|
|
|
fn wasmImportHasExe(p0 : Int, p1 : Int) -> Int = "chandra:host/sys@0.1.0" "has-exe"
|
|
|
|
///|
|
|
fn wasmImportSpawn(p0 : Int, p1 : Int, p2 : Int, p3 : Int) -> Int = "chandra:host/sys@0.1.0" "spawn"
|
|
|
|
///|
|
|
fn wasmImportSpawnWatch(p0 : Int, p1 : Int, p2 : Int, p3 : Int) -> Int = "chandra:host/sys@0.1.0" "spawn-watch"
|
|
|
|
///|
|
|
fn wasmImportSpawnSocket(p0 : Int, p1 : Int) -> Int = "chandra:host/sys@0.1.0" "spawn-socket"
|
|
|
|
///|
|
|
fn wasmImportTakeSigusr1() -> Int = "chandra:host/sys@0.1.0" "take-sigusr1"
|
|
|
|
///|
|
|
extern "wasm" fn mbt_ffi_ptr2bytes(ptr : Int, len : Int) -> FixedArray[Byte] =
|
|
#|(func (param i32) (param i32) (result i32)
|
|
#| local.get 0
|
|
#| local.get 1 call $moonbit.init_array8
|
|
#| local.get 0)
|
|
|
|
///|
|
|
extern "wasm" fn mbt_ffi_free(position : Int) =
|
|
#|(func (param i32) local.get 0 call $moonbit.decref)
|
|
|
|
///|
|
|
#owned(str)
|
|
extern "wasm" fn mbt_ffi_str2ptr(str : String) -> Int =
|
|
#|(func (param i32) (result i32) local.get 0)
|
|
|
|
///|
|
|
extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int =
|
|
#|(func (param i32) (result i32) local.get 0 i32.load)
|
|
|
|
///|
|
|
extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int =
|
|
#|(func (param i32) (result i32) (local i32)
|
|
#| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc
|
|
#| local.tee 1 i32.const 0 call $moonbit.init_array8
|
|
#| local.get 1)
|
|
|
|
///|
|
|
extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String =
|
|
#|(func (param i32) (param i32) (result i32)
|
|
#| local.get 0
|
|
#| local.get 1 call $moonbit.init_array16
|
|
#| local.get 0)
|
|
|
|
///|
|
|
#owned(bytes)
|
|
extern "wasm" fn mbt_ffi_bytes2ptr(bytes : FixedArray[Byte]) -> Int =
|
|
#|(func (param i32) (result i32) local.get 0)
|
|
|
|
///|
|
|
#owned(array)
|
|
extern "wasm" fn mbt_ffi_int_array2ptr(array : FixedArray[Int]) -> Int =
|
|
#|(func (param i32) (result i32) local.get 0)
|
|
|