-
-
Notifications
You must be signed in to change notification settings - Fork 644
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
only emit a mkdir
into remote execution wrapper for non-empty paths
#21753
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
Is there a sensible way to write a test here, to avoid regressing? (Either of this specific rust code or of the "overall" codepath that caused this)
The wrapper script is already written by a function. Probably makes sense to create a directory and just literally run that script in the directory? |
Added a basic test of the wrapper script, which executes the wrapper script in a temporary directory and verified that the cache directory and sandbox symlink are created. |
I tried to automatically cherry-pick this change back to each relevant milestone, so that it is available in those older releases of Pants. ✔️ 2.24.xSuccessfully opened #21760. Thanks again for your contributions! |
… (Cherry-pick of #21753) (#21760) As reported in #21747, the remote execution wrapper used to set up append-only cache directories was trying to create an empty path as a directory. This occurred because `Path::parent` returns an empty string (`Some("")`) if the path was not absolute (i.e., the "root" was not `""` and not `"/"`). Solution: Check for that condition and do not emit the `mkdir` in that case. Co-authored-by: Tom Dyas <tom@shoalsoftware.com>
As reported in #21747, the remote execution wrapper used to set up append-only cache directories was trying to create an empty path as a directory. This occurred because
Path::parent
returns an empty string (Some("")
) if the path was not absolute (i.e., the "root" was not""
and not"/"
).Solution: Check for that condition and do not emit the
mkdir
in that case.