Add set no-cd and align path resolution#2981
Conversation
6621758 to
1a911bb
Compare
1a911bb to
6423262
Compare
casey
left a comment
There was a problem hiding this comment.
Thanks for the PR!
This mostly looks good, but I would remove set no-cd-strict from this PR and leave it for later, to make it simpler.
|
Would love to see this make it in. @hans-d I can offer a patch to resolve the changes Casey needs on this PR if you'd like. To clarify about removing Thanks, all! |
6423262 to
3bcfbbf
Compare
|
this update is bringing the pr up to match master, and to have all test run locally. re the no-cd-strict, it's similar to the no-cd but applied more strictly for certain functions (see linked issues). Added as it's new/changed behaviour compared to the original of no-cd. will spilt the no-cd-strict into a new pr. |
3bcfbbf to
35b9e86
Compare
casey
left a comment
There was a problem hiding this comment.
This seems mostly okay, but I'm not sure why ExecutionContext::working_directory is changing, see comment.
| pub(crate) fn working_directory(&self) -> PathBuf { | ||
| let base = if self.module.is_submodule() { | ||
| &self.module.working_directory | ||
| self |
There was a problem hiding this comment.
I'm not sure I understand why this function is changing.
There was a problem hiding this comment.
Likely lingering from teh previous bigger change. Reverted it and spotted a few other things that needed tightening.
Summary
Feature: Add module-local set no-cd to skip automatic cd before recipes/backticks; mutually exclusive with set working-directory; recipe attributes still override.
Opt-in behavior: Add set no-cd-strict so when no-cd is on, backticks/shell/path helpers resolve relative to the invocation directory instead of the module dir. Default remains the old behavior for compatibility.
[no-cd] for entire submodule file #2754[no-cd]attribute doesn't respect theworking-directoryof dependents #2940 (partially?)