MaaAssistantArknights / MaaAssistantArknights/maa-cli

RFC: replace `git2` with `gix` (`gitoxide`)

Open
#399 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
117
Forks
39
PR merge metrics
No merged PRs in 30d

Description

The main limitation with using `libgit2` (via `git2`) is its dependency on OpenSSL for HTTPS transport. This introduces challenges for cross-compilation and increases the binary size due to the inclusion of an additional HTTP(S) stack.

An alternative is [`gix`](https://github.com/Byron/gitoxide), which supports pluggable HTTP clients such as reqwest—the same client we use elsewhere in our project. However, `gix` is currently not mature enough for our needs. It lacks support for critical operations such as `git reset --hard` or `git pull`, making it unsuitable for updating resources. Additionally, SSH transport is not built-in and relies on invoking the external `ssh` command.

Other Potential Solutions

- Replace git2’s HTTPS transport backend with an alternative client (e.g., git2-curl or git2-hyper). These crates are not widely adopted or actively maintained, creating long-term maintenance risk. Also, libssh2 (provide SSH transport) relies on OpenSSL for cryptographic primitives, so we cannot remove the OpenSSL dependency.
- Implement a custom update mechanism (maa-update-engine). This is currently only a proposal and would require substantial development effort and ongoing maintenance.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by auditing the current git2 usage and the resource update paths, then compare gix's supported operations and transport options with the requirements described here. Confirm whether reset, pull, HTTPS, and SSH can be supported without the current OpenSSL dependency. Done would require an agreed implementation path, since this RFC does not name files or tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, rust
Domain
cli, tooling
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.