From 0f638b1323bc013b0e06b2074c12d8de9894746d Mon Sep 17 00:00:00 2001 From: Zach Vorhies Date: Tue, 15 Sep 2026 18:21:11 -0700 Subject: [PATCH] fix: take Windows resources from the kernal-api-build companion package The macOS ARM Live Test has failed on main since 80b7799: its Linux cross-build could not compile glib-sys. `viewer = ["kernal-api/tauri-webview"]` applies to every dependency named kernal-api, including the build dependency added for Windows resources, so the host build script pulled in Tauri, GTK and glib. Renaming that dependency is rejected by Cargo, which refuses one package under two names. kernal-api v0.1.7 ships the capability as the separate kernal-api-build package instead, so no application feature can reach it. build.rs now depends on that package alone, and the boundary test requires exactly that shape. Verified on Linux against v0.1.7: `cargo tree` shows the build dependency is only kernal-api-build with no glib-sys for the macOS target; Rust workspace tests (303/3/1/1), Python tests (45 passed, 1 skipped) and `bash lint` pass; and a fastled.exe cross-built for x86_64-pc-windows-msvc still embeds RT_ICON, RT_GROUP_ICON (32512), RT_VERSION ("FastLED Viewer", "fastled", 2.0.20) and the Common-Controls v6 RT_MANIFEST. Refs #242 Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01VfXV1EpgAvMZzXJfbGZPRG --- Cargo.lock | 16 ++++++++++++---- Cargo.toml | 2 +- crates/fastled-cli/Cargo.toml | 10 ++++++---- crates/fastled-cli/build.rs | 5 +++-- docs/kernal-api-migration.md | 12 ++++++++---- tests/unit/test_kernal_boundary.py | 17 ++++++----------- 6 files changed, 36 insertions(+), 26 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5a3f0af5..d794a160 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1008,6 +1008,7 @@ name = "fastled-cli" version = "2.0.20" dependencies = [ "kernal-api", + "kernal-api-build", ] [[package]] @@ -2023,14 +2024,13 @@ dependencies = [ [[package]] name = "kernal-api" -version = "0.1.6" -source = "git+https://github.com/zackees/kernal-api.git?tag=v0.1.6#560a5137d6371464dd13f0541d8ad1efa9745c8e" +version = "0.1.7" +source = "git+https://github.com/zackees/kernal-api.git?tag=v0.1.7#6ca1c16d75da56422bc6d143ea48c1c016647d6f" dependencies = [ "blake3", "bytes", "clap", "dirs 6.0.0", - "embed-resource", "flate2", "futures-core", "futures-util", @@ -2078,6 +2078,14 @@ dependencies = [ "zstd", ] +[[package]] +name = "kernal-api-build" +version = "0.1.7" +source = "git+https://github.com/zackees/kernal-api.git?tag=v0.1.7#6ca1c16d75da56422bc6d143ea48c1c016647d6f" +dependencies = [ + "embed-resource", +] + [[package]] name = "keyboard-types" version = "0.7.0" @@ -4140,7 +4148,7 @@ dependencies = [ "serde_with", "swift-rs", "thiserror 2.0.20", - "toml 0.9.12+spec-1.1.0", + "toml 1.1.2+spec-1.1.0", "url", "urlpattern", "uuid", diff --git a/Cargo.toml b/Cargo.toml index e7d63f78..54318f5d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ repository = "https://github.com/zackees/fastled-wasm" homepage = "https://github.com/zackees/fastled-wasm" [workspace.dependencies] -kernal-api = { git = "https://github.com/zackees/kernal-api.git", tag = "v0.1.6", features = ["fs", "fs-watch", "hash-sha256", "archive", "http-client", "http-server", "websocket", "event-stream", "secure-random", "text-similarity", "pty", "terminal-input", "terminal-style", "command-arguments", "command-schema", "config-toml", "source-cpp", "json", "error-context"] } +kernal-api = { git = "https://github.com/zackees/kernal-api.git", tag = "v0.1.7", features = ["fs", "fs-watch", "hash-sha256", "archive", "http-client", "http-server", "websocket", "event-stream", "secure-random", "text-similarity", "pty", "terminal-input", "terminal-style", "command-arguments", "command-schema", "config-toml", "source-cpp", "json", "error-context"] } [profile.release] debug = "line-tables-only" diff --git a/crates/fastled-cli/Cargo.toml b/crates/fastled-cli/Cargo.toml index a67d73e4..0d33991e 100644 --- a/crates/fastled-cli/Cargo.toml +++ b/crates/fastled-cli/Cargo.toml @@ -24,11 +24,13 @@ path = "src/main.rs" kernal-api = { workspace = true } # build.rs embeds the Windows icon, version information and manifest through -# kernal-api's build-script capability. Same source and tag as the workspace -# dependency, but only that feature, so the build script does not compile the -# runtime capabilities a second time. +# kernal-api's build-script companion package, released from the same +# repository under the same tag. It is a separate package, not a kernal-api +# feature: `viewer`'s `kernal-api/tauri-webview` would apply to a +# same-named build-dependency too and compile Tauri, GTK and glib for the +# host build script. [build-dependencies] -kernal-api = { git = "https://github.com/zackees/kernal-api.git", tag = "v0.1.6", default-features = false, features = ["windows-app-resources"] } +kernal-api-build = { git = "https://github.com/zackees/kernal-api.git", tag = "v0.1.7" } [package.metadata.binstall] pkg-url = "{ repo }/releases/download/v{ version }/fastled-{ target }{ archive-suffix }" diff --git a/crates/fastled-cli/build.rs b/crates/fastled-cli/build.rs index a4257e7c..f1e11092 100644 --- a/crates/fastled-cli/build.rs +++ b/crates/fastled-cli/build.rs @@ -1,8 +1,9 @@ //! Embeds the Windows executable's icon, version information and application //! manifest. Only the binary's own build script can link these resources, so -//! the mechanics live in kernal-api and this file only declares the product. +//! the mechanics live in kernal-api's build companion and this file only +//! declares the product. -use kernal_api::windows_resources::{embed_windows_app_resources, WindowsAppResources}; +use kernal_api_build::{embed_windows_app_resources, WindowsAppResources}; fn main() { println!("cargo:rerun-if-changed=build.rs"); diff --git a/docs/kernal-api-migration.md b/docs/kernal-api-migration.md index dd7b5477..20792907 100644 --- a/docs/kernal-api-migration.md +++ b/docs/kernal-api-migration.md @@ -1117,8 +1117,12 @@ only a version bump over `762a1d2`. kernal-api `v0.1.4`, cut from the same `release/0.1.3` branch, forced WebKitGTK's worker WebGL feature (zackees/kernal-api#268). That froze the viewer on NVIDIA Wayland, so `v0.1.5` reverts it (zackees/kernal-api#272); code-wise it is `v0.1.3` again. `v0.1.6` -adds only the opt-in `windows-app-resources` build-script capability -(zackees/kernal-api#276). The workspace consumes the `v0.1.6` tag. crates.io publishing is not enabled for +added a `windows-app-resources` feature for build scripts; a feature cannot +serve that purpose, because an application's `kernal-api/tauri-webview` entry +also applies to a same-named build dependency and compiled Tauri, GTK and glib +for the host build script. `v0.1.7` replaces it with the separate +`kernal-api-build` package, released from the same repository under the same +tag. The workspace consumes the `v0.1.7` tag. crates.io publishing is not enabled for kernal-api, and `fastled-cli` is not published to crates.io, so the workspace uses a git tag dependency. The pre-release pin, path and `[patch]` overrides are gone. @@ -1128,8 +1132,8 @@ unit-test workflows. It requires `kernal-api` to be the only dependency in every package, workspace and target table. It also forbids dev dependencies, `[patch]` and generated Tauri output, and requires the `hash-sha256` feature, alongside the per-backend source bans. `fastled-cli` has exactly one -`build.rs`: its only build dependency is `kernal-api` from the same release -with only `windows-app-resources`, and it names no other crate. +`build.rs`: its only build dependency is `kernal-api-build` from the same +repository and release tag, and it names no other crate. **Windows executable resources.** The Tauri-era `fastled.exe` carried an icon, version information and a Common-Controls v6 manifest from `tauri-build`; the diff --git a/tests/unit/test_kernal_boundary.py b/tests/unit/test_kernal_boundary.py index a00d5259..5056f577 100644 --- a/tests/unit/test_kernal_boundary.py +++ b/tests/unit/test_kernal_boundary.py @@ -195,28 +195,23 @@ def test_kernal_api_is_the_only_rust_dependency(): assert not section.get("build-dependencies"), section assert set(package["dependencies"]) == {"kernal-api"} kernal = workspace["workspace"]["dependencies"]["kernal-api"] - assert kernal["tag"] == "v0.1.6" + assert kernal["tag"] == "v0.1.7" assert "rev" not in kernal and "path" not in kernal assert "hash-sha256" in kernal["features"] assert "patch" not in workspace assert not (root / "crates/fastled-cli/gen").exists() # The one build script embeds Windows executable resources through - # kernal-api's build capability: kernal-api is its only build dependency, - # from the same release, with only that feature, and it names no other crate. + # kernal-api's build companion: that package, from the same repository and + # release tag, is its only build dependency, and it names no other crate. build = package["build-dependencies"] - assert set(build) == {"kernal-api"}, build - assert build["kernal-api"] == { - "git": kernal["git"], - "tag": kernal["tag"], - "default-features": False, - "features": ["windows-app-resources"], - } + assert set(build) == {"kernal-api-build"}, build + assert build["kernal-api-build"] == {"git": kernal["git"], "tag": kernal["tag"]} build_rs = (root / "crates/fastled-cli/build.rs").read_text() # Leading path segments only: `kernal_api::windows_resources::...` names # the crate `kernal_api`, not a crate called `windows_resources`. crates_used = set(re.findall(r"(?