Skip to content

Support cargo:info=MESSAGE in build.rs stdout #7037

@fredericvauchelles

Description

@fredericvauchelles

Status: #7037 (comment)


Describe the problem you are trying to solve
Provide meaningful information to a developer when using a build.rs script.
In my case, I provide duration of specific steps to monitor the performance of thoses.

Currently, I use cargo:warning=MESSAGE to provide this output.

This is not fine because it is not an actual warning.

Describe the solution you'd like

Supporting cargo:info=MESSAGE to output a string in the cargo's output with info log level.

Example:
(build.rs)

fn main() {
     println!("cargo:info=Hello World!");
}

Will print in the cargo output if the build.rs script is executed:

info: Hello World!

with the look of an info entry.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-build-scriptsArea: build.rs scriptsC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions