Skip to content

Commit 0b379b6

Browse files
committed
fix: Windows E2E — double-quote git paths, enable fresh-sandbox, untag test 27
- cli.cppm: wrap git clone commands in #if _WIN32 guards to use double quotes instead of single quotes (cmd.exe doesn't understand POSIX single-quoting) - run_all.sh: add fresh-sandbox to CAPS on MINGW/MSYS/CYGWIN so tests 02, 24, and 32 run on Windows - 27_self_contained_home.sh: drop 'elf' from requires tag — the test only exercises filesystem layout and env-var resolution via GetModuleFileNameA (already ported), no ELF-specific behaviour
1 parent 29b8da6 commit 0b379b6

3 files changed

Lines changed: 15 additions & 1 deletion

File tree

src/cli.cppm

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1959,15 +1959,28 @@ prepare_build(bool print_fingerprint,
19591959
std::format("{} ({} = {})", spec.git, spec.gitRefKind, spec.gitRev));
19601960
std::string cloneCmd;
19611961
if (spec.gitRefKind == "branch") {
1962+
#if defined(_WIN32)
1963+
cloneCmd = std::format(
1964+
"git clone --depth 1 --branch \"{}\" \"{}\" \"{}\" 2>&1",
1965+
spec.gitRev, spec.git, gitRoot.string());
1966+
#else
19621967
cloneCmd = std::format(
19631968
"git clone --depth 1 --branch '{}' '{}' '{}' 2>&1",
19641969
spec.gitRev, spec.git, gitRoot.string());
1970+
#endif
19651971
} else {
19661972
// For tag/rev: full clone, then checkout (depth-1 may miss the rev).
1973+
#if defined(_WIN32)
1974+
cloneCmd = std::format(
1975+
"git clone \"{}\" \"{}\" && cd \"{}\" && git checkout --quiet \"{}\" 2>&1",
1976+
spec.git, gitRoot.string(),
1977+
gitRoot.string(), spec.gitRev);
1978+
#else
19671979
cloneCmd = std::format(
19681980
"git clone '{}' '{}' && cd '{}' && git checkout --quiet '{}' 2>&1",
19691981
spec.git, gitRoot.string(),
19701982
gitRoot.string(), spec.gitRev);
1983+
#endif
19711984
}
19721985
std::string out;
19731986
{

tests/e2e/27_self_contained_home.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env bash
2-
# requires: elf
2+
# requires:
33
# 27_self_contained_home.sh — verifies mcpp's self-contained home behaviour.
44
#
55
# Without MCPP_HOME set, mcpp resolves its home from the binary's location:

tests/e2e/run_all.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ case "$OS" in
6969
fi
7070
# NOTE: Windows runners may have g++.exe (MinGW/Strawberry) in PATH
7171
# but it's not a proper mcpp-compatible GCC. Don't add gcc capability.
72+
CAPS+=(fresh-sandbox)
7273
;;
7374
esac
7475

0 commit comments

Comments
 (0)