Firstyear / obs-service-cargo

OBS Source Service and utilities for Rust software packaging
Mozilla Public License 2.0
15 stars 9 forks source link

Vendoring from git sources #91

Open xTeixeira opened 1 month ago

xTeixeira commented 1 month ago

I'm trying to package amdgpu_top, which includes a dependency with a git source in Cargo.toml / Cargo.lock:

[[package]]
name = "libdrm_amdgpu_sys"
version = "0.7.3"
source = "git+https://github.com/Umio-Yasuno/libdrm-amdgpu-sys-rs#b5e281176c6ba5c15379b2bb832d1b37e83e673f"
dependencies = [
 "libc",
]
[dependencies]
...
libdrm_amdgpu_sys = { version = "0.7.3", git = "https://github.com/Umio-Yasuno/libdrm-amdgpu-sys-rs" }

When building the package, I get errors from this dependency:

[  199s] error: failed to compile `amdgpu_top v0.8.5 (/home/abuild/rpmbuild/BUILD/amdgpu_top-0.8.5)`, intermediate artifacts can be found at `/home/abuild/rpmbuild/BUILD/amdgpu_top-0.8.5/target`.
[  199s] To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
[  199s] 
[  199s] Caused by:
[  199s]   failed to get `libdrm_amdgpu_sys` as a dependency of package `libamdgpu_top v0.8.5 (/home/abuild/rpmbuild/BUILD/amdgpu_top-0.8.5/crates/libamdgpu_top)`
[  199s]       ... which satisfies path dependency `libamdgpu_top` of package `amdgpu_top v0.8.5 (/home/abuild/rpmbuild/BUILD/amdgpu_top-0.8.5)`
[  199s] 
[  199s] Caused by:
[  199s]   failed to load source for dependency `libdrm_amdgpu_sys`
[  199s] 
[  199s] Caused by:
[  199s]   Unable to update https://github.com/Umio-Yasuno/libdrm-amdgpu-sys-rs
[  199s] 
[  199s] Caused by:
[  199s]   the source git+https://github.com/Umio-Yasuno/libdrm-amdgpu-sys-rs requires a lock file to be present first before it can be
[  199s]   used against vendored source code
[  199s] 
[  199s]   remove the source replacement configuration, generate a lock file, and then
[  199s]   restore the source replacement configuration to continue the build

If I change it to pull the same dependency from crates.io instead of a git source, the build works. Does this service not support pulling from git sources? Any good way to work around this?

Firstyear commented 1 month ago

What OBS project is this in? It would be good to check our your .spec and _service file too.

xTeixeira commented 3 weeks ago

Here.

Right now I have it patched to pull the libdrm_amdgpu_sys dependency from crates.io instead of github. If you need to reproduce the error you'll need to remove the patch and regenerate the vendor tarball.

uncomfyhalomacro commented 1 day ago

weird bug. i haven't experienced this so far. But i believe we already brought a fix because i see the error message from yours

[  199s]   remove the source replacement configuration, generate a lock file, and then
[  199s]   restore the source replacement configuration to continue the build

very sorry for late response

Firstyear commented 20 hours ago

@uncomfyhalomacro But it should be able to vendor git sources, I've done it with Kanidm in the past. I think the problem is " false" should be true?