-
Notifications
You must be signed in to change notification settings - Fork 402
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cargo_build_script now only prints warnings to stderr. (#548)
## Overview This prevents noisy output from `cargo_build_script` from being printed to the terminal, instead two log files are generated (`stdout`, `stderr`) which contain the raw output of the underlying `build.rs` script ## Details Currently users see something similar to the following output when they use `cargo_build_script`: (note, uplaoded as a file because there's a lot of output) [big_output.log](https://github.com/bazelbuild/rules_rust/files/5777780/big_output.log) In general, this masks important information in a sea of arbitrary log lines. The changes in this PR update the output to: ```output INFO: From CargoBuildScriptRun external/cargo_raze__libssh2_sys__0_2_20/libssh2_sys_build_script.out_dir: Build Script Warning: libssh2/src/bcrypt_pbkdf.c:84:46: warning: expression does not compute the number of elements in this array; element type is 'uint32_t' (aka 'unsigned int'), not 'uint64_t' (aka 'unsigned long long') [-Wsizeof-array-div] Build Script Warning: blf_enc(&state, cdata, sizeof(cdata) / sizeof(uint64_t)); Build Script Warning: ~~~~~ ^ Build Script Warning: libssh2/src/bcrypt_pbkdf.c:65:14: note: array 'cdata' declared here Build Script Warning: uint32_t cdata[BCRYPT_BLOCKS]; Build Script Warning: ^ Build Script Warning: libssh2/src/bcrypt_pbkdf.c:84:46: note: place parentheses around the 'sizeof(uint64_t)' expression to silence this warning Build Script Warning: blf_enc(&state, cdata, sizeof(cdata) / sizeof(uint64_t)); Build Script Warning: ^ Build Script Warning: 1 warning generated. ``` And log files are generated for the raw stderr and stdout from the build script, ie: ```output bazel-out/darwin-fastbuild/bin/external/cargo_raze__libssh2_sys__0_2_20/libssh2_sys_build_script.stderr.log bazel-out/darwin-fastbuild/bin/external/cargo_raze__libssh2_sys__0_2_20/libssh2_sys_build_script.stdout.log ``` (note, uplaoded as a file because there's a lot of output) [libssh2_sys_build_script.stderr.log](https://github.com/bazelbuild/rules_rust/files/5777782/libssh2_sys_build_script.stderr.log) Additionally, the `deps` attribute of `cargo_build_script` now only accepts targets that return the `DepInfo` provider. All other dependencies should be passed via `data`.
- Loading branch information
1 parent
9a30c07
commit 8c388e1
Showing
3 changed files
with
75 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters