Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Kareem Ibrahim <karem.ibrahim46@gmail.com>
To: openembedded-core@lists.openembedded.org
Cc: Kareem Ibrahim <karem.ibrahim46@gmail.com>
Subject: [PATCH 1/1] Added a new cargo-online bbclass for recipes requiring remote crates
Date: Fri, 22 Nov 2024 15:31:40 +0200	[thread overview]
Message-ID: <20241122133140.1627-2-karem.ibrahim46@gmail.com> (raw)
In-Reply-To: <20241122133140.1627-1-karem.ibrahim46@gmail.com>

- This change was intended to abstract user from having to set compile network flag to get remote crates
- as network access was disabled by default in kirkstone version
- I faced an do_compile error with bitbaking Qualcomm qcrosvm under yocto kirkstone with message "Could not resolve host: github.com"
- And after some hours of debugging I noticed that cargo inherited by recipe needs remote crates during do_compile of the cargo.bbclass
- It was fixed by adding line do_compile[network] = "1" to the recipe
- So I found it more convenient, since cargo build usually need network access, to abstract users from these details of cargo.bbclass do_compile

Signed-off-by: Kareem Ibrahim <karem.ibrahim46@gmail.com>
---
 meta/classes/cargo-online.bbclass | 7 +++++++
 1 file changed, 7 insertions(+)
 create mode 100644 meta/classes/cargo-online.bbclass

diff --git a/meta/classes/cargo-online.bbclass b/meta/classes/cargo-online.bbclass
new file mode 100644
index 0000000000..175c94e09d
--- /dev/null
+++ b/meta/classes/cargo-online.bbclass
@@ -0,0 +1,7 @@
+# This bbclass is added to abstract recipes writers from
+# having to set do_compile network flag to 1
+# if his cargo package need external remote crates
+# as network access was disabled by default since kirkstone version
+
+inherit cargo
+do_compile[network] = "1"
\ No newline at end of file
-- 
2.25.1



  reply	other threads:[~2024-11-22 13:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-22 13:31 [PATCH 0/1] *** SUBJECT HERE *** Kareem Ibrahim
2024-11-22 13:31 ` Kareem Ibrahim [this message]
2024-11-22 13:40   ` [OE-core] [PATCH 1/1] Added a new cargo-online bbclass for recipes requiring remote crates Martin Jansa
2024-11-22 15:18     ` Kareem Ibrahim
2024-11-22 16:28       ` Martin Jansa
2024-11-22 13:46   ` Patchtest results for " patchtest
2024-11-22 17:02   ` [OE-core] " Richard Purdie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241122133140.1627-2-karem.ibrahim46@gmail.com \
    --to=karem.ibrahim46@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox