-
Notifications
You must be signed in to change notification settings - Fork 13k
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
tests: Port jobserver-error
to rmake.rs
#135461
base: master
Are you sure you want to change the base?
Conversation
This comment was marked as off-topic.
This comment was marked as off-topic.
…=<try> tests: Port `jobserver-error.rs` to rmake.rs Part of rust-lang#121876. This PR ports `jobserver-error.rs` to rmake.rs, and is basically rust-lang#128789 slightly adjusted. Namely, `set_aux_fd` is made `unsafe`, alongside some doc updates. The complexity involved here is mostly how to get `/dev/null/` piping to fd 3 working with std `Command`, whereas with a shell this is much easier (as is evident with the `Makefile` version). Supersedes rust-lang#128789. This PR is co-authored with `@Oneirical` and `@coolreader18.` r? `@ghost` try-job: aarch64-gnu try-job: i686-gnu-1 try-job: x86_64-gnu-debug try-job: x86_64-gnu-llvm-18-1
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
jobserver-error.rs
to rmake.rsjobserver-error
to rmake.rs
@bors try |
…=<try> tests: Port `jobserver-error` to rmake.rs Part of rust-lang#121876. This PR ports `tests/run-make/jobserver-error` to rmake.rs, and is basically rust-lang#128789 slightly adjusted. Namely, `set_aux_fd` is made `unsafe`, alongside some doc updates. The complexity involved here is mostly how to get `/dev/null/` piping to fd 3 working with std `Command`, whereas with a shell this is much easier (as is evident with the `Makefile` version). Supersedes rust-lang#128789. This PR is co-authored with `@Oneirical` and `@coolreader18.` r? `@ghost` try-job: aarch64-gnu try-job: i686-gnu-1 try-job: x86_64-gnu-debug try-job: x86_64-gnu-llvm-18-1
☀️ Try build successful - checks-actions |
r? compiler |
Co-authored-by: Noa <coolreader18@gmail.com> Co-authored-by: Oneirical <manchot@videotron.ca>
Co-authored-by: Noa <coolreader18@gmail.com> Co-authored-by: Oneirical <manchot@videotron.ca>
aaddf77
to
8c41872
Compare
fn main() { | ||
let out = rustc() | ||
.stdin_buf(("fn main() {}").as_bytes()) | ||
.env("MAKEFLAGS", "--jobserver-auth=5,5") |
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.
.env("MAKEFLAGS", "--jobserver-auth=5,5") | |
.env("MAKEFLAGS", "--jobserver-auth=1000,1000") |
use some higher FDs to guard against rustc using more fds initially
// The `pre_exec` function should be unconditionally set, since it captures `fd`, and | ||
// this ensures that it stays open until the fork. |
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.
Wouldn't it still be closed once pre_exec returns? I think you need to mem::forget
it explicitly.
Personally I would put fd
in a ManuallyDrop
at the beginning of the function and only work with its RawFd
from that point on, that seems less prone to mistakes.
Part of #121876.
This PR ports
tests/run-make/jobserver-error
to rmake.rs, and is basically #128789 slightly adjusted. Namely,set_aux_fd
is madeunsafe
, alongside some doc updates.The complexity involved here is mostly how to get
/dev/null/
piping to fd 3 working with stdCommand
, whereas with a shell this is much easier (as is evident with theMakefile
version).Supersedes #128789.
This PR is co-authored with @Oneirical and @coolreader18.
try-job: aarch64-gnu
try-job: i686-gnu-1
try-job: x86_64-gnu-debug
try-job: x86_64-gnu-llvm-18-1