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
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
22
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
22
1 change: 1 addition & 0 deletions crates/ironclaw_webui_v2_static/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ fn collect(root: &Path, dir: &Path, out: &mut Vec<(String, PathBuf)>) {
{
continue;
}
println!("cargo:rerun-if-changed={}", path.display());
let rel = path.strip_prefix(root).expect("strip prefix"); // safety: build script — strip_prefix only fails on a logic bug
Comment on lines +84 to 85

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Emitting absolute paths via cargo:rerun-if-changed can break build caching and reproducibility (e.g., when using distributed compilation tools like sccache or sandboxed environments like Nix/Bazel) because the paths contain local workspace directory structures.

Instead, we should emit paths relative to the crate root (CARGO_MANIFEST_DIR). Since root represents the static directory, we can strip the prefix and construct a relative path starting with static/.

Suggested change
println!("cargo:rerun-if-changed={}", path.display());
let rel = path.strip_prefix(root).expect("strip prefix"); // safety: build script — strip_prefix only fails on a logic bug
let rel = path.strip_prefix(root).expect("strip prefix"); // safety: build script — strip_prefix only fails on a logic bug
println!("cargo:rerun-if-changed={}", Path::new("static").join(rel).display());
References
  1. When relativizing paths, use std::path::Path::strip_prefix on Path objects rather than string manipulation, unless the string prefix is guaranteed to be exact.

// Force forward slashes in the URL key even on Windows hosts.
let url = rel
Expand Down
4 changes: 4 additions & 0 deletions crates/ironclaw_webui_v2_static/frontend/package-lock.json

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

4 changes: 4 additions & 0 deletions crates/ironclaw_webui_v2_static/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
"private": true,
"description": "Build tooling for the WebUI v2 SPA. Bundles the local ES modules and the React ecosystem into static/dist via esbuild. NOT a runtime npm package — cargo never invokes this. Run ./build.sh by hand after editing static/js/** or to refresh vendored deps; the outputs under static/dist and static/vendor are committed so cargo build needs no network or node.",
"type": "module",
"engines": {
"node": ">=22 <23",
"npm": ">=10"
},
"scripts": {
"build": "node build.mjs",
"vendor": "bash vendor.sh",
Expand Down
Loading