Repository navigation
feat: embed Windows application resources from a build script - #276
Merged
Merged
Conversation
An executable's Explorer icon, version information and application manifest are resources linked into the executable. Cargo only links a build script's resources into the binaries of the package that runs the script, so applications need a build-script capability. They lost that when they moved off tauri-build. The new `windows-app-resources` feature adds `windows_resources::embed_windows_app_resources`, called from an application's build.rs with kernal-api as a build-dependency. It validates the product name, company, version and optional icon, renders the .rc script and a Common-Controls v6 manifest into OUT_DIR, and compiles and links them through the private embed-resource backend (rc.exe on MSVC, llvm-rc when cross-compiling). It does nothing for non-Windows targets. The icon group uses id 32512 and the version block uses 0409/04B0, matching what Tauri-built executables carried. The feature is opt-in and not part of `full`; `embed_resource` is added to the facade's forbidden re-exports. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01VfXV1EpgAvMZzXJfbGZPRG
zackees
added a commit
that referenced
this pull request
Sep 15, 2026
Release on release/0.1.3 containing #276, which adds the opt-in windows-app-resources build-script capability, on top of v0.1.5. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01VfXV1EpgAvMZzXJfbGZPRG
zackees
added a commit
to FastLED/cli
that referenced
this pull request
Sep 15, 2026
The Tauri-era fastled.exe carried RT_ICON, RT_GROUP_ICON (32512),
RT_VERSION ("FastLED Viewer", "fastled", package version) and a
Common-Controls v6 RT_MANIFEST from tauri-build; the kernal-api build
carried no resources.
kernal-api v0.1.6 adds the windows-app-resources build-script capability
(forge-ci/kernal-api#276). crates/fastled-cli/build.rs declares the
product and icon and calls it; it does nothing on non-Windows targets.
The boundary test now allows exactly this one build script: kernal-api
is its only build dependency, from the same release, with only that
feature, and the script names no other crate.
A fastled.exe cross-built from Linux for x86_64-pc-windows-msvc embeds
the same four resources as the Tauri-era release. Linux: Rust workspace
tests, Python unit tests and bash lint pass.
Refs #242
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01VfXV1EpgAvMZzXJfbGZPRG
This was referenced Sep 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
New opt-in feature
windows-app-resources. It gives applications a build-script capability to embed a Windows executable's resources:Why
These are PE resources linked into the executable. Cargo only links a build script's resources into the binaries of the package that runs the script, so a normal dependency cannot provide them.
Applications that moved off
tauri-buildlost them. The FastLED CLI's Tauri-erafastled.execarriedRT_ICON,RT_GROUP_ICON(id 32512),RT_VERSIONandRT_MANIFEST; the kernal-api build carries no resources at all.API
major.minor.patch, each at most 65535; pre-release and build suffixes stay in the version strings..rcscript and manifest intoOUT_DIR, and printsrerun-if-changedfor the icon.embed-resourcebackend, pinned=3.0.11:rc.exeon MSVC,llvm-rcwhen cross-compiling, andRC/RC_<target>override both.embed_resourcejoins the facade's forbidden re-exports.IDI_APPLICATION), version block040904B0, and the same Common-Controls manifest.Changes
src/windows_resources.rs(new), gated insrc/lib.rsCargo.toml: the feature (not infull) and the optional exact-pinned dependencytests/facade_policy.rs: forbidden re-export, and the README feature listREADME.md,COMPATIBILITY.md: feature and public-surface entries.github/workflows/ci.yml: the feature in the each-feature matrixValidation
cargo test --features windows-app-resources --lib windows_resources: 5 passed. Covers version parsing, text validation, script rendering with and without an icon, and the manifest.cargo test --features windows-app-resources --test facade_policy: 15 passed.cargo clippy --features windows-app-resources --lib -- --deny warnings: clean.cargo clippy --locked --all-features --all-targets -- --deny warnings: clean.build.rscalls this capability, and the CLI was built against this branch through a local patch:soldr build --release --target x86_64-pc-windows-msvccross-build from Linux, usingllvm-rcas the resource compiler, produced afastled.exewhose resources match the Tauri-era release exactly:fastled.exeRT_ICONRT_GROUP_ICONRT_VERSIONCompanyName=fastled,ProductName=FastLED Viewer,2.0.20RT_MANIFEST🤖 Generated with Claude Code
https://claude.ai/code/session_01VfXV1EpgAvMZzXJfbGZPRG