Skip to content

[git2-curl] The progress bar won't appear when using libcurl as git2 backend #9444

Open
@weihanglo

Description

@weihanglo

Problem

The progress bar won't appear when using libcurl as git2 backend.

Actually it's an issue ofgit2-curl. git2-curl calls curl_easy_perform which is synchronous, so all calls of CurlSubtransport::read are deferred until the whole response is fed into the memory.

Ref: #9395 (comment)

Steps

  1. Prepare a cargo project which needs to perform some git operation (e.g. git source dependency).
  2. Run HTTP_TIMEOUT=5 cargo fetch.
  3. The progress bar disappears while transferring data via the network.

Possible Solution(s)

Modify git2-curl int a streaming manner.

Notes

This issue is just for record. I'll send a PR to git2-rs after figuring out a reasonable way to perform a stream read.


Output of cargo version:

cargo 1.51.0 (43b129a20 2021-03-16)
release: 1.51.0
commit-hash: 43b129a20fbf1ede0df411396ccf0c024bf34134
commit-date: 2021-03-16

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-console-outputArea: Terminal output, colors, progress bar, etc.A-gitArea: anything dealing with gitC-bugCategory: bugS-blocked-externalStatus: ❌ blocked on something out of the direct control of the Cargo project, e.g., upstream fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions