meta-rust / cargo-bitbake

cargo extension that can generate BitBake recipes utilizing the classes from meta-rust
Apache License 2.0
83 stars 57 forks source link

Package not found when using git url in dependency #69

Open kkettinger opened 1 year ago

kkettinger commented 1 year ago

When using a git url in a dependency, the following error appears:

    Updating git repository `https://github.com/slint-ui/slint`
error: no matching package named `slint` found
location searched: https://github.com/slint-ui/slint?branch=master#ef82edca
required by package `slint-text-rendering-artifact-demo v0.1.0 (/home/devel/repos/slint-text-rendering-artifact-demo)`

The Cargo.toml looks like this:

[package]
name = "slint-text-rendering-artifact-demo"
version = "0.1.0"
edition = "2021"
build = "build.rs"

[dependencies]
slint = { git = "https://github.com/slint-ui/slint", branch = "master" }

[build-dependencies]
slint-build = { git = "https://github.com/slint-ui/slint", branch = "master" }
kkettinger commented 1 year ago

When updating to the latest cargo and git2 version (see #70), cargo bitbake does understand git-urls in the dependency section. Here an example that now works:

[package]
name = "slint-text-rendering-artifact-demo"
version = "0.1.0"
edition = "2021"
build = "build.rs"

[dependencies]
slint = { git = "https://github.com/slint-ui/slint", rev = "9c21c7b812936953d992704f3ccc6cc081a7fbad", features=["backend-qt", "backend-winit-wayland", "renderer-winit-femtovg", "renderer-winit-software"] }

[build-dependencies]
slint-build = { git = "https://github.com/slint-ui/slint", rev = "9c21c7b812936953d992704f3ccc6cc081a7fbad" }

I noticed that when using branch = "master", the resulting *.bb file does not work correctly, as the bitbake fetcher tries to fetch a wrong revision. If you supply a revision in the Cargo.toml, everything works.