Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 6 additions & 4 deletions crates/fastled-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }"
Expand Down
5 changes: 3 additions & 2 deletions crates/fastled-cli/build.rs
Original file line number Diff line number Diff line change
@@ -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");
Expand Down
12 changes: 8 additions & 4 deletions docs/kernal-api-migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down
17 changes: 6 additions & 11 deletions tests/unit/test_kernal_boundary.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"(?<![:\w])([a-z_][a-z0-9_]*)::", build_rs)) - {"std"}
assert crates_used == {"kernal_api"}, crates_used
assert crates_used == {"kernal_api_build"}, crates_used
assert "extern crate" not in build_rs


Expand Down
Loading