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

Open
wants to merge 3 commits into
base: master
Choose a base branch
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.

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

2 participants