-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Mechanism To Print Warning From Non-Path Dependency #11593
Comments
It's reasonable for Cargo to provide a transition mechanism for the whole ecosystem. However, the compilation is pipelined and usually interleaved. Print them all out without buffering might still be scary to some users. Even with a proper buffering, people might still feel overwhelmed and exhausted. After that, I believe note: 3 warnings emitted during running the custom build for `foo v0.5.0 ([CWD])`
Run `cargo report replay-message -p foo` to read messages from `foo`. (Even with Footnotes |
Other related issues:
|
This seems good to me, and would not require new build directives, avoiding #11461 I presume this wouldn't pick up normal warnings, i.e. if compiling the build script produced a warning it wouldn't be included? The only inclusions would be from |
One of the technical difficuties of my proposal is that Cargo doesn't really have the knowledge of the arguments, environment, and rustflags of your previous build, so it might be hard to determine the right output to display.
Cargo stores stdout/stderr of the build script execution under |
Problem
By default Rust targets a very portable / conservative x86 target. For most use-cases this isn't all that critical, but in the arrow project we provide vectorised compute kernels, for which correct vectorisation has significant orders-of-magnitude performance implications.
We would like to be able to provide some hint to users that they should consider compiling with a more specific target-cpu - see apache/arrow-rs#3485.
Currently all warnings from non-path dependencies are assumed to be the responsibility of that crate, and not relevant to the end-user, unless that crate fails to compile. This is not necessarily the case, especially where the warning relates to the build context which is under the users control.
Examples of this:
Whilst these cases could error, this feels a little heavy-handed for what should be a very strong suggestion.
Proposed Solution
I would like
println!("cargo:user-warning={msg}")
to always printmsg
as a warning even if the build does not fail. @alexcrichton previously wrote on a similar proposal in #3777I think this is still consistent with this, it avoids unconstrained log spam, whilst explicitly only surfacing information that is user-facing.
Notes
The text was updated successfully, but these errors were encountered: