Skip to content

Commit 86e41ec

Browse files
committed
fix(build.mcpp): name the compiled program .exe on Windows (#230)
build.mcpp compiled to build.mcpp.bin, which Windows cmd.exe (the capture_exec shell there) cannot launch — .bin is not in PATHEXT. Name it build.mcpp.exe on Windows (is_windows is constexpr; non-Windows keeps .bin, bytes unchanged). Surfaces once a workspace build.mcpp member is reached on Windows, after the scanner symlink-escape crash fix (df985df) stops masking it as exit 127.
1 parent 4c9d793 commit 86e41ec

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/build/build_program.cppm

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,14 @@ std::expected<void, std::string> run_build_program(
536536
}
537537

538538
fs::create_directories(outDir, ec); // creates bdir too
539-
fs::path bin = bdir / "build.mcpp.bin";
539+
// #230: on Windows the capture_exec shell is cmd.exe, which can only launch
540+
// a PE by an executable extension — a bare `.bin` is not in PATHEXT and
541+
// fails to run. Name the compiled program `.exe` there; other platforms keep
542+
// `.bin` (cosmetic — bdir is separate from the `.mcpp` source). Surfaces
543+
// once a workspace build.mcpp member is reached on Windows, after the
544+
// scanner symlink-escape crash fix (df985df) stops masking it as exit 127.
545+
fs::path bin = bdir / (mcpp::platform::is_windows
546+
? "build.mcpp.exe" : "build.mcpp.bin");
540547

541548
// ── Compile build.mcpp with the host toolchain ──────────────────────────
542549
std::string std_flag = "-std=" + std::string(cppStandard.empty() ? "c++23" : cppStandard);

0 commit comments

Comments
 (0)