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

Remove the matchers crate #2945

Closed
wants to merge 3 commits into from

Conversation

wyatt-herkamp
Copy link

Motivation

The matcher's crate has not been updated in 3 years. It is on Regex Automata version "0.1". Due to this I am getting a weird utf-8 error. This part is not a tracing problem. Just an outdated library issue.

Solution

This removes the matchers crate. The code is inspired from matchers crate with updates to Regex Automata 0.4.6. This also strips down the code as we don't need all the features matchers provided.

All tests were passed and has zero user facing changes.

Also this adds .vscode/settings.json to the .gitignore as that file can be developer settings. For instance I needed to enable all features for rust-analyzer.

@wyatt-herkamp
Copy link
Author

Funny story. The file was corrupted on my system so that bug I was seeing was a corrupted local cargo registry. However, I still think it is a good idea to remove the matchers crate as it seems to be no longer maintained.

Copy link
Contributor

@mladedav mladedav left a comment

Choose a reason for hiding this comment

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

The matchers code feels a bit out of places in an ideal world we could just update the code there.

There seems to still be at least some development there, the last comment about the update to a more recent reflex automata version is from March.

There also seem to be some considerations about the upgrade which could potentially break existing usage, are you aware of those and did you take that into account?

Personally, I'd give it a bit more time before moving the code inside this project.

@@ -279,9 +279,9 @@ impl fmt::Display for ValueMatch {
// === impl MatchPattern ===

impl FromStr for MatchPattern {
type Err = matchers::Error;
type Err = regex_automata::dfa::dense::BuildError;
Copy link
Contributor

Choose a reason for hiding this comment

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

You have the type imported so there is no need to fully name it.

.gitignore Outdated
@@ -1,4 +1,3 @@

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think any of these changes should be in this PR. Whether it should be ignored or not is for a different discussion.

@@ -42,7 +42,7 @@ tracing-core = { path = "../tracing-core", version = "0.2", default-features = f

# only required by the `env-filter` feature
tracing = { optional = true, path = "../tracing", version = "0.2", default-features = false }
matchers = { optional = true, version = "0.1.0" }
regex-automata = { optional = true, version = "0.4.6",default-features = false, features = ["syntax", "dfa-build", "dfa-search"] }
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit, you're missing a space after the comma after version.

@wyatt-herkamp
Copy link
Author

There seems to still be at least some development there, the last comment about the update to a more recent reflex automata version is from March.

I did see people are trying to update the crate. However, the developer doesn't seem to be making it a high priority. With it only being about 100 lines of code to implement I don't think using the matchers crate is providing a huge benefit here.

The matchers code feels a bit out of places in an ideal world we could just update the code there.

I understand. However, we are not using all the features that the matchers crate provides. And shrinking the dependency tree can be a good thing as it can lead to better compile times and less likely to get attacked via a supply chain attack.

@sophie-h
Copy link

sophie-h commented Jul 8, 2024

matchers 0.2 with updated dependency is released now. It would be great if this issue could be resolved one or the other way.

@wyatt-herkamp
Copy link
Author

Should I go ahead and close this PR then?

@oscargus oscargus mentioned this pull request Jul 14, 2024
@oscargus
Copy link

I opened #3033 which updates matchers to 0.2. Let's see which is merged, if any,

@wyatt-herkamp
Copy link
Author

I am closing this PR. I hope that eventually this crate will be updated.

@wyatt-herkamp wyatt-herkamp deleted the matchers-crate branch October 15, 2024 19:53
@wyatt-herkamp wyatt-herkamp restored the matchers-crate branch October 15, 2024 19:53
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.

4 participants