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

feat: consolidated kdl parsing logic into new 'hipcheck-kdl' crate #889

Merged
merged 1 commit into from
Feb 6, 2025

Conversation

patrickjcasey
Copy link
Contributor

When upgrading the kdl crate from 4.x to the latest 6.x version, I noticed there was considerable amounts of kdl.rs files copied into various plugins. The kdl crate versions were subtly different between them and any changes to KDL parsing code would currently need to be updated in 5 different crates.

To ease future maintenance burden, I consolidated all of the KDL logic into a new library crate hipcheck-kdl, which contains:

  • common traits and functions typically used in hipcheck code (ParseKdlNode, ToKdlNode, extract_data, string_newtype_parse_kdl_node)
  • re-export of the kdl crate under the kdl module of hipcheck-kdl

@patrickjcasey patrickjcasey linked an issue Feb 6, 2025 that may be closed by this pull request
@patrickjcasey patrickjcasey force-pushed the patrickjcasey/upgrade-kdl-crate branch from 877e523 to 180d892 Compare February 6, 2025 15:59
@alilleybrinker
Copy link
Collaborator

Rather than doing this, I recommend checking out cargo-hakari. The pattern you're doing is called the "workspace hack" in the Rust community, and is a way to enforce unification of versions of a common dependency.

https://crates.io/crates/cargo-hakari

Copy link
Collaborator

@alilleybrinker alilleybrinker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See prior comment.

Copy link
Collaborator

@alilleybrinker alilleybrinker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed. We can do a workspace hack with cargo hakari in a follow up PR

@alilleybrinker alilleybrinker merged commit 3895904 into main Feb 6, 2025
11 checks passed
@patrickjcasey patrickjcasey deleted the patrickjcasey/upgrade-kdl-crate branch February 6, 2025 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Upgrade kdl crate from 4.X to 6.X
2 participants