-
Notifications
You must be signed in to change notification settings - Fork 42
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
Fix Client::configure*
on unix
#100
Conversation
Ok(unsafe { len.assume_init() } as usize) | ||
} | ||
|
||
pub fn configure(&self, cmd: &mut Command) { | ||
match self { | ||
if matches!(self.creation_arg, ClientCreationArg::Fifo { .. }) { |
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.
Now that we are passing the fds specified in the environment, and we always clone the fds before using them or setting cloexec, I suppose we could remove this function completely? cc @the8472
This should improve the performance dramatically on platform with vfork
available.
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 should happen in a separate PR since we need to consider both the environment and the file descriptors together, basically #64 but also the role of client.configure
. It'd be a breaking change of that API. Right now the docs say that only children built with this method should inherit the jobserver.
The goal of this PR is to fix the fd to fifo conversion and I think it's already big enough for that.
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.
Got it thanks
This also needs a regression test. Apparently nothing ensured that when inheriting a configuration from the parent we pass it through properly to a child. |
cc @the8472 Updated, added regression test as suggested. |
rust-lang#100 Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Fix `Client::configure*` on unix rust-lang#100 Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com> * Fix linux compilation Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com> --------- Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
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 for the fix. Could we fix up some commits?
Also, I'd prefer presenting the regression test first in a commit, followed by the other commits actually fix the behavior and tests. That would make the first commit a minimal reproduction and we know we're fixing the right thing.
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.
Functionally it seems fine to me now. I think it could use a few more comments here and there.
That might be a bit hard since I wrote after fixing it |
So that setting `O_NONBLOCK` would not affect other. Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
@weihanglo I squashed the commits, can't get the regression test commit to be the first, but it's much smaller now. |
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.
Typos. Otherwise LGTM
Co-authored-by: Weihang Lo <weihanglo@users.noreply.github.com> Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Would appreciate if you have time publishing this :) (We should probably revisit #89 and rust-lang/infra-team#117) |
Fixed #99