Skip to content
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

Generated recipe includes dependencies of all projects in a workspace, not just the current project #17

Open
pbrkr opened this issue Sep 19, 2020 · 1 comment

Comments

@pbrkr
Copy link
Contributor

pbrkr commented Sep 19, 2020

I have a workspace with two simple projects in it: a hello project with no dependencies and a print-rand project that depends on the rand crate. This workspace can be seen here: https://gitlab.com/pbarker.dev/learn-rust/-/tree/711141cb58ccb241b1c6b13454746bd28b106de7

If I run cargo bitbake in the directory of the hello project, the dependencies of the print-rand project are also included in SRC_URI.

[pbarker@ar2 hello]$ cargo bitbake --version
cargo-bitbake 0.3.14
[pbarker@ar2 hello]$ cargo bitbake
Wrote: hello_0.1.0.bb
[pbarker@ar2 hello]$ cat hello_0.1.0.bb 
# Auto-Generated by cargo-bitbake 0.3.14
#
inherit cargo

# If this is git based prefer versioned ones if they exist
# DEFAULT_PREFERENCE = "-1"

# how to get hello could be as easy as but default to a git checkout:
# SRC_URI += "crate://crates.io/hello/0.1.0"
SRC_URI += "git://git@gitlab.com/pbarker.dev/learn-rust.git;protocol=ssh;nobranch=1;branch=dev"
SRCREV = "711141cb58ccb241b1c6b13454746bd28b106de7"
S = "${WORKDIR}/git"
CARGO_SRC_DIR = "hello"
PV_append = ".AUTOINC+711141cb58"

# please note if you have entries that do not begin with crate://
# you must change them to how that package can be fetched
SRC_URI += " \
    crate://crates.io/cfg-if/0.1.10 \
    crate://crates.io/getrandom/0.1.15 \
    crate://crates.io/libc/0.2.77 \
    crate://crates.io/ppv-lite86/0.2.9 \
    crate://crates.io/rand/0.7.3 \
    crate://crates.io/rand_chacha/0.2.2 \
    crate://crates.io/rand_core/0.5.1 \
    crate://crates.io/rand_hc/0.2.0 \
    crate://crates.io/wasi/0.9.0+wasi-snapshot-preview1 \
"



# FIXME: update generateme with the real MD5 of the license file
LIC_FILES_CHKSUM = " \
    file://hello/LICENSE;md5=86d3f3a95c324c9479bd8986968f4327 \
"

SUMMARY = "Hello World application"
HOMEPAGE = "https://gitlab.com/pbarker.dev/learn-rust/-/tree/dev/hello"
LICENSE = "Apache-2.0"

# includes this file if it exists but does not fail
# this is useful for anything you may want to override from
# what cargo-bitbake generates.
include hello-${PV}.inc
include hello.inc

I suspect that the dependencies are being resolved at the workspace level instead of at the project level but I'm not familiar enough with the cargo API to be sure on this or to suggest how to fix it.

@pbrkr pbrkr changed the title Generate recipe includes dependencies of all projects in a workspace, not just the current project Generated recipe includes dependencies of all projects in a workspace, not just the current project Sep 19, 2020
@MaartenvMegen
Copy link

I can confirm this behavior is still present on cargo-bitbake 0.3.15 and is interfering with our workflow. It does seem to match with the way meta-rust pulls in sources during bitbake compilation. Because manually removing the unneeded dependencies from the recipe causes the bitbake build to fail.

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

2 participants