Hello list,

In the course of YOCTO #15104
<https://bugzilla.yoctoproject.org/show_bug.cgi?id=15104>  , I finally
found the issue was due to a missing Cargo.lock file at the root of the
project (which is pretty usual for a Rust project from git since Cargo.lock
is only required when publishing on the crates registry).

With a Cargo.lock correctly placed, the patch process made by
cargo_common.bbclass works perfectly fine even with a virtual manifest.

I often encountered issues that were in the end due to a missing Cargo.lock
and I think we all agree on this list (I didn't crawl the mail archives, I
talked from my memory) that this file is absolutely required when building
a rust project under yocto.
(especially for reproducible build)

I'm currently testing a patch which will replace --offline cargo build
flags with --frozen (which supersedes --offline mode since it prevents
network access but also Cargo.lock to be present and up to date).

I have two questions though:
  1) rust-hello-world doesn't embed a Cargo.lock (and doesn't need to since
it had zero dependencies) , considering that we now have a more "real"
recipe (zvariant) that is used within selftest, would it be acceptable to
suppress rust-hello-world ?
  2) below is kind of message we will have when using --frozen with an
absent Cargo.lock:

| error: failed to get `glib` as a dependency of package `zvariant v3.12.0
(/home/fmartinsons/TAPOS_build/build-tapos/tmp/work/corei7-64-tapos-linux/zbus/3.11.0-r0/git/zvariant)`
|
| Caused by:
|   failed to load source for dependency `glib`
|
| Caused by:
|   Unable to update https://github.com/gtk-rs/glib?rev=c9ee583cea0
|
| Caused by:
|   failed to fetch into:
/home/fmartinsons/TAPOS_build/build-tapos/tmp/work/corei7-64-tapos-linux/zbus/3.11.0-r0/cargo_home/git/db/glib-928cf7b282977403
|
| Caused by:
|   attempting to update a git repository, but --frozen was specified

I think it is not very clear that the root cause is a missing Cargo.lock ,
so I'm wondering if a specific bitbake ops (do_compile_prepend) would not
be  better to check for Cargo.lock and output an explicit message (it
doesn't prevent to keep --frozen anyway). What do you think ?

PS: I copied Randy as the maintainer of rust-hello-world but also  the
ticket assignee.
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#184635): 
https://lists.openembedded.org/g/openembedded-core/message/184635
Mute This Topic: https://lists.openembedded.org/mt/100254129/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to