Diagram editor fails to build on Windows: build.rs can't find pnpm (pnpm.cmd)

Open Beginner friendly
#235 1 comment 0 reactions 0 assignees View on GitHub

@diyagarg09 is already working on this.

Since Nov 12, 2026.

  • #238 by @diyagarg09 — open

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

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

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from open-rmf/crossflow

All issues in open-rmf/crossflow

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.