Giter VIP home page Giter VIP logo

Comments (4)

wookietreiber avatar wookietreiber commented on June 21, 2024

What I wonder though is why there is no output in the runner. In an interactive shell I get:

$ cargo msrv verify
Fetching index
Verifying the Minimum Supported Rust Version (MSRV) for toolchain x86_64-unknown-linux-gnu
Using check command cargo check
   Finished Satisfied MSRV check: 1.56.1 █████████ 00:00:00

In the GitLab runner logs there is just nothing. I'm assuming that's because CI jobs are non-interactive shells, no TERM env var is set, or some other reason, dunno for what you're checking.

It would certainly be nice if there was a more CI-friendly output mode for cargo msrv verify that'd be just a one-liner for success, as in:

$ cargo msrv verify
success: MSRV 1.56.1 verified

... and the output of the verify commands in case of failure, so you can immediately see what the problems are:

$ cargo msrv verify [-- <COMMANDS>...]
error: MSRV 1.56.1 not verified
[output of <COMMANDS>... here]

from cargo-msrv.

foresterre avatar foresterre commented on June 21, 2024

Would you be open to adding a CI section to the cargo-msrv book so others have an easier reference in avoiding this? I'd be open to provide a PR.

Certainly!

from cargo-msrv.

foresterre avatar foresterre commented on June 21, 2024

What I wonder though is why there is no output in the runner.

It would certainly be nice if there was a more CI-friendly output mode for cargo msrv verify that'd be just a one-liner for success

Would --output-format json (or --output-format minimal) suffice, or do you think having a slightly less minimal ci output mode is a plus?

Alternatively, I could modify the output of the minimal output format which is also meant for CI use and tooling: e.g. by adding reason for failure, instead of true or false for cargo msrv verify.

This is what --output-format json looks like in the upcoming release:

$ cargo msrv verify --output-format json
{"type":"meta","instance":"cargo-msrv","version":"0.16.0-beta.14","sha_short":null,"target_triple":"x86_64-pc-windows-msvc","cargo_features":"","rustc":"1.70.0"}
{"type":"subcommand_init","subcommand_id":"verify"}
{"type":"fetch_index","source":"rust_changelog","scope":{"id":0,"marker":"start"}}
{"type":"fetch_index","source":"rust_changelog","scope":{"id":0,"marker":"end"}}
{"type":"check_toolchain","toolchain":{"version":"1.36.0","target":"x86_64-pc-windows-msvc"},"scope":{"id":1,"marker":"start"}}
{"type":"setup_toolchain","toolchain":{"version":"1.36.0","target":"x86_64-pc-windows-msvc"},"scope":{"id":2,"marker":"start"}}
{"type":"setup_toolchain","toolchain":{"version":"1.36.0","target":"x86_64-pc-windows-msvc"},"scope":{"id":2,"marker":"end"}}
{"type":"check_method","toolchain":{"version":"1.36.0","target":"x86_64-pc-windows-msvc"},"method":{"type":"rustup_run","args":["1.36.0-x86_64-pc-windows-msvc","cargo","check"],"path":"C:\\run\\yare"}}
{"type":"check_result","toolchain":{"version":"1.36.0","target":"x86_64-pc-windows-msvc"},"is_compatible":false,"error":"error: failed to parse lock file at: C:\\run\\yare\\Cargo.lock\n\nCaused by:\n  invalid serialized PackageId for key `package.dependencies`\n"}
{"type":"check_toolchain","toolchain":{"version":"1.36.0","target":"x86_64-pc-windows-msvc"},"scope":{"id":1,"marker":"end"}}
{"type":"subcommand_result","subcommand_id":"verify","result":{"toolchain":{"version":"1.36.0","target":"x86_64-pc-windows-msvc"},"is_compatible":false,"error":"error: failed to parse lock file at: C:\\run\\yare\\Cargo.lock\n\nCaused by:\n  invalid serialized PackageId for key `package.dependencies`\n"}}
{"type":"terminate_with_failure","reason":{"description":"Crate source was found to be incompatible with Rust version '1.36' specified as MSRV in the Cargo manifest located at 'C:\\run\\yare\\Cargo.toml'"}}

and --output-format minimal:

$ cargo msrv verify --output-format minimal
false

from cargo-msrv.

wookietreiber avatar wookietreiber commented on June 21, 2024

Would --output-format json (or --output-format minimal) suffice, or do you think having a slightly less minimal ci output mode is a plus?

I think it would be beneficial for CI output to show the actual failures to avoid having to run cargo +msrv <check|test|...> manually to figure out what the problems were. Then it'd be easier / less hassle to either bump MSRV because the new functions/features are required/wanted or tell contributors to avoid these functions/features shown in that output to keep MSRV where it is.

case everything ok

minimalistic output:

success: msrv 1.56.1 verified

case failure

include output of the check command:

error: msrv 1.56.1 not verified
<output of cargo +msrv check>

from cargo-msrv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.