Firstyear / obs-service-cargo

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

git dependencies not included in vendor tarball #14

Closed darix closed 3 years ago

darix commented 3 years ago

https://gitlab.freedesktop.org/ryuukyu/helvum

even with the vendor tarball you end up with

cargo build --release --offline
error: failed to get `gtk4` as a dependency of package `helvum v0.2.1 (/home/abuild/rpmbuild/BUILD/helvum-0.2.1+1)`

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

Caused by:
  Unable to update https://github.com/gtk-rs/gtk4-rs/#ff9e0b86

Caused by:
  can't checkout from 'https://github.com/gtk-rs/gtk4-rs/': you are in the offline mode (--offline)

service file

<?xml version="1.0"?>
<services>
  <service name="obs_scm">
    <param name="scm">git</param>
    <param name="url">https://gitlab.freedesktop.org/ryuukyu/helvum.git</param>
    <param name="revision">main</param>
    <param name="versionformat">@PARENT_TAG@+@TAG_OFFSET@</param>
    <param name="versionrewrite-pattern">(.*)\+0</param>
    <param name="versionrewrite-replacement">\1</param>
  </service>
  <service name="tar" mode="buildtime"/>
  <service name="recompress" mode="buildtime">
    <param name="file">*.tar</param>
    <param name="compression">xz</param>
  </service>
  <service name="set_version" mode="buildtime" />
  <service name="cargo_vendor" mode="disabled">
    <param name="srcdir">helvum</param>
  </service>
</services>
Firstyear commented 3 years ago

Vendor is correctly checking out the code. Can I see the projects cargo_config file, and can you confirm in your spec you are putting it into .cargo/config so that vendor knows how to reference the git path offline? It should say something like:

[source.crates-io]
replace-with = "vendored-sources"

[source."https://github.com/gtk-rs/gtk-rs-core"]
git = "https://github.com/gtk-rs/gtk-rs-core"
replace-with = "vendored-sources"

[source."https://github.com/gtk-rs/gtk4-rs/"]
git = "https://github.com/gtk-rs/gtk4-rs/"
replace-with = "vendored-sources"

[source."https://gitlab.freedesktop.org/pipewire/pipewire-rs"]
git = "https://gitlab.freedesktop.org/pipewire/pipewire-rs"
branch = "main"
replace-with = "vendored-sources"

[source.vendored-sources]
directory = "vendor"
darix commented 3 years ago

home:darix:playground/helvum

Firstyear commented 3 years ago

Reading the spec file, I think you are not unpacking the vendor tar, which means it's an empty directory. That may be why it can't find this content.

darix commented 3 years ago

well yes wrong section. that fixed it.