Warning: dependencies!

We currently hide all the warnings that the dependent crates have. If you cargo build -vvv you can see them all in glorious technicolour.

One way to nudge people into thinking more about their dependencies might be to output a count as standard of how many compiler warnings there are in your dependencies.

pinned dependencies will get older and as you upgrade your rustc version (which people invariably do do), that count of warnings would increase reminding them that maybe they should cargo update.

To me this all feels win win and we would trend to an ecosystem with less warnings in over time.

Thoughts?

12 Likes

Maybe it could make sense to be level-sensitive for this? A crate with an intentionally-low MSRV may get warnings on newer compilers that are fully expected and not an issue. But if there's anything severe enough that it's actually deny-by-default in rustc, then maybe it'd be worth a warning in the cargo output...

4 Likes

If this is the case, whose lint settings do we take? The crate, the end user, or the defaults?

I typically have very strict linting on code that I write, but certainly don't want to force it on anyone that just happens to use my code. Some warnings happen solely because of compiler upgrades and changes in clippy, but nothing is actually different about the code itself.

3 Likes

Maybe just output it per-crate, so you know what the poorly-maintained crates are?

With output like this:

Compiling foo...<pause> done with 37 warnings.
Compiling bar...<pause> done.
Compiling bar...
2 Likes

Sounds like what node already does. And I like it.

1 Like

I'd rather not show users this information by default (when they specifically request it, sure), because its often very inactionable. I worry about a situation of information overload in which more actionable information gets lost in a sea of warnings the users are not well positioned to react to.

15 Likes

That's a good point. There's not even an obvious place to put a "yes, I've looked at those and don't mind" marker.

1 Like

AFAIK there are also plans to show future incompatibility warnings of dependencies, as those indicate that the dependency might stop working in the future:

2 Likes

The status-quo is that I am blissfully unaware that any of my dependenices have warnings. (I do like the idea of being able to filter the warnings based off a MSRV - that seems a helpful feature that could stand on its own two feet.)

We have other outlets for showing warning counts maybe - I guess we can't include them in rust doc as it doesn't really do a compile? If the info was at crates.io it would be actionable info - but I can see that's fraught with difficulties.

Maybe throw it in with -Z timeings or cargo tree if we don't want to show it by default? Idk, but at the moment the info seems pretty hidden.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.