Skip to content
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

Restore basic functionality of the C++ process wrapper #1728

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

scentini
Copy link
Collaborator

@scentini scentini commented Dec 23, 2022

Fixes #1530

The process wrapper, among other things, takes care of passing--remap-path-prefix=$PWD= with the correct $PWD value for the Rust compilation actions. The process wrapper is a Rust binary itself, and currently there is nothing to take care of passing --remap-path-prefix when it is being built, which results in nondeterministic process wrapper build. This PR provides a solution for the issue, by building the process wrapper and its dependencies via a minimal C++ process wrapper (which I resurrected from before d9ba374).

We could once again remove the C++ process wrapper once remap-cwd-prefix is stabilized (rust-lang/rust#89434).

Copy link
Collaborator

@UebelAndre UebelAndre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor cleanup

util/process_wrapper/system_windows.cc Outdated Show resolved Hide resolved
util/process_wrapper/BUILD.bazel Outdated Show resolved Hide resolved
util/process_wrapper/BUILD.bazel Outdated Show resolved Hide resolved
rust/private/rust.bzl Outdated Show resolved Hide resolved
@UebelAndre
Copy link
Collaborator

I did not see #1530 (comment). Sorry for the delay, continuing the thread here. I get consistent results running build->clean->build but I tried doing this in two different checkouts of the same commit and ended up with different results. Which makes me think the remapping flag is actually just not working?

0014fd20: 722f 746d 702f 5f62 617a 656c 5f61 6e64  r/tmp/_bazel_aaa
0014fd30: 7265 6272 6973 636f 2f34 3033 6231 6537  aaaaaaaa/403b1e7
0014fd40: 3037 3666 3861 3865 3932 3739 3334 6630  076f8a8e927934f0
0014fd50: 6137 3039 3135 3930 382f 6578 7465 726e  a70915908/extern
0014fd60: 616c 2f72 7573 745f 6461 7277 696e 5f61  al/rust_darwin_a
0014fd70: 6172 6368 3634 5f5f 6161 7263 6836 342d  arch64__aarch64-
0014fd80: 6170 706c 652d 6461 7277 696e 5f5f 7374  apple-darwin__st
0014fd90: 6162 6c65 5f74 6f6f 6c73 2f6c 6962 2f72  able_tools/lib/r
0014fda0: 7573 746c 6962 2f61 6172 6368 3634 2d61  ustlib/aarch64-a
0014fdb0: 7070 6c65 2d64 6172 7769 6e2f 6c69 622f  pple-darwin/lib/
0014fdc0: 6c69 626c 6962 632d 6334 3639 6264 3437  liblibc-c469bd47
0014fdd0: 6333 3535 3062 3163 2e72 6c69 6228 6c69  c3550b1c.rlib(li
0014fde0: 6263 2d63 3436 3962 6434 3763 3335 3530  bc-c469bd47c3550
0014fdf0: 6231 632e 6c69 6263 2e39 3537 3937 3361  b1c.libc.957973a
0014fe00: 332d 6367 752e 302e 7263 6775 2e6f 2900  3-cgu.0.rcgu.o).
0014fe10: 5f5f 5a4e 346c 6962 6334 756e 6978 3362  __ZN4libc4unix3b
0014fe20: 7364 3561 7070 6c65 3973 6967 696e 666f  sd5apple9siginfo
0014fe30: 5f74 3773 695f 6164 6472 3137 6834 6361  _t7si_addr17h4ca
0014fe40: 3164 3666 6633 3737 6564 6566 6245 0073  1d6ff377edefbE.s
0014fe50: 7263 2f75 6e69 782f 6273 642f 6170 706c  rc/unix/bsd/appl
0014fe60: 652f 6d6f 642e 7273 002f 7275 7374 632f  e/mod.rs./rustc/
0014fe70: 3930 6335 3431 3830 3666 3233 6131 3237  90c541806f23a127
0014fe80: 3030 3264 6535 6234 3033 3862 6537 3331  002de5b4038be731
0014fe90: 6261 3134 3538 6361 2f6c 6962 7261 7279  ba1458ca/library
0014fea0: 2f61 6c6c 6f63 2f73 7263 2f6c 6962 2e72  /alloc/src/lib.r
0014feb0: 732f 402f 0061 6c6c 6f63 2e63 3831 6434  s/@/.alloc.c81d4
0014fec0: 3166 332d 6367 752e 3000 2f70 7269 7661  1f3-cgu.0./priva
0014fed0: 7465 2f76 6172 2f74 6d70 2f5f 6261 7a65  te/var/tmp/_baze
0014fee0: 6c5f 616e 6472 6562 7269 7363 6f2f 3430  l_aaaaaaaaaaa/40
0014fef0: 3362 3165 3730 3736 6638 6138 6539 3237  3b1e7076f8a8e927
0014ff00: 3933 3466 3061 3730 3931 3539 3038 2f65  934f0a70915908/e
0014ff10: 7874 6572 6e61 6c2f 7275 7374 5f64 6172  xternal/rust_dar
0014ff20: 7769 6e5f 6161 7263 6836 345f 5f61 6172  win_aarch64__aar
0014ff30: 6368 3634 2d61 7070 6c65 2d64 6172 7769  ch64-apple-darwi
0014ff40: 6e5f 5f73 7461 626c 655f 746f 6f6c 732f  n__stable_tools/
0014ff50: 6c69 622f 7275 7374 6c69 622f 6161 7263  lib/rustlib/aarc
0014ff60: 6836 342d 6170 706c 652d 6461 7277 696e  h64-apple-darwin
0014ff70: 2f6c 6962 2f6c 6962 616c 6c6f 632d 6164  /lib/liballoc-ad
0014ff80: 3165 6562 3136 6235 3030 3634 3135 2e72  1eeb16b5006415.r
0014ff90: 6c69 6228 616c 6c6f 632d 6164 3165 6562  lib(alloc-ad1eeb
0014ffa0: 3136 6235 3030 3634 3135 2e61 6c6c 6f63  16b5006415.alloc
0014ffb0: 2e63 3831 6434 3166 332d 6367 752e 302e  .c81d41f3-cgu.0.
0014ffc0: 7263 6775 2e6f 2900 5f5f 5a4e 3432 5f24  rcgu.o).__ZN42_$

Note things around var/tmp/_baze. I think this is a pretty big issue so will be trying dedicate any time I can get to it but could definitely use assistance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MacOS host paths being written into binaries
2 participants