BurntSushi / regex-automata

A low level regular expression library that uses deterministic finite automata.
The Unlicense
351 stars 26 forks source link

Update dependencies in test/cli, and fix a compile error in test. #28

Closed thomcc closed 1 year ago

thomcc commented 1 year ago

While hacking some stuff together in regex-automata for another project, I happened to fix a compilation error in the tests and also updated some of the dependencies in the cli and tests. Most notably clap (which is nontrivial to update), since I probably wouldn't bother upstreaming this otherwise.

In case you haven't used it in other projects, note that the newer versions of clap have a much less forgiving builder API (e.g. fail at runtime for some easily-made mistakes in a way that's annoying to test). In particular, if the initialization/declaration of a flag/option/arg isn't correct for how it's accessed, it will fail when you access it. I've (hopefully) manually tested that all the usage is correct so I'm mostly just saying this as a caveat for future extensions to that code, since it's not obvious.

These are purely changes to regex-cli and regex-test so they shouldn't be public at all. You may want to tweak/reduce the clap usage/features further (that said, note that new clap doesn't allow default-features=false), this is just the path of least resistance for the most part.

BurntSushi commented 1 year ago

Thank you! But did you see this in the README?

WARNING: The master branch currently contains code for the 0.2 release, but this README still targets the 0.1 release. Namely, it is recommended to stick with the 0.1 release. The 0.2 release was made prematurely in order to unblock some folks.

and this in the docs:

WARNING: This 0.2 release of regex-automata was published before it was ready to unblock work elsewhere that needed some of the new APIs in this release. At the time of writing, it is strongly preferred that you continue using the regex-automata 0.1 release. Since this release represents an unfinished state, please do not create issues for this release unless it’s for a critical bug.

Basically, I have a very long running branch that forked off of 0.2.0, and there's just no way I can justify the time required to rebase it on top of a patch like this unfortunately. There's just way too much that has changed. Basically, regex-test and regex-cli were always very very unpolished works in progress, and I never meant for them to be published in the state that 0.2 is in. But I did it out of expediency for some other folks. As I've worked off of 0.2, I've progressively polished regex-cli and regex-test. So rebasing on a patch like this would be quite annoying.

Also, I'm likely to move off of Clap for regex-cli and on to lexopt. I haven't fully decided that yet.

thomcc commented 1 year ago

No, I didn't see the README, sorry. I did this mostly as a way to help familiarize myself with (the usage side of) the code because I had another use for it (which I filed an issue about).

So rebasing on a patch like this would be quite annoying

Is the branch public? I don't mind just doing it for the branch rather than having you manually rebase. But also I'm not bothered if you'd rather just close this.

thomcc commented 1 year ago

I'll close this anyway since it sounds like it would need to be rewritten on top of something else regardless, sorry for the trouble.

BurntSushi commented 1 year ago

Is the branch public? I don't mind just doing it for the branch rather than having you manually rebase. But also I'm not bothered if you'd rather just close this.

Yes, it's here: https://github.com/BurntSushi/regex-automata/tree/ag/donotuse-work

And the docs: https://burntsushi.net/stuff/tmp-do-not-link-me/regex-automata/regex_automata/

But note:

  1. I may force push to that branch.
  2. It has the substring donotuse in it for a reason.
  3. regex-automata 0.2 is only a thing because some folks depended on my WIP branch at the time (only called ag/work), and when it came time for them to release their stuff, I wasn't ready. So I cut a regex-automata 0.2 for them, which was basically just "what I had" at the time. I will not be doing that again. You've been warned. :-)

I do hope that everything gets on master within the next few "months" as opposed to "years." I have major branches going forward also in regex-syntax and aho-corasick.

thomcc commented 1 year ago

It has the substring donotuse in it for a reason.

Ah, that kind of branch. Yeah I got it, I wouldn't want someone using incomplete branches of mine either (I usually don't publish them, but mostly because I'd rather folks not look at my WIP code, never considered someone might actually use it 🙀).

FWIW this PR took only an hour or two to write and I submitted it (and offered to apply it to your other branch) as a courtesy, rather than due to a need.

(Also, if you're concerned that I'll be pestering you for a release, you don't need to be. The stuff I'm doing with regex-automata is just an tool to help debugging/experimenting with some code generation. Definitely not something I have any interest in publishing to crates.io)

BurntSushi commented 1 year ago

Gotya. And no problem. I'm mostly just trying to be super clear about the current state of things to avoid repeating past mistakes, that's all.

It probably doesn't need to be public, but to be honest, that's just my default thing that I do. I actually can't think of any code I've written in the last ten years that is not currently on GitHub. :P (Aside from code owned by my employer.)

FWIW this PR took only an hour or two to write and I submitted it (and offered to apply it to your other branch) as a courtesy, rather than due to a need.

Ah okay good. And I do encourage you to reach out before doing this just so you can avoid doing work that might get dropped. Even if it's a DM on Zulip or email or something if you don't want to file an issue.

thomcc commented 1 year ago

I actually can't think of any code I've written in the last ten years that is not currently on GitHub

Ah, yeah. I only like to publish stuff I'm happy with, but then I overthink it. Your approach is likely better.

And I do encourage you to reach out before doing this just so you can avoid doing work that might get dropped

Sure, I'll send a message on Zulip next time.