You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is not directly a rules_rust issue but more of a general Bazel/rustc/proc-macro2 issue. I'm logging it here because this is the first place I came looking. I created a ticket on the proc-macro2 repo though maybe there's something rules_rust can do to avoid the issue more generally.
I noticed that the proc-macro2 build was not deterministic. Building it several times would result in new content every time:
$ for i in $(seq 0 5); do bazel clean && bazel build @crate_index//:proc-macro2 && find bazel-bin/external/crate_index__proc-macro2-1.0.88 -type f -print0 | xargs -0 sha256sum | sha256sum ; done 2>/dev/null
9e4380b3a8f8b21f99ec019d8ec82b194d8a6cc0a41f1bcba2ecd709ff071766 -
85f879d65c675c15ae39eab6433bd84ee6a165b975b9816e2306a2180ddbbd10 -
b1deb8640941ef39dc56d306d2f768c90980b9f3e59644215a2711c44954c04f -
6a7135a57407b71d0cb0a9582e3d5255e5f1f2c2cfd3a64e340d598bdf43f702 -
36a738c2f0d7c37270cd2590d37a4813d19d249f288f210ea203752803fd9378 -
bfca95a91fe8c64212a8527e212aa16832b342d0ca0f26fbfb48e2698af22b5f -
This issue is actually caused by the proc-macro2 build script dep-info file which includes absolute paths of the build directory, which is a runner-specific (and invocation-specific) directory path (see the proc-macro2 ticket for more info):
Cargo allows remapping the paths in the dep-info files but this doesn't work in this case (see the proc-macro2 ticket for more info). A hacky workaround is to patch rules_rust:
This is not directly a
rules_rust
issue but more of a general Bazel/rustc/proc-macro2 issue. I'm logging it here because this is the first place I came looking. I created a ticket on the proc-macro2 repo though maybe there's somethingrules_rust
can do to avoid the issue more generally.I noticed that the
proc-macro2
build was not deterministic. Building it several times would result in new content every time:This issue is actually caused by the
proc-macro2
build script dep-info file which includes absolute paths of the build directory, which is a runner-specific (and invocation-specific) directory path (see the proc-macro2 ticket for more info):Cargo allows remapping the paths in the dep-info files but this doesn't work in this case (see the proc-macro2 ticket for more info). A hacky workaround is to patch
rules_rust
:Is there a way to generally solve this issue? And is there a cleaner workaround?
The text was updated successfully, but these errors were encountered: