Diagram editor fails to build on Windows: build.rs can't find pnpm (pnpm.cmd)
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- rust
- Domain
- build-system, devops
Research direction
Start with diagram-editor/build.rs and trace the two pnpm command calls used during the frontend build. Check how the build script invokes external commands on Windows, then build the calculator example with the frontend feature enabled. Done means the build succeeds when pnpm is installed as pnpm.cmd and continues to work on Linux and macOS.
Written by the indexing model from the issue text.
Description
Building the diagram editor from the repo fails on Windows because diagram-editor/build.rs can't find pnpm.
Environment: Windows 11, Rust 1.98.0, Node 22.23.3, pnpm 10.30.3 (installed with npm), crossflow main at 36d0f06.
Steps:
cd diagram-editor
pnpm install
cargo build --manifest-path ../examples/diagram/calculator/Cargo.toml
(pnpm dev:backend hits the same build, and also fails earlier in cmd because of the BUILD_FRONTEND=1 prefix.)
Error:
error: failed to run custom build command for `crossflow_diagram_editor v0.0.7`
thread 'main' panicked at diagram-editor\build.rs:22:14:
Failed to execute pnpm install: Error { kind: NotFound, message: "program not found" }
Cause: on Windows, npm and corepack install pnpm as a pnpm.cmd shim. Command::new("pnpm") only resolves pnpm.exe, so it never finds it. Since build_frontend() always calls build_uncompressed_pnpm() to compute the hash, any build with the frontend feature (which basic_executor enables) hits this. Published crates aren't affected, because build.rs is excluded from the package. The Windows CI job only builds --package crossflow, so it doesn't catch it.
Proposed fix: route both calls through a small helper that tries pnpm.cmd first on Windows and falls back to pnpm (for a standalone pnpm.exe):
fn pnpm(args: &[&str]) -> std::io::Result<std::process::ExitStatus> {
let run = |program: &str| Command::new(program).args(args).status();
if cfg!(windows) {
run("pnpm.cmd").or_else(|_| run("pnpm"))
} else {
run("pnpm")
}
}
let status =
pnpm(&["install", "--frozen-lockfile"]).expect("Failed to execute pnpm install");
// ...
let status = pnpm(&["build"]).expect("Failed to execute pnpm build");
I tested this locally on Windows. With BUILD_FRONTEND=1 and no standalone pnpm.exe on PATH, the calculator example builds and runs with the change, and fails with the error above without it. cargo fmt --check and cargo clippy -p crossflow_diagram_editor are clean. Behaviour on Linux and macOS is unchanged.
Optionally, adding a cargo build -p crossflow_diagram_editor step to ci_windows.yaml would keep this covered.
Happy to open a PR with this if it looks good.
- Dominant language
- Rust
- Stars
- 75
- Forks
- 18
- Avg merge
- 12d 12h
- Merged PRs (30d)
- 3
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from open-rmf/crossflow
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
-
Difficulty 5/5 Over a week Newbie friendliness 45/100
-
Add cleanup event to TracedEventKindMay be free again @mxgrey claimed this 158 days ago, and no pull request is open. Open
All issues in open-rmf/crossflow
Similar issues
-
comp-formats
Difficulty 2/5 Half a day Newbie friendliness 64/100
ClickHouse/ClickHouse#131694 ·
Maintainers usually reply within 1 day
-
cli: `execCargoMetadata` decodes stdout per chunk, corrupting non-ASCII paths across pipe boundariesOpen
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Copperpour/Copperpour#500 ·
Maintainers usually reply within 1 day
-
state:triage-needed
Difficulty 1/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day