-
-
Notifications
You must be signed in to change notification settings - Fork 758
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
Ensure beginning and end of the error output is readable #2284
Merged
Conversation
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
kornelski
force-pushed
the
cargo-warnings
branch
2 times, most recently
from
August 28, 2024 14:02
a8f26b8
to
b4df3c5
Compare
Do you have an example of a before-and-after of what this looks like? |
kornelski
force-pushed
the
cargo-warnings
branch
from
September 8, 2024 15:20
b4df3c5
to
eeb920f
Compare
+The following warnings were emitted during compilation:
+
+warning: openssl-sys@0.9.103: Could not find directory of OpenSSL installation, and this `-sys` crate cannot proceed without this knowledge. If OpenSSL is installed and this crate had trouble finding it, you can set the `OPENSSL_DIR` environment variable for the compilation process. See stderr section below for further information.
+
error: failed to run custom build command for `openssl-sys v0.9.103 (~/rust-openssl/openssl-sys)`
note: To improve backtraces for build dependencies, set the CARGO_PROFILE_DEV_BUILD_OVERRIDE_DEBUG=true environment variable to enable debug information generation.
Caused by:
process didn't exit successfully: `~/rust-openssl/target/debug/build/openssl-sys-fc33f8dce2cb8a74/build-script-main` (exit status: 101)
--- stdout
cargo:rustc-check-cfg=cfg(osslconf, values("OPENSSL_NO_OCB", "OPENSSL_NO_SM4", "OPENSSL_NO_SEED", "OPENSSL_NO_CHACHA", "OPENSSL_NO_CAST", "OPENSSL_NO_IDEA", "OPENSSL_NO_CAMELLIA", "OPENSSL_NO_RC4", "OPENSSL_NO_BF", "OPENSSL_NO_PSK", "OPENSSL_NO_DEPRECATED_3_0", "OPENSSL_NO_SCRYPT", "OPENSSL_NO_SM3", "OPENSSL_NO_RMD160", "OPENSSL_NO_EC2M", "OPENSSL_NO_OCSP", "OPENSSL_NO_CMS", "OPENSSL_NO_COMP", "OPENSSL_NO_SOCK", "OPENSSL_NO_STDIO", "OPENSSL_NO_EC", "OPENSSL_NO_SSL3_METHOD", "OPENSSL_NO_KRB5", "OPENSSL_NO_TLSEXT", "OPENSSL_NO_SRP", "OPENSSL_NO_RFC3779", "OPENSSL_NO_SHA", "OPENSSL_NO_NEXTPROTONEG", "OPENSSL_NO_ENGINE", "OPENSSL_NO_BUF_FREELISTS"))
cargo:rustc-check-cfg=cfg(openssl)
@@ -59,12 +63,22 @@
AARCH64_APPLE_DARWIN_OPENSSL_DIR unset
cargo:rerun-if-env-changed=OPENSSL_DIR
OPENSSL_DIR unset
- run pkg_config fail: Failure { command: "\"pkg-config\" \"--libs\" \"--cflags\" \"opensslbork\"", output: Output { status: ExitStatus(unix_wait_status(256)), stdout: "", stderr: "Package opensslbork was not found in the pkg-config search path.\nPerhaps you should add the directory containing `opensslbork.pc'\nto the PKG_CONFIG_PATH environment variable\nNo package 'opensslbork' found\n" } }
+
+ Could not find openssl via pkg-config:
+ `"pkg-config" "--libs" "--cflags" "opensslbork"` did not exit successfully: exit status: 1
--- stderr
- thread 'main' panicked at openssl-sys/build/find_normal.rs:190:5:
+ Package opensslbork was not found in the pkg-config search path.
+ Perhaps you should add the directory containing `opensslbork.pc'
+ to the PKG_CONFIG_PATH environment variable
+ No package 'opensslbork' found
+ cargo:warning=Could not find directory of OpenSSL installation, and this `-sys` crate cannot proceed without this knowledge. If OpenSSL is installed and this crate had trouble finding it, you can set the `OPENSSL_DIR` environment variable for the compilation process. See stderr section below for further information.
+
+ --- stderr
+
+
Could not find directory of OpenSSL installation, and this `-sys` crate cannot
proceed without this knowledge. If OpenSSL is installed and this crate had
trouble finding it, you can set the `OPENSSL_DIR` environment variable for the
@@ -81,19 +95,3 @@
$TARGET = aarch64-apple-darwin
openssl-sys = 0.9.103
-
- stack backtrace:
- 0: rust_begin_unwind
- at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/panicking.rs:665:5
- 1: core::panicking::panic_fmt
- at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/panicking.rs:74:14
- 2: core::panicking::panic_display
- 3: build_script_main::find_normal::find_openssl_dir::panic_cold_display
- 4: build_script_main::find_normal::find_openssl_dir
- 5: build_script_main::find_normal::get_openssl::{{closure}}
- 6: core::option::Option<T>::unwrap_or_else
- 7: build_script_main::find_normal::get_openssl
- 8: build_script_main::find_openssl
- 9: build_script_main::main
- 10: core::ops::function::FnOnce::call_once
- note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace. |
alex
approved these changes
Sep 8, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When the build fails, the Cargo output is messy, and there's unhelpful noise added at both ends of openssl's message. The beginning of output gets a vague error and long meaningless stdout dump, and the end gets a backtrace of an unimportant code location.
This improves the output in two ways:
cargo:warning=
with the first paragraph of the error, so the cause of the failure is printed and highlighted by Cargo first,panic
to direct stderr print to avoid Rust adding unnecessary panic-related help.