Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 907701

Summary: cargo.eclass: GIT_CRATES: patch doesn't seem to support virtual manifests
Product: Gentoo Linux Reporter: Matt Jolly <kangie>
Component: EclassesAssignee: Gentoo Rust Project <rust>
Status: RESOLVED INVALID    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugzilla.yoctoproject.org/show_bug.cgi?id=15104
https://github.com/rust-lang/cargo/issues/4934
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: bcachefs-tools-24_p20230601.ebuild

Description Matt Jolly gentoo-dev 2023-06-02 11:55:37 UTC
When a GIT_CRATE is used with a virtual manifest and the appropriate path is provided cargo doesn't believe that the dependency is satisfied.

With path `rust-bindgen-bcachefs-%commit%` (points to root of git repo with virtual manifest)

```
error: failed to load source for dependency `bindgen`

Caused by:
  Unable to update /var/tmp/portage/sys-fs/bcachefs-tools-24_p20230601/work/rust-bindgen-bcachefs-f773267b090bf16b9e8375fcbdcd8ba5e88806a8

Caused by:
  found a virtual manifest at `/var/tmp/portage/sys-fs/bcachefs-tools-24_p20230601/work/rust-bindgen-bcachefs-f773267b090bf16b9e8375fcbdcd8ba5e88806a8/Cargo.toml` instead of a package manifest
```

With path `rust-bindgen-bcachefs-%commit%/bindgen`

```
error: failed to get `bindgen` as a dependency of package `bch_bindgen v0.1.0 (/var/tmp/portage/sys-fs/bcachefs-tools-24_p20230601/work/bcachefs-tools-1f78fed4693a5361f56508daac59bebd5b556379/rust-src/bch_bindgen)`
    ... which satisfies path dependency `bch_bindgen` (locked to 0.1.0) of package `bcachefs-rust v0.3.1 (/var/tmp/portage/sys-fs/bcachefs-tools-24_p20230601/work/bcachefs-tools-1f78fed4693a5361f56508daac59bebd5b556379/rust-src)`

Caused by:
  failed to load source for dependency `bindgen`

Caused by:
  Unable to update https://evilpiepirate.org/git/rust-bindgen.git#f773267b

Caused by:
  can't checkout from 'https://evilpiepirate.org/git/rust-bindgen.git': you are in the offline mode (--offline)
```

This branch has a commit at its head that fails: https://github.com/Kangie/gentoo/tree/broken-git-crate-dependency

Reproducible: Always
Comment 1 Matt Jolly gentoo-dev 2023-06-02 12:01:30 UTC
Created attachment 863046 [details]
bcachefs-tools-24_p20230601.ebuild
Comment 2 Matt Jolly gentoo-dev 2023-06-02 12:03:02 UTC
I suspect that something is going a bit weird with cargo within the ebuild environment; I don't think that I'm doing anything too weird when I call 'cargo_src_compile'.

Potentially Related Issues:

- https://bugzilla.yoctoproject.org/show_bug.cgi?id=15104
- https://github.com/gentoo/gentoo/pull/31273
Comment 3 Matt Jolly gentoo-dev 2023-06-02 12:03:44 UTC
Botched paste; gentoo/gentoo PR should have been:

- https://github.com/rust-lang/cargo/issues/4934
Comment 4 Matt Jolly gentoo-dev 2023-06-03 12:33:25 UTC
It seems that this error can occur when the git repo URI doesn't align exactly with what cargo is expecting; in this case with or without '.git'