-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gitoxide integration: fetch #11448
gitoxide integration: fetch #11448
Conversation
r? @epage (rustbot has picked a reviewer for you, use r? to override) |
0c9d0c6
to
a305af5
Compare
62af2de
to
1759263
Compare
Very early results for the MVP of fetch (a lot is missing, but it works already).
And for additional reference:
MeasurementsGix
|
2552fec
to
e8c4201
Compare
e8c4201
to
fb11423
Compare
b903e2d
to
759c264
Compare
☔ The latest upstream changes (presumably #10771) made this pull request unmergeable. Please resolve the merge conflicts. |
7792d2e
to
cfffda9
Compare
This is soon to be merged. @Byron wrote a decent commit message cfffda9, calling out important stuff to follow up. Let me repost them here:
One thing also needs attentions is the behavior change of git credential helper mentioned in #11448 (comment). Thank you to everyone involved in this pull request! @bors r+ |
☀️ Test successful - checks-actions |
chore(ci): Enforce cargo-deny in CI With #11448, we are pulling in a wide and deep dependency tree which makes it harder for us to track what we are pulling in over time. I've been trying out [`cargo-deny`](https://github.com/EmbarkStudios/cargo-deny) on my projects and wanted to explore how useful it might be for cargo. atm I only have it configured to fail for unexpected licenses. We can also use its warnings to hunt down and remove duplicated dependencies to speed up our builds. I did also enable advisories. We ignore the failure in a way to not block PRs or even show up as failure in PRs as PR authors are not responsible for dealing with these (unless its a new dep) and it can be intimidating as a contributor to see a failure and have no idea how to resolve it (as authors generally assume CI is green and failures are there fault) I did not go too much further into what all `cargo-deny` can do; there might be more we can leverage.
23 commits in 9880b408a3af50c08fab3dbf4aa2a972df71e951..c1334b059c6dcceab3c10c81413f79bb832c8d9d 2023-02-28 19:39:39 +0000 to 2023-03-07 19:21:50 +0000 - Add `CARGO_PKG_README` (rust-lang/cargo#11645) - path dependency: fix cargo-util version (rust-lang/cargo#11807) - Adding display of which target failed to compile (rust-lang/cargo#11636) - Fix `CARGO_CFG_` vars for configs defined both with and without value (rust-lang/cargo#11790) - Breaking endless loop on cyclic features in added dependency in cargo-add (rust-lang/cargo#11805) - Enhance the doc of timing report with graphs (rust-lang/cargo#11798) - Make `sparse` the default protocol for crates.io (rust-lang/cargo#11791) - Use sha2 to calculate SHA256 (rust-lang/cargo#11795) - gitoxide progress bar fixes (rust-lang/cargo#11800) - Check publish_to_alt_registry publish content (rust-lang/cargo#11799) - chore: fix missing files in autolabel trigger_files (rust-lang/cargo#11797) - chore: Update base64 (rust-lang/cargo#11796) - Fix some doc typos (rust-lang/cargo#11794) - chore(ci): Enforce cargo-deny in CI (rust-lang/cargo#11761) - Some cleanup for unstable docs (rust-lang/cargo#11793) - gitoxide integration: fetch (rust-lang/cargo#11448) - patch can conflict on not activated packages (rust-lang/cargo#11770) - fix(toml): Provide a way to show unused manifest keys for dependencies (rust-lang/cargo#11630) - Improve error for missing crate in --offline mode for sparse index (rust-lang/cargo#11783) - feat(resolver): `-Zdirect-minimal-versions` (rust-lang/cargo#11688) - feat: Use test name for dir when running tests (rust-lang/cargo#11738) - Jobserver cleanup (rust-lang/cargo#11764) - Fix help string for "--charset" option of "cargo tree" (rust-lang/cargo#11785) Note that some 3rd-party licensing allowed list changed due to the introducion of `gix` dependency
Update cargo 25 commits in 9880b408a3af50c08fab3dbf4aa2a972df71e951..7d3033d2e59383fd76193daf9423c3d141972a7d 2023-02-28 19:39:39 +0000 to 2023-03-08 17:05:08 +0000 - Revert "rust-lang/cargo#11738" - Use test name for dir when running tests (rust-lang/cargo#11812) - Update CHANGELOG for 1.68 backports (rust-lang/cargo#11810) - Add `CARGO_PKG_README` (rust-lang/cargo#11645) - path dependency: fix cargo-util version (rust-lang/cargo#11807) - Adding display of which target failed to compile (rust-lang/cargo#11636) - Fix `CARGO_CFG_` vars for configs defined both with and without value (rust-lang/cargo#11790) - Breaking endless loop on cyclic features in added dependency in cargo-add (rust-lang/cargo#11805) - Enhance the doc of timing report with graphs (rust-lang/cargo#11798) - Make `sparse` the default protocol for crates.io (rust-lang/cargo#11791) - Use sha2 to calculate SHA256 (rust-lang/cargo#11795) - gitoxide progress bar fixes (rust-lang/cargo#11800) - Check publish_to_alt_registry publish content (rust-lang/cargo#11799) - chore: fix missing files in autolabel trigger_files (rust-lang/cargo#11797) - chore: Update base64 (rust-lang/cargo#11796) - Fix some doc typos (rust-lang/cargo#11794) - chore(ci): Enforce cargo-deny in CI (rust-lang/cargo#11761) - Some cleanup for unstable docs (rust-lang/cargo#11793) - gitoxide integration: fetch (rust-lang/cargo#11448) - patch can conflict on not activated packages (rust-lang/cargo#11770) - fix(toml): Provide a way to show unused manifest keys for dependencies (rust-lang/cargo#11630) - Improve error for missing crate in --offline mode for sparse index (rust-lang/cargo#11783) - feat(resolver): `-Zdirect-minimal-versions` (rust-lang/cargo#11688) - feat: Use test name for dir when running tests (rust-lang/cargo#11738) - Jobserver cleanup (rust-lang/cargo#11764) - Fix help string for "--charset" option of "cargo tree" (rust-lang/cargo#11785) --- ~~This update is primarily for making rust-lang/cargo#11630 into 1.69~~ (will file a beta backport then). However, just look into the licenses and dependencies permitted list, it looks a bit unfortunate but inevitable I guess? r? `@ehuss` cc `@Muscraft`
Update cargo 25 commits in 9880b408a3af50c08fab3dbf4aa2a972df71e951..7d3033d2e59383fd76193daf9423c3d141972a7d 2023-02-28 19:39:39 +0000 to 2023-03-08 17:05:08 +0000 - Revert "rust-lang/cargo#11738" - Use test name for dir when running tests (rust-lang/cargo#11812) - Update CHANGELOG for 1.68 backports (rust-lang/cargo#11810) - Add `CARGO_PKG_README` (rust-lang/cargo#11645) - path dependency: fix cargo-util version (rust-lang/cargo#11807) - Adding display of which target failed to compile (rust-lang/cargo#11636) - Fix `CARGO_CFG_` vars for configs defined both with and without value (rust-lang/cargo#11790) - Breaking endless loop on cyclic features in added dependency in cargo-add (rust-lang/cargo#11805) - Enhance the doc of timing report with graphs (rust-lang/cargo#11798) - Make `sparse` the default protocol for crates.io (rust-lang/cargo#11791) - Use sha2 to calculate SHA256 (rust-lang/cargo#11795) - gitoxide progress bar fixes (rust-lang/cargo#11800) - Check publish_to_alt_registry publish content (rust-lang/cargo#11799) - chore: fix missing files in autolabel trigger_files (rust-lang/cargo#11797) - chore: Update base64 (rust-lang/cargo#11796) - Fix some doc typos (rust-lang/cargo#11794) - chore(ci): Enforce cargo-deny in CI (rust-lang/cargo#11761) - Some cleanup for unstable docs (rust-lang/cargo#11793) - gitoxide integration: fetch (rust-lang/cargo#11448) - patch can conflict on not activated packages (rust-lang/cargo#11770) - fix(toml): Provide a way to show unused manifest keys for dependencies (rust-lang/cargo#11630) - Improve error for missing crate in --offline mode for sparse index (rust-lang/cargo#11783) - feat(resolver): `-Zdirect-minimal-versions` (rust-lang/cargo#11688) - feat: Use test name for dir when running tests (rust-lang/cargo#11738) - Jobserver cleanup (rust-lang/cargo#11764) - Fix help string for "--charset" option of "cargo tree" (rust-lang/cargo#11785) --- ~~This update is primarily for making rust-lang/cargo#11630 into 1.69~~ (will file a beta backport then). However, just look into the licenses and dependencies permitted list, it looks a bit unfortunate but inevitable I guess? r? `@ehuss` cc `@Muscraft`
This PR is the first step towards resolving #1171.
In order to get there, we integrate
gitoxide
intocargo
in such a way that one can control its usage in nightly via-Zgitoxide
orZgitoxide=<feature>[,featureN]
.Planned features are:
gitxide
(this PR)gitoxide
(planned)The above list is a prediction and might change as we understand the requirements better.
Testing and Transitioning
By default, everything stays as is. However, relevant tests can be re-runwith
gitoxide
usingThere are about 200 tests with 'git' in their name and I plan to enable them one by one. That way the costs for CI stay managable (my first measurement with one test was 2min 30s), while allowing to take one step at a time.
Custom tests shall be added once we realize that more coverage is needed.
That way we should be able to maintain running
git2
andgitoxide
side by side until we are willing to switch over togitoxide
entirely on stable cargo. Then turning ongit2
might be a feature toggle for a while until we finally remove it from the codebase.Please see the above paragraph as invitation for discussion, it's merely a basis to explore from and improve upon.
Tasks
gitoxide
(MVP)cargo
specific values are passed togitoxide
git2
code can handle crates-index clones created withgitoxide
and vice-versagitoxide
enabled testing - it's not used anymoreremove all TODOs and use crates-index version ofThe remaining 2 TODO's are more like questions for the reviewer.git-repository
gitoxide
release and refer to the latest version from crates.io (instead of git-dependency)Postponed Tasks
I suggest to go breadth-first and implement the most valuable features first, and then aim for a broad replacement of
git2
. What's left is details and improved compatibility with thegit2
implementation that will be required oncegitoxide
should become the default implementation on stable to complete the transition.file
protocol (i.e. without usinggit
). Simple cases likeclone
can probably be supported quickly,fetch
needs more work though due to negotiation.libssh(avoid LGPL)libssh2
based) transport. Look at this issue for some history.Proposed Workflow
I am now using stacked git to keep commits meaningful during development. This will also mean that before reviews I will force-push a lot as changes will be bucketed into their respective commits.
Once review officially begins I will stop force-pushing and create small commits to address review comments. That way it should be easier to understand how things change over time.
Those review-comments can certainly be squashed into one commit before merging.
Please let me know if this is feasible or if there are other ways of working you prefer.
Development notes
curl
.gitoxide
as it simply usesssh
(the program) and calls it a day. No authentication flows are supported there yet and the goal would be to matchgit
there at least (which it might already do by just callingssh
). Needs investigation. Once en-par withgit
I thinkcargo
can restart the whole fetch operation to try different user names like before.ssh
-program based transport can now understand permission-denied errors, but the capability isn't used after all since a builtin ssh transport is required.git::Progress
and just ignore most of the calls, but that's known to be too slow as the implementation assumes aProgress::inc()
call is as fast as an atomic increment and makes no attempt to reduce its calls to it.thiserror
could make spurious error checks nicer and less error prone during maintenance. It's not a problem though.RUSTFLAGS=--cfg
to influence the entire build and unit-tests as environment variables didn't get through to the binary built and run for tests.Questions
gitoxide
is configured the user has the opportunity to override these values using more specific git options, for example using url specific http settings. This looks like a feature to me, but if it's notgitoxide
needs to provide a way to disable applying these overrides. Please let me know what's desired here - my preference is to allow overrides.gitoxide
currently opens repositories similar to howgit
does which respects git specific environment variables. This might be a deviation from how it was before and can be turned off. My preference is to see it as a feature.Prerequisite PRs
util::Progress
thread-safe as prerequisite of #11448 #11602