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

bazel run @cargo_raze//:raze depends on --legacy_external_runfiles #460

Open
bcmyers opened this issue Dec 17, 2021 · 0 comments
Open

bazel run @cargo_raze//:raze depends on --legacy_external_runfiles #460

bcmyers opened this issue Dec 17, 2021 · 0 comments

Comments

@bcmyers
Copy link

bcmyers commented Dec 17, 2021

Building and running cargo raze directly with bazel like so

bazel run @cargo_raze//:raze -- --manifest-path=$(realpath ./Cargo.toml)

appears to depend on the --legacy_external_runfiles bazel flag being set to True.

Folks who have this turned off in their .bazelrc like so

# .bazelrc
build --nolegacy_external_runfiles

experience this not very nice error message.

Error: Failed to fetch metadata for <redacted>

Caused by:
    0: Failed to fetch Metadata with `/private/var/tmp/_bazel_<redacted>/d210ebc49a702eac7c9a702b90525dba/execroot/rh/bazel-out/darwin-fastbuild/bin/external/cargo_raze/tools/raze.runfiles/rh/external/rust_darwin_x86_64/bin/cargo` from `<redacted>`
    1: failed to start `cargo metadata`: No such file or directory (os error 2)
    2: No such file or directory (os error 2)
error: Recipe `build` failed on line 7 with exit code 1

You can get around this by running the following command instead.

bazel run --legacy_external_runfiles @cargo_raze//:raze -- --manifest-path=$(realpath ./Cargo.toml)

But this is not well documented.

So two questions:

  • Is it worth adding information about this in the documentation?
  • Is it worth modifying the code so that building/running cargo raze directly with bazel does not rely on --legacy_external_runfiles?

Bazel version: 4.2.0
Cargo raze version: 0.14.0
Rules Rust version: c0bdb55ec101133a051bfcf13ff3295f60055739

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

No branches or pull requests

1 participant