Skip to contentSkip to conversation

*** SUBJECT HERE ***

PATCH In review Kareem Ibrahim 4 participants 7 messages Nov 22, 2024

lore
Share & tools
lore
#0 lore raw

cover *** SUBJECT HERE ***

This is a fix for network error "Could not resolve hostname" error in recipes inheriting cargo that needs remote crates

Kareem Ibrahim (1):
Added a new cargo-online bbclass for recipes requiring remote crates

 meta/classes/cargo-online.bbclass | 7 +++++++
 1 file changed, 7 insertions(+)
 create mode 100644 meta/classes/cargo-online.bbclass
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/1 Added a new cargo-online bbclass for recipes requiring remote crates

- 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

---
 meta/classes/cargo-online.bbclass | 7 +++++++
 1 file changed, 7 insertions(+)
 create mode 100644 meta/classes/cargo-online.bbclass
meta/classes/cargo-online.bbclass new file +7 -0
new file mode 100644
index 0000000000..175c94e09d
@@ -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
Signature · 1 line
2.25.1
#2 lore raw

Re: [OE-core] [PATCH 1/1] Added a new cargo-online bbclass for recipes requiring remote crates

This isn't a fix, it's just very bad work around, see:
https://git.openembedded.org/openembedded-core/tree/meta/classes-recipe/cargo-update-recipe-crates.bbclass
which you can use to avoid needing the network access during do_compile.

Quoted 40 lines · Kareem Ibrahim via lists.openembedded.org

- 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

---
 meta/classes/cargo-online.bbclass | 7 +++++++
 1 file changed, 7 insertions(+)
 create mode 100644 meta/classes/cargo-online.bbclass
meta/classes/cargo-online.bbclass new file +7 -1
new file mode 100644
index 0000000000..175c94e09d
@@ -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

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#207615): https://lists.openembedded.org/g/openembedded-core/message/207615
Mute This Topic: https://lists.openembedded.org/mt/109721978/3617156
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#3 lore raw

Re: [OE-core] [PATCH 1/1] Added a new cargo-online bbclass for recipes requiring remote crates

Okay, nobody forced you to reply. Your review was terrible. If it is not ok you could simply say that for a reason, but there were thousands of better way to say that.

Quoted 48 lines · On Fri, 22 Nov 2024, 15:40 Martin Jansa, <[email protected]> wrote:

This isn't a fix, it's just very bad work around, see:

https://git.openembedded.org/openembedded-core/tree/meta/classes-recipe/cargo-update-recipe-crates.bbclass
which you can use to avoid needing the network access during do_compile.

Quoted 2 lines · Kareem Ibrahim via lists.openembedded.org

- This change was intended to abstract user from having to set compile

network flag to get remote crates

Quoted 2 lines

- 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"

Quoted 1 line

- And after some hours of debugging I noticed that cargo inherited by

recipe needs remote crates during do_compile of the cargo.bbclass

Quoted 2 lines

- 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

Review

Quoted 8 lines
---
 meta/classes/cargo-online.bbclass | 7 +++++++
 1 file changed, 7 insertions(+)
 create mode 100644 meta/classes/cargo-online.bbclass
(quoted diff) +0 -0

b/meta/classes/cargo-online.bbclass

Quoted 19 lines

new file mode 100644
index 0000000000..175c94e09d

meta/classes/cargo-online.bbclass new file +7 -1
@@ -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

#4 lore raw

Re: [OE-core] [PATCH 1/1] Added a new cargo-online bbclass for recipes requiring remote crates

I'm sorry you took it personally, I just wanted to help you. Next time I won't.

Quoted 52 lines · Karim Ibrahim

Okay, nobody forced you to reply. Your review was terrible. If it is not ok you could simply say that for a reason, but there were thousands of better way to say that.

Quoted 48 lines · On Fri, 22 Nov 2024, 15:40 Martin Jansa, <[email protected]> wrote:

This isn't a fix, it's just very bad work around, see:
https://git.openembedded.org/openembedded-core/tree/meta/classes-recipe/cargo-update-recipe-crates.bbclass
which you can use to avoid needing the network access during do_compile.

Quoted 40 lines · Kareem Ibrahim via lists.openembedded.org

- 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

---
 meta/classes/cargo-online.bbclass | 7 +++++++
 1 file changed, 7 insertions(+)
 create mode 100644 meta/classes/cargo-online.bbclass
meta/classes/cargo-online.bbclass new file +7 -1
new file mode 100644
index 0000000000..175c94e09d
@@ -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

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#207615): https://lists.openembedded.org/g/openembedded-core/message/207615
Mute This Topic: https://lists.openembedded.org/mt/109721978/3617156
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#5 lore raw

Patchtest results for [PATCH 1/1] Added a new cargo-online bbclass for recipes requiring remote crates

In reply to Kareem Ibrahim

Thank you for your submission. Patchtest identified one or more issues with the patch. Please see the log below for more information:

---
Testing patch /home/patchtest/share/mboxes/1-1-Added-a-new-cargo-online-bbclass-for-recipes-requiring-remote-crates.patch

FAIL: test shortlog format: Commit shortlog (first line of commit message) should follow the format "<target>: <summary>" (test_mbox.TestMbox.test_shortlog_format)

PASS: test Signed-off-by presence (test_mbox.TestMbox.test_signed_off_by_presence)
PASS: test author valid (test_mbox.TestMbox.test_author_valid)
PASS: test commit message presence (test_mbox.TestMbox.test_commit_message_presence)
PASS: test commit message user tags (test_mbox.TestMbox.test_commit_message_user_tags)
PASS: test max line length (test_metadata.TestMetadata.test_max_line_length)
PASS: test mbox format (test_mbox.TestMbox.test_mbox_format)
PASS: test non-AUH upgrade (test_mbox.TestMbox.test_non_auh_upgrade)
PASS: test shortlog length (test_mbox.TestMbox.test_shortlog_length)
PASS: test target mailing list (test_mbox.TestMbox.test_target_mailing_list)

SKIP: pretest pylint: No python related patches, skipping test (test_python_pylint.PyLint.pretest_pylint)
SKIP: pretest src uri left files: No modified recipes, skipping pretest (test_metadata.TestMetadata.pretest_src_uri_left_files)
SKIP: test CVE check ignore: No modified recipes or older target branch, skipping test (test_metadata.TestMetadata.test_cve_check_ignore)
SKIP: test CVE tag format: No new CVE patches introduced (test_patch.TestPatch.test_cve_tag_format)
SKIP: test Signed-off-by presence: No new CVE patches introduced (test_patch.TestPatch.test_signed_off_by_presence)
SKIP: test Upstream-Status presence: No new CVE patches introduced (test_patch.TestPatch.test_upstream_status_presence_format)
SKIP: test bugzilla entry format: No bug ID found (test_mbox.TestMbox.test_bugzilla_entry_format)
SKIP: test lic files chksum modified not mentioned: No modified recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_modified_not_mentioned)
SKIP: test lic files chksum presence: No added recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_presence)
SKIP: test license presence: No added recipes, skipping test (test_metadata.TestMetadata.test_license_presence)
SKIP: test pylint: No python related patches, skipping test (test_python_pylint.PyLint.test_pylint)
SKIP: test series merge on head: Merge test is disabled for now (test_mbox.TestMbox.test_series_merge_on_head)
SKIP: test src uri left files: No modified recipes, skipping pretest (test_metadata.TestMetadata.test_src_uri_left_files)
SKIP: test summary presence: No added recipes, skipping test (test_metadata.TestMetadata.test_summary_presence)

---

Please address the issues identified and
submit a new revision of the patch, or alternatively, reply to this email with an explanation of why the patch should be accepted. If you believe these results are due to an error in patchtest, please submit a bug at https://bugzilla.yoctoproject.org/ (use the 'Patchtest' category under 'Yocto Project Subprojects'). For more information on specific failures, see: https://wiki.yoctoproject.org/wiki/Patchtest. Thank you!

#6 lore raw

Re: [OE-core] [PATCH 1/1] Added a new cargo-online bbclass for recipes requiring remote crates

In reply to Kareem Ibrahim
Quoted 20 lines · Kareem Ibrahim via lists.openembedded.org

- 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

---
 meta/classes/cargo-online.bbclass | 7 +++++++

 1 file changed, 7 insertions(+)

 create mode 100644 meta/classes/cargo-online.bbclass

meta/classes/cargo-online.bbclass new file +0 -0
new file mode 100644
index 0000000000..175c94e09d

meta/classes/cargo-online.bbclass line 7

Quoted 8 lines
meta/classes/cargo-online.bbclass new file +7 -0
@@ -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

We can't take a change like this unfortunately. Fetching outside do_fetch means DL_DIR is not populated, our source mirrors would work and our software/license manifests are incomplete, all things which we have people relying upon (including for legal review).

As has been mentioned, we have made changes to cargo since kirkstone to allow all the crates to be specified in SRC_URI so I'd hope there is no need for this change in more recent versions of the project.

Cheers,

Richard