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

build-rust-crate: ensure info about build.rs failures reaches the log #190592

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion pkgs/build-support/rust/build-rust-crate/configure-crate.nix
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,10 @@ in ''
export CARGO_FEATURE_$feature=1
done

target/build/${crateName}/build_script_build > target/build/${crateName}.opt
# build script failures are reported to stdout rather than stderr, so we
# use tee here instead of > to ensure that `nix log` contains useful
# information when a failure occurs
target/build/${crateName}/build_script_build | tee target/build/${crateName}.opt
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this script snippet run with "set -o pipefail"? If it isn't, then the pipe will suppress failures.

Copy link
Author

Choose a reason for hiding this comment

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

Thank you for noticing that. How embarrassing. What I wrote would have silently omitted features when the build script fails.

)

set +e
Expand Down