Skip to content

Doc: update outdated parameter output_diagnostics #2813

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

Merged
merged 1 commit into from
Sep 3, 2024

Conversation

LiXuanqi
Copy link
Contributor

@LiXuanqi LiXuanqi commented Aug 27, 2024

Problem

Tracking Issue: #2814
The command in doc looks outdated and I'm getting

❯ bazel build --@rules_rust//:output_diagnostics=true --output_groups=+rust_lib_rustc_output,+rust_metadata_rustc_output //hellow_world
WARNING: Target pattern parsing failed.
ERROR: Skipping '@rules_rust//:output_diagnostics': no such target '@@rules_rust~//:output_diagnostics': target 'output_diagnostics' not declared in package '' defined by /private/var/tmp/_bazel_xxx/c947415ff64a19538545e009b2e6df63/external/rules_rust~/BUILD.bazel
ERROR: @rules_rust//:output_diagnostics :: Error loading option @rules_rust//:output_diagnostics: no such target '@@rules_rust~//:output_diagnostics': target 'output_diagnostics' not declared in package '' defined by /private/var/tmp/_bazel_xxx/c947415ff64a19538545e009b2e6df63/external/rules_rust~/BUILD.bazel

After checking the code

rustc_output_diagnostics(
, I feel it should be rustc_output_diagnostics

Test

bazel build --@rules_rust//:rustc_output_diagnostics=true --output_groups=+rust_lib_rustc_output,+rust_metadata_rustc_output //hello_world
INFO: Analyzed target //hello_world:hello_world (2 packages loaded, 1443 targets configured).
ERROR: /Users/xxx/dev/bazel-rust-example/hello_world/BUILD:3:12: Compiling Rust bin hello_world (1 files) failed: (Exit 1): process_wrapper failed: error executing Rustc command (from target //hello_world:hello_world) bazel-out/darwin_arm64-opt-exec-ST-d57f47055a04/bin/external/rules_rust~/util/process_wrapper/process_wrapper --subst 'pwd=${pwd}' --rustc-output-format rendered --output-file ... (remaining 27 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
error[E0423]: expected function, found macro `println`
 --> hello_world/src/main.rs:2:5
  |
2 |     println("Hello, world!");
  |     ^^^^^^^ not a function
  |
help: use `!` to invoke the macro
  |
2 |     println!("Hello, world!");
  |            +

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0423`.
Target //hello_world:hello_world failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 0.322s, Critical Path: 0.06s
INFO: 4 processes: 4 internal.
ERROR: Build did NOT complete successfully

@Danielkonge
Copy link

If you are updating this anyways, I think there are two other mistakes:
From what I can tell it should be rustc_output_diagnostics, rustc_rmeta_output and rustc_output but the docs say output_diagnostics, rust_lib_rustc_output and rust_metadata_rustc_output.

(I mentioned this in #2799 too.)

Copy link
Collaborator

@illicitonion illicitonion left a comment

Choose a reason for hiding this comment

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

Thank you!

@illicitonion illicitonion added this pull request to the merge queue Sep 3, 2024
Merged via the queue into bazelbuild:main with commit 99f421e Sep 3, 2024
3 checks passed
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.

3 participants