-
-
Notifications
You must be signed in to change notification settings - Fork 652
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
populate parent directories of process outputs locally to match remote execution api #7133
populate parent directories of process outputs locally to match remote execution api #7133
Conversation
829069d
to
b3d81b9
Compare
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.
You should be able to test this in the test module lower down in this file, by trying to run something like:
touch foo/bar
and seeing that it succeeds because foo
exists (whereas before this change, it would fail because file not found)
Thanks! I have done so in 2ab4633, wasn't thinking too hard last night. Also had to fix a couple other tests with now-unnecessary |
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.
Thanks! One small restructure and I think we're good to go :)
I'm not sure how this relates to #7048. Did you mean a different issue number in the problem section? |
Thanks, changed to #7084! Typical 2am hack sesh... |
@illicitonion Sorry, could you describe the restructure necessary? I can't seem to find it in the PR comments, my eyes could be missing something. |
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.
Ugh, github dropped my comment somehow :(
// create_dir_all() will ensure all parents are created. At that point, we might consider | ||
// explicitly enumerating all the directories to be created and just using create_dir(), | ||
// unless there is some optimization in create_dir_all() that makes that less efficient. | ||
.collect::<HashSet<_>>() |
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.
I think this would be more clear as:
let parent_paths_to_create: HashSet<_> = stuff.collect();
for path in parent_paths_to_create {
create_dir_all(&path).map_err(...)?;
}
Ok(())
rather than using a chain of two iter-collect pairs.
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.
github lost my reply somehow! I wanted to say thank you because as much as I love .collect()
this is significantly easier to write and read and I wasn't really remembering the utility of ?
!
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.
LGTM - thanks!
Problem
Resolves #7084.
Solution
straightforward
Result
We now match this corner of the remote execution API in local process executions in the v2 engine.