Commit adfb68d
committed
fix: Normalize relative paths to canonical form for CMake compatibility
CMake and some build tools prefer canonical relative paths like
'../dir/file' over equivalent but non-canonical forms like 'dir/../file'.
The pathdiff crate can generate non-canonical paths when calculating
relative paths between directories. This commit adds lexical path
normalization by processing path components: when we encounter a
ParentDir (..) component, we pop the previous component instead of
keeping both.
Example transformation:
- Before: cpp/../generated/file.cpp
- After: ../cpp/generated/file.cpp
This ensures better compatibility with CMake and other build tools
that may not handle non-canonical paths correctly.
Discovered while testing the RustBuffer 32-bit ARM fix on Android.1 parent 2bfdedd commit adfb68d
1 file changed
+30
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
30 | 59 | | |
31 | 60 | | |
32 | 61 | | |
| |||
0 commit comments