commit | 8c388e1b816d0a7e5a7d3cc5d213be7f35299cf5 | [log] [tgz] |
---|---|---|
author | UebelAndre <andre.brisco@gmail.com> | Mon Jan 18 03:53:12 2021 -0800 |
committer | GitHub <noreply@github.com> | Mon Jan 18 12:53:12 2021 +0100 |
tree | 921249494490e6ed6661d473af11b073b7c4dd22 | |
parent | 9a30c07999a1f41f8775aadffe963fc58bd6d3f5 [diff] |
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`.
This repository provides rules for building Rust projects with Bazel.
Please refer to the full documentation.