Skip to content

Include package name/version in build script warnings. #8018

Closed
@ehuss

Description

@ehuss

Describe the problem you are trying to solve
In some situations, it is not clear where a warning is coming from when emitted from a build script. For example, a build script like this:

fn main() {
    println!("cargo:warning=this is a warning");
}

displays:

warning: this is a warning

Describe the solution you'd like
I think it might be helpful to prefix the warning with the package name and version (similar to how -vv output is). Perhaps something like this:

warning: [pkg_name 1.2.3] this is a warning

Notes
Warnings are emitted here. The package name/version should be accessible from the unit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-build-scriptsArea: build.rs scriptsA-console-outputArea: Terminal output, colors, progress bar, etc.C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`E-easyExperience: EasyS-acceptedStatus: Issue or feature is accepted, and has a team member available to help mentor or review

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions