Skip to content

Installation fails when compiling asyncgit #2578

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

Closed
pearcebasmanm opened this issue Mar 20, 2025 · 7 comments
Closed

Installation fails when compiling asyncgit #2578

pearcebasmanm opened this issue Mar 20, 2025 · 7 comments

Comments

@pearcebasmanm
Copy link

Describe the bug
gitui installation fails on compiling asyncgit v0.27.0

To Reproduce
On the terminal, with an up-to-date version of cargo, run cargo install. This also happens with cargo install-update gitui and cargo install-update -a.

Expected behavior
An error-free installation or updating of gitui

Error (middle part cut out)

> cargo install gitui
...
   Compiling gix-discover v0.37.0
   Compiling gix-odb v0.66.0
   Compiling gix v0.69.1
   Compiling git2 v0.20.1
   Compiling git2-hooks v0.4.0
   Compiling asyncgit v0.27.0
error[E0621]: explicit lifetime required in the type of `patch`
  --> /home/max/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/asyncgit-0.27.0/src/sync/patches.rs:66:2
   |
44 |     patch: &Patch<'a>,
   |            ---------- help: add explicit lifetime `'a` to the type of `patch`: `&'a git2::Patch<'a>`
...
66 |     Ok(res)
   |     ^^^^^^^ lifetime `'a` required

For more information about this error, try `rustc --explain E0621`.
error: could not compile `asyncgit` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
error: failed to compile `gitui v0.27.0`, intermediate artifacts can be found at `/tmp/cargo-installz8TeGV`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

Context (please complete the following information):

  • OS/Distro + Version: Fedora Linux 41 (Workstation Edition)
  • GitUI Version: v0.24.3 (already installed) v0.27.0 (trying to install)
  • Rust version: 1.85.1
@pearcebasmanm pearcebasmanm added the bug Something isn't working label Mar 20, 2025
@naseschwarz
Copy link
Contributor

Hi @pearcebasmanm. Thanks for this report.

Please install using

cargo install-update --locked -- gitui

Have fun using gitui and feel free to provide feedback in case this didn't resolve the issue. :)

@naseschwarz naseschwarz removed the bug Something isn't working label Mar 20, 2025
@pearcebasmanm
Copy link
Author

Thank you, that was the problem!

@hoijui
Copy link

hoijui commented Mar 22, 2025

I have the same issue with my own software, where I use asyncgit only (not gitui).
Will I have to wait for the next release of gitui, @pearcebasmanm ?

@naseschwarz
Copy link
Contributor

@hoijui: The issue is git2 upgrading from 0.20.0 to 0.20.1, a patch upgrade which (unexpectedly) changed an API.

It'd probably be easiest if you would just lock git2 to 0.20.0 in your project, if you can, until a new gitui release is available:

cargo update git2 --precise 0.20.0

@naseschwarz
Copy link
Contributor

Also, as this affects consumers of asyncgit, let me leave a note here as to why I directly closed this: The API change has already been digested in master (#2567).

@hoijui
Copy link

hoijui commented Mar 22, 2025

Thank you @naseschwarz !
perfect info. fixed it for me.

@naseschwarz
Copy link
Contributor

naseschwarz commented Mar 22, 2025

Good to hear, thanks for the feedback!

hoijui added a commit to OSEGermany/okh-scraper that referenced this issue Apr 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants