Commit 2ccd076
authored
fix(cli): normalize workspace path to forward slashes for CMake templates (#3040)
* fix(cli): normalize workspace path to forward slashes for CMake templates
workspace_dir() returned a raw Windows path (backslash-separated),
which gets substituted verbatim into __DORA_PATH__ in the generated
CMakeLists.txt for --lang c/cxx --internal-create-with-path-dependencies.
CMake treats backslash as a string escape character, so cmake -B
failed immediately with 'Invalid character escape' before any
compiler logic ran. Normalize to forward slashes, which both CMake
and Windows accept.
Also box the large Cached variant of CachedResult in the coordinator
(pre-existing clippy::large_enum_variant failure surfaced while
running clippy locally, related to #2979).
* fix: address review feedback - drop unrelated coordinator change, use OS-independent test
The CachedResult::Cached boxing fix duplicated the already-open PR #3001,
so it's dropped here to avoid merge conflicts (per 'don't fix unrelated
warnings in PRs' convention).
The regression test now asserts against a hardcoded Windows-style sample
path instead of the live workspace_dir() output, since on Linux/macOS CI
the real path never contains a backslash and the old assertion passed
trivially without exercising the normalization logic.1 parent 4402584 commit 2ccd076
3 files changed
Lines changed: 31 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
| 83 | + | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | | - | |
| 139 | + | |
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
| 82 | + | |
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
135 | | - | |
| 135 | + | |
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
| 12 | + | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
20 | 44 | | |
21 | 45 | | |
22 | 46 | | |
| |||
0 commit comments