From 97011220e585e7748e9cdcd8e995a394a96c7bf0 Mon Sep 17 00:00:00 2001 From: Josh Wilhelmi Date: Fri, 17 Apr 2026 03:50:43 -0500 Subject: [PATCH] [gobby-cli-#124] fix(ghook): Mark Windows extern block unsafe; release 0.1.1 ghook 0.1.0 published to crates.io but the Windows build target failed: edition 2024 requires `extern "system" { ... }` to be `unsafe extern "system" { ... }`. Local Mac dev never exercised the #[cfg(windows)] branch in detach.rs so it slipped through. Fix is one line in crates/ghook/src/detach.rs:36 plus a Cargo.toml bump to 0.1.1 and a CHANGELOG entry. Linux/Mac use the #[cfg(unix)] setsid(2) branch and were never affected -- the crates.io 0.1.0 install works on those platforms but not Windows. Verified: cargo build/test/clippy clean (27 ghook tests passing). Once gobby-hooks-v0.1.1 is tagged, the Release ghook workflow should succeed across all 5 build targets and create the GitHub Release that 0.1.0 missed. Co-Authored-By: Claude Opus 4.7 (1M context) --- CHANGELOG.md | 8 ++++++++ Cargo.lock | 2 +- crates/ghook/Cargo.toml | 2 +- crates/ghook/src/detach.rs | 3 ++- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 605657c..301cb23 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **Low-savings marker** — Suppress `[gsqz:low-savings]` marker when prepending it would grow the output beyond the original. The marker now only annotates when the annotation itself doesn't make things worse. (#111) - **Outer compression header for `/no-op` strategy** — When the low-savings marker is suppressed (above), the resulting `{pipeline}/no-op` strategy now also skips the outer `[Output compressed by gsqz — …, 0% reduction]` header and the daemon savings report. The user sees the original output verbatim. `CompressionResult::is_passthrough()` classifies `passthrough`, `excluded`, and `*/no-op` together so both call sites stay in sync. (#121) +## [0.1.1] — gobby-hooks + +### Fixed + +#### gobby-hooks + +- **Windows build** — `crates/ghook/src/detach.rs` declared `extern "system" { fn FreeConsole() -> i32; }` for the Windows-only `FreeConsole()` call. Edition 2024 requires extern blocks to be marked `unsafe`, so the Windows build target failed under Rust 1.95. Mac/Linux unaffected (their `#[cfg(unix)]` path uses `setsid(2)` instead). 0.1.0 published to crates.io but Windows users could not `cargo install gobby-hooks`. (#124) + ## [0.1.0] — gobby-hooks ### Added diff --git a/Cargo.lock b/Cargo.lock index 3531ed7..5c41f99 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -682,7 +682,7 @@ dependencies = [ [[package]] name = "gobby-hooks" -version = "0.1.0" +version = "0.1.1" dependencies = [ "anyhow", "base64 0.22.1", diff --git a/crates/ghook/Cargo.toml b/crates/ghook/Cargo.toml index 69ed8f2..e2c541d 100644 --- a/crates/ghook/Cargo.toml +++ b/crates/ghook/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "gobby-hooks" -version = "0.1.0" +version = "0.1.1" edition = "2024" rust-version = "1.85" authors = ["Josh Wilhelmi "] diff --git a/crates/ghook/src/detach.rs b/crates/ghook/src/detach.rs index 5ed2359..d71a3ac 100644 --- a/crates/ghook/src/detach.rs +++ b/crates/ghook/src/detach.rs @@ -33,7 +33,8 @@ pub fn detach() { #[cfg(windows)] { // SAFETY: FreeConsole is safe to call even with no attached console. - extern "system" { + // Edition 2024 requires extern blocks to be marked unsafe. + unsafe extern "system" { fn FreeConsole() -> i32; } unsafe {