mitmproxy / mitmproxy/mitmproxy
Please allow building mitmproxy-rs without tree-sitter
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 45.1k
- Forks
- 4.7k
- Avg merge
- 21h 12m
- Merged PRs (30d)
- 16
Description
Problem Description
I'm a Debian Developer and am currently working with the Debian Rust team and the other mitmproxy maintainers on getting mitmproxy back into Debian from which it was removed in July 2024. What is holding this back is the packaging of the Rust parts in mitmproxy-rs. Specifically, packaging tree-sitter proves to be very challenging.
Proposal
Add a feature, for example called "highlight" to mitmproxy-rs. The feature is enabled by default. Disabling the feature will disable syntax highlighting and will make mitmproxy-rs not require tree-sitter.
Alternatives
We can also patch out tree-sitter in Debian with a Debian-specific patch but it would be cleaner to have this happen upstream to avoid having to carry a patch.
Additional context
Debian releases a stable version around every two years. Packages in the stable release are then supported for up to 10 years. Performing security and maintenance tasks for more than 30k source packages can only work well if each software package performs regular stable releases which we can ship and (if needed) easily fix. This is not how the Rust eco-system operates for the most part as embedding/vendoring code copies of arbitrary versions is not the exception but the norm. Packaging the tree-sitter grammars for xml, javascript, css and yaml can be done but will be a very lengthy process. It would be much easier to package a version of mitmproxy without syntax highlighting today and add syntax highlighting once the respective tree-sitter grammars are packaged later. Since we are doing this work as volunteers, it is hard to estimate how long that would take.
I am essentially done with packaging the remaining Rust crates that were missing and am only blocked by tree-sitter right now.
Thanks!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the mitmproxy-rs Cargo manifest and the code that enables syntax highlighting through tree-sitter. Trace how the XML, JavaScript, CSS, and YAML grammars are included, then define the feature behavior described in the proposal. Done means the default build retains syntax highlighting while disabling the feature removes the tree-sitter requirement.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100