Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrated from yaml-rust to its well-maintaned fork #461

Closed
wants to merge 3 commits into from

Conversation

nikarh
Copy link

@nikarh nikarh commented Mar 25, 2024

This PR changes the yaml-rust dependency to yaml-rust2.

yaml-rust crate hasn't been updated in 3 years, and since nobody was able to reach the author it was forked.

Related issues:

Why migrate now? Due to https://rustsec.org/advisories/RUSTSEC-2024-0320, now this dependency causes cargo-deny to fail builds on projects that use it.

@torokati44
Copy link

Came here to post this PR, but didn't have to! :) Thanks!
Looking forward to this being merged and released. ^^

@torokati44
Copy link

BTW, if the code changes are undesired, there is a way to "alias" it back to the old package name:

chyh1990/yaml-rust#160 (comment)

@danielhjacobs
Copy link

danielhjacobs commented Mar 25, 2024

Note that Ethiraric/yaml-rust2#9 is needed to avoid https://rustsec.org/advisories/RUSTSEC-2021-0153. That's already been merged into master but there is no release with that change yet.

@torokati44
Copy link

but there is no release with that change yet.

There is now! :)

@mitsuhiko
Copy link
Owner

Unfortunately this completely bumps the MSRV up significantly. This means I need to balance people that care about an unmaintained crate vs need support for older rust versions :-/

@torokati44
Copy link

Do you think it would be feasible to make the yaml feature (and thereby this dependency) completely optional then?

@mitsuhiko
Copy link
Owner

mitsuhiko commented Mar 26, 2024

No. Because the YAML parser is also used internally to read snapshot headers. Maybe the right solution for now is to vendor a stripped down version of the old yaml crate until a new major.

See also #450

@mitsuhiko mitsuhiko mentioned this pull request Mar 26, 2024
@torokati44
Copy link

Unfortunately this completely bumps the MSRV up significantly.

And this is with 0.7.0, not even with 0.8.0, which actually fixes the advisory. Not sure if this will make an additional difference though.

There's also this sort of thing:
https://github.com/paolobarbolini/bzip2-rs/blob/82e3cbb4ea6cb4249a43f90b06ae1a5e94f06a9f/Cargo.toml#L32-L37

I'm not saying it's pretty, but would you be open to something like this?
Maybe not explicit msrv_ features, but a feature to toggle between the original yaml-rust, and this fork?
Perhaps it can be done with Cargo.toml tweaking only due to the fork having kept the original package name (see the link in my second comment).

@nikarh nikarh closed this Mar 26, 2024
@mitsuhiko mitsuhiko mentioned this pull request Mar 26, 2024
@mitsuhiko
Copy link
Owner

I'm not sure what the right course of action is. yaml-rust2 seems to bump up the MSRV to ridiculous levels. I'm not sure what it targets but even 0.7.0 seems to require rustc 1.70.0.

@torokati44
Copy link

I really think it would be worth giving a try to the dependency toggling feature, making use of the complete API compatibility of the fork.

@mitsuhiko
Copy link
Owner

Not sure what the point of this is. YAML is necessary for insta to even read any snapshot file. There is no MSRV compatible version of insta that does not have YAML support and if I need YAML support within insta for it's own uses, then i might as well only use that instead of entertaining two versions.

@torokati44
Copy link

I meant that the feature would switch between the original and the fork for both internal uses and the exposed yaml feature.

But sure, if you are okay with the big MSRV bump for #466, unconditionally switching to the fork, that also works.

@mitsuhiko
Copy link
Owner

Unfortunately it does not look like yaml-rust2 is an option. Let's move that discussion to #467

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants