Skip to content

Commit 23fa1db

Browse files
committed
fix: Windows E2E — PowerShell copy for cp_bmi, USERPROFILE fallback, tag fixes
- cp_bmi rule: use PowerShell Copy-Item instead of cmd /c copy (handles forward-slash paths from ninja correctly) - _inherit_toolchain.sh: try USERPROFILE when HOME/.mcpp doesn't exist - 38_self_config_mirror: tag unix-shell (xlings mirror broken on Windows) - Remove continue-on-error from E2E (real failures should block CI)
1 parent c4a9d51 commit 23fa1db

4 files changed

Lines changed: 8 additions & 3 deletions

File tree

.github/workflows/ci-windows.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ jobs:
9999
# Enable once available.
100100

101101
- name: E2E suite
102-
continue-on-error: true
103102
shell: bash
104103
run: |
105104
export MCPP="$MCPP_SELF"

src/build/ninja_backend.cppm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,9 @@ std::string emit_ninja_string(const BuildPlan& plan) {
198198

199199
append("rule cp_bmi\n");
200200
#if defined(_WIN32)
201-
append(" command = cmd /c copy /y $in $out >nul\n");
201+
// Use PowerShell Copy-Item which handles both forward and back slashes.
202+
// cmd.exe `copy` breaks on forward-slash paths from ninja.
203+
append(" command = powershell -NoProfile -Command \"Copy-Item -Force '$in' -Destination '$out'\"\n");
202204
#else
203205
append(" command = mkdir -p $$(dirname $out) && cp -f $in $out\n");
204206
#endif

tests/e2e/38_self_config_mirror.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:
2+
# requires: unix-shell
33
# 38_self_config_mirror.sh — configure xlings mirror through mcpp self config.
44
set -e
55

tests/e2e/_inherit_toolchain.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ if [[ -z "${MCPP_HOME:-}" ]]; then
1313
fi
1414
mkdir -p "$MCPP_HOME"
1515

16+
# On Windows, HOME may differ from USERPROFILE; try both
1617
USER_MCPP="${HOME}/.mcpp"
18+
if [[ ! -d "$USER_MCPP" && -n "${USERPROFILE:-}" ]]; then
19+
USER_MCPP="$USERPROFILE/.mcpp"
20+
fi
1721
if [[ -d "$USER_MCPP/registry/data/xpkgs" ]]; then
1822
mkdir -p "$MCPP_HOME/registry/data"
1923
[[ -e "$MCPP_HOME/registry/data/xpkgs" ]] \

0 commit comments

Comments
 (0)