pubgrub-rs / pubgrub

PubGrub version solving algorithm implemented in Rust
https://pubgrub-rs.github.io/pubgrub/pubgrub/
Mozilla Public License 2.0
337 stars 30 forks source link

How to get the report formatting presented in the README #167

Open lpil opened 7 months ago

lpil commented 7 months ago

Hello!

The README documents error printing that is much more readable than the output from DefaultStringReporter. How does one get this output? I have been unable to find it.

Thank you

mpizenberg commented 7 months ago

Hi @lpil

The readme error is an extract from the original pubgrub blog post, so it's an aspirational capability. The current published pubgrub would need you to rewrite the reporter.

HOWEVER, I'd suggest you look instead at the work currently done by @zanieb and @Eh2406 that enables much easier and better error customization. #156 and #158 already made their way into the dev branch, and #163 is on its way.

lpil commented 7 months ago

Ok! Thank you for the info. Looking forward to the next release 💜

Eh2406 commented 7 months ago

If you are interested in the quality of our error reports please come help with the work!

lpil commented 7 months ago

I'd love to, but I'm rather swamped with Gleam development at the moment 😁

Eh2406 commented 7 months ago

That is entirely reasonable. I hope you will pass along reproducible examples of bad error messages for us to work on, when you have time.

Eh2406 commented 7 months ago

Also, I would love to have a benchmark file based on your registry/ecosystem. (Like how we currently benchmark using all packages available in the Elm ecosystem.) Is your ecosystem, and the code interact with it, available?

lpil commented 6 months ago

It is! https://github.com/gleam-lang/gleam/blob/c4b02e686a78cf4280a9295ee06f8aa77cf2e2c2/compiler-core/src/dependency.rs#L22-L58

If you detail a little of what you're after I can add an issue to the Gleam tracker and someone may pick that up.

mpizenberg commented 6 months ago

Something that would be super helpful for building an example dataset is a script that gathers all packages and versions existing and record them into a ron file. Or a subset if that's too big.

Here is an example (old) script where I did this for elm packages: https://github.com/mpizenberg/elm-solve-deps/blob/master/elm-solve-deps-lib/examples/build_registry.rs

Something similar, for gleam/hex packages would be what we are after I guess. It doesn't have to record them directly into an offline dependency provider as in that example. Especially if the mapping can be a bit akward for pre-release and the lot of things that are not natively supported by pubgrub. But a way to store that data in a single file easily loadable for tests/benchmarks would be awesome.