Skip to content
This repository has been archived by the owner on Jul 7, 2023. It is now read-only.

Minimizing dependencies #12

Closed
workingjubilee opened this issue Apr 24, 2021 · 5 comments
Closed

Minimizing dependencies #12

workingjubilee opened this issue Apr 24, 2021 · 5 comments

Comments

@workingjubilee
Copy link
Contributor

Hello,

I have been trying to reduce the number of dependencies for rustc, because while it is natural to expect something like rustc to have a big download and compile, that makes it all the more important to trim out dependencies where we can. It's especially important because of things like the rustc workspace hack. Accordingly, I have been factoring Rust and its dependencies to use Rust std methods, which includes {to,from}_{be,le,ne}_bytes, stabilized in 1.32 (and made const fn in 1.44)... so, in most cases, removing your byteorder crate.

Currently, byteorder is still in rustc because regex-automata is being used by matchers which is used in tracing-subscriber which is used in tracing which is used for logging in rustc.

I was wondering if you would accept a PR to factor out byteorder from regex-automata? I know it implies a Minimum Supported Rust Version bump, and while I can't find an explicit note for the MSRV for this library, I know it is quite low, which is why I wanted to ask first and understand your stance.

@BurntSushi
Copy link
Owner

Yeah this would be okay. I do have a WIP rewrite of this crate that removes byteorder (although it does add memchr).

I don't think it would be worth trying to adapt the changes in my WIP branch back into master since a lot has changed. I think just trying to find the change that makes sense for master would be best.

But yeah, totally okay with an MSRV bump here.

And TIL regex-automata was used in rustc.

@workingjubilee
Copy link
Contributor Author

Yup! fst is used in rls-analysis, and regex is used extensively throughout rustc and its tooling. And your ignore crate appears in cargo, bootstrap, and rustfmt, which includes globset, which includes aho-corasick, which is used in the jsonrpc framework that RLS depends on!

@BurntSushi
Copy link
Owner

BurntSushi commented Apr 24, 2021

Oh wow, that's really cool! I didn't know some of that. :-)

Also, sorry I didn't mention this before, but it will probably be some time before the WIP branch is merged into master. I'd like to say "months," but I think "1 year" is more likely. :-/ So if you want to drop byteorder sooner rather than later, it probably doesn't make sense to wait for that branch to land.

@workingjubilee
Copy link
Contributor Author

I will probably get around to submitting a patch sometime this week. 💖 Shouldn't take much.

@BurntSushi
Copy link
Owner

This was done. And regex-automata has zero required dependencies now.

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

Successfully merging a pull request may close this issue.

2 participants