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
Summary: I think that the environment variable, CARGO_MANIFEST_DIR, might be set to a wrong value.
Depending on the latest wasm-bindgen leads to a failing build. The problem seems to be that CARGO_MANIFEST_DIR does not point to a directory.
I verified by modifying the build.rs and listing the contents of CARGO_MANIFEST_DIR – I'm greeted by ENOENT.
The value of CARGO_MANIFEST_DIR is : home/myuser/.cache/bazel/_bazel_myuser/016369211d582554423d7c843e54e025/sandbox/linux-sandbox/213/execroot/reponame/third_party/cargo/vendor/wasm-bindgen-shared-0.2.74
The working directory when executing that build.rs is: /home/myuser/.cache/bazel/_bazel_myuser/016369211d582554423d7c843e54e025/sandbox/linux-sandbox/226/execroot/reponame/bazel-out/k8-opt-exec-2B5CBBC6/bin/third_party/cargo/vendor/wasm-bindgen-shared-0.2.74/wasm_bindgen_shared_build_script_script_.runfiles/monor/third_party/cargo/vendor/wasm-bindgen-shared-0.2.74
The Cargo documentation on environment variables in build scripts was recently updated to make it clear that you need to use std::env::var* and not env! to access these environment variables in build scripts, and you need to use env! and not std::env::var* to access these environment variables outside build scripts. Further, the build script documentation says:
In addition to environment variables, the build script’s current directory is the source directory of the build script’s package.
So, your proposed change is correct. If you changed that code to use std::env::var_os("CARGO_MANIFEST_DIR") instead of env! then I would expect it to also be correct.
Summary: I think that the environment variable, CARGO_MANIFEST_DIR, might be set to a wrong value.
Depending on the latest wasm-bindgen leads to a failing build. The problem seems to be that
CARGO_MANIFEST_DIR
does not point to a directory.I verified by modifying the
build.rs
and listing the contents ofCARGO_MANIFEST_DIR
– I'm greeted by ENOENT.The value of CARGO_MANIFEST_DIR is :
home/myuser/.cache/bazel/_bazel_myuser/016369211d582554423d7c843e54e025/sandbox/linux-sandbox/213/execroot/reponame/third_party/cargo/vendor/wasm-bindgen-shared-0.2.74
The working directory when executing that
build.rs
is:/home/myuser/.cache/bazel/_bazel_myuser/016369211d582554423d7c843e54e025/sandbox/linux-sandbox/226/execroot/reponame/bazel-out/k8-opt-exec-2B5CBBC6/bin/third_party/cargo/vendor/wasm-bindgen-shared-0.2.74/wasm_bindgen_shared_build_script_script_.runfiles/monor/third_party/cargo/vendor/wasm-bindgen-shared-0.2.74
I can get the build to succeed when changing the
build.rs
this way.Can you confirm or refute that it's working as intended?
Thank you!
The text was updated successfully, but these errors were encountered: