Bug 14810

Summary: cargo-cross-canadian fails to find secondary dependencies
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Nischala Yelchuri <Nischala.Yelchuri>
Component: devtools / tool chainAssignee: Sundeep KOKKONDA <sundeep.kokkonda>
Status: RESOLVED OBSOLETE QA Contact:
Severity: normal    
Priority: Medium CC: alejandro, meta.mr.watcher, meta.watcher, richard.purdie, yashinde145
Version: unspecified   
Target Milestone: 4.1   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Nischala Yelchuri 2022-05-20 19:11:06 UTC
When trying to build cargo-cross-canadian, do_compile fails if a dependency is added to one of its dependencies.

For example, adding the following to the curl recipe:

+DEPENDS += "libssh2"
+EXTRA_OECONF:append = " --with-libssh2"

causes the build for bitbake cargo-cross-canadian-aarch64 to fail.

|   cargo:warning=In file included from libgit2/src/common.h:103,
|   cargo:warning=                 from libgit2/src/transports/winhttp.c:8:
|   cargo:warning=libgit2/src/thread.h: In function 'git_atomic__swap':
|   cargo:warning=libgit2/src/thread.h:184:9: warning: argument 3 of '__atomic_exchange' discards 'volatile' qualifier [-Wincompatible-pointer-types]
|   cargo:warning=  184 |         __atomic_exchange(ptr, &newval, &foundval, __ATOMIC_SEQ_CST);
|   cargo:warning=      |         ^~~~~~~~~~~~~~~~~
|   cargo:warning=libgit2/src/transports/ssh.c: At top level:
|   cargo:warning=libgit2/src/transports/ssh.c:11:10: fatal error: libssh2.h: No such file or directory
|   cargo:warning=   11 | #include <libssh2.h>
|   cargo:warning=      |          ^~~~~~~~~~~
|   cargo:warning=compilation terminated.


cargo-cross-canadian is failing to find libssh2.h. 

Manually adding nativesdk-libssh2 to cargo-cross-canadian DEPENDS fixes the issue. Is this the expected outcome or should libssh2 dependency be automatically included since it is a dependency for curl?
Comment 1 Richard Purdie 2022-05-26 12:56:58 UTC
cargo shouldn't be auto-detecting dependencies like this but should only be building the things it is configured with. We should probably have some explicit configuration in the cargo recipe?
Comment 2 Yash Shinde 2022-09-13 16:50:49 UTC
With latest sources pulled in and trying to build 'cargo-cross-canadian-aarch64' with the given specifications in the description for curl recipe, the given variant is not found-


 ERROR: Nothing PROVIDES 'cargo-cross-canadian-aarch64'. Close matches: 
  gcc-cross-canadian-aarch64
  gdb-cross-canadian-aarch64
  go-cross-canadian-aarch64


git log shows the cargo-cross-canadian support was dropped and SDK env moved to rust-cross-canadian with commit 251f55374d26b5c24d8833aa87c95432be8b81b2 (cargo: Drop cross-canadian variant and fix/use nativesdk).

And, bitbake build with 'rust-cross-canadian-aarch64' command is done successfully. So, this issue is not reproducible with latest sources pulled with rust-cross-canadian-aarch64 command.

Can this issue be closed?
Comment 3 Yash Shinde 2022-09-19 05:45:54 UTC
Issue closed as it cannot be reproduced with latest sources
Comment 4 Yash Shinde 2022-09-19 05:57:14 UTC
Issue closed as it cannot be reproduced with latest sources.