diff mbox series

[v4,03/10] meta-selftest: hello-rs: Simple rust test recipe

Message ID 20231229114435.27810-4-alex.kiernan@gmail.com
State Accepted, archived
Commit 885e8e1fbfce79170ff7544dec5406d724da2560
Headers show
Series Stepwise rust upgrade 1.71.1 -> 1.74.1 | expand

Commit Message

Alex Kiernan Dec. 29, 2023, 11:44 a.m. UTC
Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
---

Changes in v4:
- Mark hello-rs as EXCLUDE_FROM_WORLD as it's not reproducible

 .../hello-rs/hello-rs-crates.inc              |  8 +++++++
 .../hello-rs/0001-Greet-OE-Core.patch         | 24 +++++++++++++++++++
 .../hello-rs/hello-rs_0.1.0.bb                | 22 +++++++++++++++++
 3 files changed, 54 insertions(+)
 create mode 100644 meta-selftest/recipes-extended/hello-rs/hello-rs-crates.inc
 create mode 100644 meta-selftest/recipes-extended/hello-rs/hello-rs/0001-Greet-OE-Core.patch
 create mode 100644 meta-selftest/recipes-extended/hello-rs/hello-rs_0.1.0.bb

Comments

Alexander Kanavin Dec. 29, 2023, 12:04 p.m. UTC | #1
Reproducibility exclusions should be listed in the test itself, so this
continues to be built in regular world builds (otherwise it may silently
regress).

Alex

On Fri 29. Dec 2023 at 13.44, Alex Kiernan <alex.kiernan@gmail.com> wrote:

> Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
> ---
>
> Changes in v4:
> - Mark hello-rs as EXCLUDE_FROM_WORLD as it's not reproducible
>
>  .../hello-rs/hello-rs-crates.inc              |  8 +++++++
>  .../hello-rs/0001-Greet-OE-Core.patch         | 24 +++++++++++++++++++
>  .../hello-rs/hello-rs_0.1.0.bb                | 22 +++++++++++++++++
>  3 files changed, 54 insertions(+)
>  create mode 100644
> meta-selftest/recipes-extended/hello-rs/hello-rs-crates.inc
>  create mode 100644
> meta-selftest/recipes-extended/hello-rs/hello-rs/0001-Greet-OE-Core.patch
>  create mode 100644 meta-selftest/recipes-extended/hello-rs/
> hello-rs_0.1.0.bb
>
> diff --git a/meta-selftest/recipes-extended/hello-rs/hello-rs-crates.inc
> b/meta-selftest/recipes-extended/hello-rs/hello-rs-crates.inc
> new file mode 100644
> index 000000000000..9646482b2875
> --- /dev/null
> +++ b/meta-selftest/recipes-extended/hello-rs/hello-rs-crates.inc
> @@ -0,0 +1,8 @@
> +# Autogenerated with 'bitbake -c update_crates hello-rs'
> +
> +# from Cargo.lock
> +SRC_URI += " \
> +    crate://crates.io/figlet-rs/0.1.5 \
> +"
> +
> +SRC_URI[figlet-rs-0.1.5.sha256sum] =
> "4742a071cd9694fc86f9fa1a08fa3e53d40cc899d7ee532295da2d085639fbc5"
> diff --git
> a/meta-selftest/recipes-extended/hello-rs/hello-rs/0001-Greet-OE-Core.patch
> b/meta-selftest/recipes-extended/hello-rs/hello-rs/0001-Greet-OE-Core.patch
> new file mode 100644
> index 000000000000..7569ccef7bbb
> --- /dev/null
> +++
> b/meta-selftest/recipes-extended/hello-rs/hello-rs/0001-Greet-OE-Core.patch
> @@ -0,0 +1,24 @@
> +From 3aea1ece0ca6ac0bf0ffe42736827af22966f767 Mon Sep 17 00:00:00 2001
> +From: Alex Kiernan <alexk@zuma.ai>
> +Date: Wed, 27 Dec 2023 09:55:48 +0000
> +Subject: [PATCH] Greet "OE-Core"
> +
> +Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
> +Upstream-Status: Inappropriate
> +---
> + src/main.rs | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/src/main.rs b/src/main.rs
> +index f4a310758b19..224eca65c38d 100644
> +--- a/src/main.rs
> ++++ b/src/main.rs
> +@@ -3,7 +3,7 @@ use hello_lib::greet;
> +
> + fn main() {
> +     let standard_font = FIGfont::standard().unwrap();
> +-    let greeting = greet(None);
> ++    let greeting = greet(Some("OE-Core"));
> +     let figure = standard_font.convert(&greeting);
> +     println!("{}", figure.unwrap());
> + }
> diff --git a/meta-selftest/recipes-extended/hello-rs/hello-rs_0.1.0.bb
> b/meta-selftest/recipes-extended/hello-rs/hello-rs_0.1.0.bb
> new file mode 100644
> index 000000000000..9a136f29788e
> --- /dev/null
> +++ b/meta-selftest/recipes-extended/hello-rs/hello-rs_0.1.0.bb
> @@ -0,0 +1,22 @@
> +SUMMARY = "Simple hello world example"
> +HOMEPAGE = "https://github.com/akiernan/hello-bin"
> +LICENSE = "Unlicense"
> +LIC_FILES_CHKSUM = "file://LICENSE;md5=7246f848faa4e9c9fc0ea91122d6e680"
> +
> +SRC_URI = "git://
> github.com/akiernan/hello-bin.git;protocol=https;branch=main;subpath=rust
> \
> +           file://0001-Greet-OE-Core.patch \
> +           git://
> github.com/akiernan/hello-lib.git;protocol=https;branch=main;name=hello-lib;destsuffix=hello-lib;type=git-dependency
> \
> +          "
> +SRCREV = "d3d096eda182644868f8e7458dcfa538ff637db3"
> +
> +SRCREV_FORMAT .= "_hello-lib"
> +SRCREV_hello-lib = "59c84574e844617043cf337bc8fa537cf87ad8ae"
> +
> +S = "${WORKDIR}/rust"
> +
> +inherit cargo cargo-update-recipe-crates ptest-cargo
> +
> +# Remove this when the recipe is reproducible
> +EXCLUDE_FROM_WORLD = "1"
> +
> +require ${BPN}-crates.inc
> --
> 2.39.0
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#193006):
> https://lists.openembedded.org/g/openembedded-core/message/193006
> Mute This Topic: https://lists.openembedded.org/mt/103415636/1686489
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [
> alex.kanavin@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>
Richard Purdie Dec. 30, 2023, 12:41 a.m. UTC | #2
On Fri, 2023-12-29 at 14:04 +0200, Alexander Kanavin wrote:
> Reproducibility exclusions should be listed in the test itself, so
> this continues to be built in regular world builds (otherwise it may
> silently regress).

FWIW this is what the zvariant recipe was doing and the recipe is in
meta-selftest...

I'm torn on it to be honest.

Cheers,

Richard
Alex Kiernan Dec. 30, 2023, 10:40 a.m. UTC | #3
On Sat, Dec 30, 2023 at 12:41 AM Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
>
> On Fri, 2023-12-29 at 14:04 +0200, Alexander Kanavin wrote:
> > Reproducibility exclusions should be listed in the test itself, so
> > this continues to be built in regular world builds (otherwise it may
> > silently regress).
>
> FWIW this is what the zvariant recipe was doing and the recipe is in
> meta-selftest...
>
> I'm torn on it to be honest.
>

I'm fine with changing it (and I did basically copy from zvariant
without really thinking about it), but I do feel that leaking what's a
pretty poor recipe name (`hello-rs`) outside of meta-selftest into the
wider ecosystem wouldn't be ideal as the recipe itself is basically
useless other than for this specific test purpose.

Mostly I just want to get the series merged before anything else
changes and we find yet another thing which needs fixing; also I think
I've got 1.75.0 building now, which obviously sits on top of this
series!
Richard Purdie Dec. 30, 2023, 11:10 a.m. UTC | #4
On Sat, 2023-12-30 at 10:40 +0000, Alex Kiernan wrote:
> On Sat, Dec 30, 2023 at 12:41 AM Richard Purdie
> <richard.purdie@linuxfoundation.org> wrote:
> > 
> > On Fri, 2023-12-29 at 14:04 +0200, Alexander Kanavin wrote:
> > > Reproducibility exclusions should be listed in the test itself, so
> > > this continues to be built in regular world builds (otherwise it may
> > > silently regress).
> > 
> > FWIW this is what the zvariant recipe was doing and the recipe is in
> > meta-selftest...
> > 
> > I'm torn on it to be honest.
> > 
> 
> I'm fine with changing it (and I did basically copy from zvariant
> without really thinking about it), but I do feel that leaking what's a
> pretty poor recipe name (`hello-rs`) outside of meta-selftest into the
> wider ecosystem wouldn't be ideal as the recipe itself is basically
> useless other than for this specific test purpose.
> 
> Mostly I just want to get the series merged before anything else
> changes and we find yet another thing which needs fixing; also I think
> I've got 1.75.0 building now, which obviously sits on top of this
> series!

I agree, it doesn't really change what we're doing and moves things
forward so I'm considering it as a base to build on if/as/when we can.
As such the series merged, thanks! :).

Cheers,

Richard
diff mbox series

Patch

diff --git a/meta-selftest/recipes-extended/hello-rs/hello-rs-crates.inc b/meta-selftest/recipes-extended/hello-rs/hello-rs-crates.inc
new file mode 100644
index 000000000000..9646482b2875
--- /dev/null
+++ b/meta-selftest/recipes-extended/hello-rs/hello-rs-crates.inc
@@ -0,0 +1,8 @@ 
+# Autogenerated with 'bitbake -c update_crates hello-rs'
+
+# from Cargo.lock
+SRC_URI += " \
+    crate://crates.io/figlet-rs/0.1.5 \
+"
+
+SRC_URI[figlet-rs-0.1.5.sha256sum] = "4742a071cd9694fc86f9fa1a08fa3e53d40cc899d7ee532295da2d085639fbc5"
diff --git a/meta-selftest/recipes-extended/hello-rs/hello-rs/0001-Greet-OE-Core.patch b/meta-selftest/recipes-extended/hello-rs/hello-rs/0001-Greet-OE-Core.patch
new file mode 100644
index 000000000000..7569ccef7bbb
--- /dev/null
+++ b/meta-selftest/recipes-extended/hello-rs/hello-rs/0001-Greet-OE-Core.patch
@@ -0,0 +1,24 @@ 
+From 3aea1ece0ca6ac0bf0ffe42736827af22966f767 Mon Sep 17 00:00:00 2001
+From: Alex Kiernan <alexk@zuma.ai>
+Date: Wed, 27 Dec 2023 09:55:48 +0000
+Subject: [PATCH] Greet "OE-Core"
+
+Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
+Upstream-Status: Inappropriate
+---
+ src/main.rs | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/main.rs b/src/main.rs
+index f4a310758b19..224eca65c38d 100644
+--- a/src/main.rs
++++ b/src/main.rs
+@@ -3,7 +3,7 @@ use hello_lib::greet;
+ 
+ fn main() {
+     let standard_font = FIGfont::standard().unwrap();
+-    let greeting = greet(None);
++    let greeting = greet(Some("OE-Core"));
+     let figure = standard_font.convert(&greeting);
+     println!("{}", figure.unwrap());
+ }
diff --git a/meta-selftest/recipes-extended/hello-rs/hello-rs_0.1.0.bb b/meta-selftest/recipes-extended/hello-rs/hello-rs_0.1.0.bb
new file mode 100644
index 000000000000..9a136f29788e
--- /dev/null
+++ b/meta-selftest/recipes-extended/hello-rs/hello-rs_0.1.0.bb
@@ -0,0 +1,22 @@ 
+SUMMARY = "Simple hello world example"
+HOMEPAGE = "https://github.com/akiernan/hello-bin"
+LICENSE = "Unlicense"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=7246f848faa4e9c9fc0ea91122d6e680"
+
+SRC_URI = "git://github.com/akiernan/hello-bin.git;protocol=https;branch=main;subpath=rust \
+           file://0001-Greet-OE-Core.patch \
+           git://github.com/akiernan/hello-lib.git;protocol=https;branch=main;name=hello-lib;destsuffix=hello-lib;type=git-dependency \
+	   "
+SRCREV = "d3d096eda182644868f8e7458dcfa538ff637db3"
+
+SRCREV_FORMAT .= "_hello-lib"
+SRCREV_hello-lib = "59c84574e844617043cf337bc8fa537cf87ad8ae"
+
+S = "${WORKDIR}/rust"
+
+inherit cargo cargo-update-recipe-crates ptest-cargo
+
+# Remove this when the recipe is reproducible
+EXCLUDE_FROM_WORLD = "1"
+
+require ${BPN}-crates.inc