Commit 445df7e
fix(config-dir): Resolve relative
fix(config-dir): resolve relative TURBO_CONFIG_DIR_PATH before
validation
Fixes issue **#8645**
### Summary
This PR fixes a bug where setting `TURBO_CONFIG_DIR_PATH` to a
*relative* path
(e.g., `"configs"`) caused Turborepo to fail with:
PathError::NotAbsolute("configs")
`AbsoluteSystemPathBuf::new()` only accepts absolute paths, but the
value from
the environment variable was passed directly without being resolved.
This caused a startup failure even though the provided path was valid.
### Root Cause
When a user sets: TURBO_CONFIG_DIR_PATH="configs"
Turborepo attempted to validate `"configs"` as an absolute path.
Since it is relative, the validator rejected it, causing Turborepo to
stop early.
### What This PR Changes
- Detects whether the provided `TURBO_CONFIG_DIR_PATH` is **relative**
- If relative, resolves it against the current working directory:
```rust
std::env::current_dir()?.join(raw)
Converts the resolved path to UTF-8
Passes the resulting absolute path into AbsoluteSystemPathBuf::new()
Leaves absolute paths fully unchanged
Introduces zero breaking changes
Why This Fix Is Safe
- Relative → absolute resolution is deterministic and standard practice
- Absolute paths behave exactly the same as before
- Error surface area decreases (fewer startup failures)
- The change is minimal, well-scoped, and consistent with existing path
logic
- No impact on users who do not set the environment variable
---------
Co-authored-by: Anthony Shew <[email protected]>
Co-authored-by: Anthony Shew <[email protected]>TURBO_CONFIG_DIR_PATH before validation (#11122)1 parent 5e1e566 commit 445df7e
1 file changed
+29
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
17 | 33 | | |
18 | 34 | | |
19 | 35 | | |
| |||
28 | 44 | | |
29 | 45 | | |
30 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
31 | 52 | | |
32 | 53 | | |
33 | 54 | | |
| |||
73 | 94 | | |
74 | 95 | | |
75 | 96 | | |
76 | | - | |
77 | | - | |
| 97 | + | |
| 98 | + | |
78 | 99 | | |
79 | 100 | | |
80 | 101 | | |
81 | 102 | | |
82 | 103 | | |
83 | | - | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
84 | 109 | | |
85 | 110 | | |
86 | 111 | | |
| |||
0 commit comments