← Commit history

v0.11.5: URL written with a raw write(2) to fd 1, with the byte count and the fd-1 target (readlink /proc/self/fd/1) reported on stderr — settles where the vanished stdout goes on a cold box (cold-verify #5)

John Lauer ·fa089f3c61 ·1mo ago ·parent c783e28
5 files changed +20−6
Cargo.lock+1−1
@@ -4,7 +4,7 @@ version = 4  [[package]] name = "adom-project-manager"-version = "0.11.4"+version = "0.11.5" dependencies = [  "altium-codec",  "anyhow",
Cargo.toml+1−1
@@ -1,6 +1,6 @@ [package] name = "adom-project-manager"-version = "0.11.4"+version = "0.11.5" edition = "2021" description = "Adom Project Manager — the central hub for navigating wiki boards, molecules, and libraries into Hydrogen: browse your wiki boards/projects, view symbol + footprint + 3D and the footprint layer stackup, add components to your KiCad/Altium libraries, and deliver self-contained KiCad projects. Built on adom-lbr." 
bin/adom-project-manager
⋯ 1 unchanged line ⋯
package.json+1−1
@@ -1,6 +1,6 @@ {   "slug": "adom-project-manager",-  "version": "0.11.4",+  "version": "0.11.5",   "type": "app",   "description": "Adom Project Manager — the central hub for navigating wiki boards, molecules and libraries into Hydrogen: browse your wiki boards/projects (Personal / Organization / Public), view symbol + footprint + 3D and the per-EDA footprint layer stackup, explore the board and schematic in INTERACTIVE cross-probing viewers (click a net, hover a part for stock and price), add components to your KiCad/Altium libraries, and deliver self-contained KiCad projects. Built on adom-lbr. (Formerly Adom Project Manager / adom-project-manager.)",   "dependencies": {
src/main.rs+17−3
@@ -304,6 +304,8 @@ extern "C" {     fn libc_kill(pid: i32, sig: i32) -> i32;     #[link_name = "setsid"]     fn libc_setsid() -> i32;+    #[link_name = "write"]+    fn libc_write(fd: i32, buf: *const u8, count: usize) -> isize; }  /// Print the readiness URL (the dock's `await: url` gate) and claim the dock@@ -314,15 +316,27 @@ fn finish_serve(port: u16, version: &str, started: bool) {     // the log file is invisible to it). Printed on EVERY path — reuse included,     // because Hard Refresh Open re-runs the steps and needs the URL each time —     // and explicitly flushed before the webview claim can block or die.-    println!(-        "OK: Adom Project Manager v{version} {} on {url}",+    let line = format!(+        "OK: Adom Project Manager v{version} {} on {url}\n",         if started { "started" } else { "already running" }     );+    // Written with a RAW write(2) to fd 1, not println!, and the result reported.+    // ConfRoomROG measured an empty stdout capture while the stderr mirror proved+    // this line executed, so the byte count and fd-1 target below say definitively+    // whether the write happened and WHERE it landed.+    let wrote = unsafe { libc_write(1, line.as_ptr(), line.len()) };     let _ = std::io::Write::flush(&mut std::io::stdout());+    let fd1 = std::fs::read_link("/proc/self/fd/1")+        .map(|p| p.to_string_lossy().into_owned())+        .unwrap_or_else(|_| "?".into());     // Mirrored to stderr on purpose: if a launcher ever swallows one stream, the     // other still carries the URL, and a both-streams-empty capture then proves     // the process never reached this line at all.-    eprintln!("[serve] url {url} (v{version}, {})", if started { "started" } else { "reused" });+    eprintln!(+        "[serve] url {url} (v{version}, {}) [fd1={fd1} wrote={wrote}/{}]",+        if started { "started" } else { "reused" },+        line.len()+    );     if let Ok(name) = std::env::var("ADOM_DOCK_WEBVIEW") {         if !name.is_empty() {             let ok = Command::new("adom-cli")