* [OE-Core][PATCH v2 00/10] Add rust runtime tests
@ 2022-12-21 12:52 Alex Kiernan
2022-12-21 12:52 ` [OE-Core][PATCH v2 01/10] oeqa/runtime/rust: Add basic compile/run test Alex Kiernan
` (10 more replies)
0 siblings, 11 replies; 16+ messages in thread
From: Alex Kiernan @ 2022-12-21 12:52 UTC (permalink / raw)
To: openembedded-core; +Cc: Alex Kiernan
This series adds runtime tests for rust and cargo, merges (most of) the
include files into the base recipes and fixes target cargo builds.
Also add SDK_TOOLCHAIN_LANGS for selection of target toolchains as part
of packagegroup-core-sdk.
Changes in v2:
- Drop rust.inc/rust.bb merge, not actually made use of in the change
set
- Reorder so cargo test goes after build fixes
Alex Kiernan (10):
oeqa/runtime/rust: Add basic compile/run test
libstd-rs: Merge .inc into .bb
libstd-rs: Move source directory to library/test
rust-llvm: Merge .inc into .bb
rust-llvm: Update LLVM_VERSION to match embedded version
cargo: Merge .inc into .bb
cargo: Extend DEBUG_PREFIX_MAP to cover vendor
packagegroup-rust-sdk-target: Add Rust SDK target packagegroup
packagegroup-core-sdk: Add SDK toolchain language selection support
oeqa/runtime/rust: Add cargo test
meta/lib/oeqa/files/test.rs | 2 +
meta/lib/oeqa/runtime/cases/rust.py | 41 ++++++++++
.../packagegroups/packagegroup-core-sdk.bb | 10 ++-
.../packagegroup-rust-sdk-target.bb | 14 ++++
meta/recipes-devtools/cargo/cargo.inc | 69 ----------------
meta/recipes-devtools/cargo/cargo_1.66.0.bb | 73 ++++++++++++++++-
meta/recipes-devtools/rust/libstd-rs.inc | 40 ---------
.../recipes-devtools/rust/libstd-rs_1.66.0.bb | 46 ++++++++++-
meta/recipes-devtools/rust/rust-llvm.inc | 78 ------------------
.../recipes-devtools/rust/rust-llvm_1.66.0.bb | 82 ++++++++++++++++++-
10 files changed, 260 insertions(+), 195 deletions(-)
create mode 100644 meta/lib/oeqa/files/test.rs
create mode 100644 meta/recipes-core/packagegroups/packagegroup-rust-sdk-target.bb
delete mode 100644 meta/recipes-devtools/cargo/cargo.inc
delete mode 100644 meta/recipes-devtools/rust/libstd-rs.inc
delete mode 100644 meta/recipes-devtools/rust/rust-llvm.inc
--
2.39.0
^ permalink raw reply [flat|nested] 16+ messages in thread
* [OE-Core][PATCH v2 01/10] oeqa/runtime/rust: Add basic compile/run test
2022-12-21 12:52 [OE-Core][PATCH v2 00/10] Add rust runtime tests Alex Kiernan
@ 2022-12-21 12:52 ` Alex Kiernan
2022-12-21 12:52 ` [OE-Core][PATCH v2 02/10] libstd-rs: Merge .inc into .bb Alex Kiernan
` (9 subsequent siblings)
10 siblings, 0 replies; 16+ messages in thread
From: Alex Kiernan @ 2022-12-21 12:52 UTC (permalink / raw)
To: openembedded-core; +Cc: Alex Kiernan
Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
---
Changes in v2:
- Drop rust.inc/rust.bb merge, not actually made use of in the change
set
- Reorder so cargo test goes after build fixes
meta/lib/oeqa/files/test.rs | 2 ++
meta/lib/oeqa/runtime/cases/rust.py | 24 ++++++++++++++++++++++++
2 files changed, 26 insertions(+)
create mode 100644 meta/lib/oeqa/files/test.rs
diff --git a/meta/lib/oeqa/files/test.rs b/meta/lib/oeqa/files/test.rs
new file mode 100644
index 000000000000..f79c691f0853
--- /dev/null
+++ b/meta/lib/oeqa/files/test.rs
@@ -0,0 +1,2 @@
+fn main() {
+}
diff --git a/meta/lib/oeqa/runtime/cases/rust.py b/meta/lib/oeqa/runtime/cases/rust.py
index 55b280d61d8a..186bb0d79e15 100644
--- a/meta/lib/oeqa/runtime/cases/rust.py
+++ b/meta/lib/oeqa/runtime/cases/rust.py
@@ -8,6 +8,30 @@ from oeqa.runtime.case import OERuntimeTestCase
from oeqa.core.decorator.depends import OETestDepends
from oeqa.runtime.decorator.package import OEHasPackage
+class RustCompileTest(OERuntimeTestCase):
+
+ @classmethod
+ def setUp(cls):
+ dst = '/tmp/'
+ src = os.path.join(cls.tc.files_dir, 'test.rs')
+ cls.tc.target.copyTo(src, dst)
+
+ @classmethod
+ def tearDown(cls):
+ files = '/tmp/test.rs /tmp/test'
+ cls.tc.target.run('rm %s' % files)
+
+ @OETestDepends(['ssh.SSHTest.test_ssh'])
+ @OEHasPackage(['rust'])
+ def test_rust_compile(self):
+ status, output = self.target.run('rustc /tmp/test.rs -o /tmp/test')
+ msg = 'rust compile failed, output: %s' % output
+ self.assertEqual(status, 0, msg=msg)
+
+ status, output = self.target.run('/tmp/test')
+ msg = 'running compiled file failed, output: %s' % output
+ self.assertEqual(status, 0, msg=msg)
+
class RustHelloworldTest(OERuntimeTestCase):
@OETestDepends(['ssh.SSHTest.test_ssh'])
@OEHasPackage(['rust-hello-world'])
--
2.39.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [OE-Core][PATCH v2 02/10] libstd-rs: Merge .inc into .bb
2022-12-21 12:52 [OE-Core][PATCH v2 00/10] Add rust runtime tests Alex Kiernan
2022-12-21 12:52 ` [OE-Core][PATCH v2 01/10] oeqa/runtime/rust: Add basic compile/run test Alex Kiernan
@ 2022-12-21 12:52 ` Alex Kiernan
2022-12-21 12:52 ` [OE-Core][PATCH v2 03/10] libstd-rs: Move source directory to library/test Alex Kiernan
` (8 subsequent siblings)
10 siblings, 0 replies; 16+ messages in thread
From: Alex Kiernan @ 2022-12-21 12:52 UTC (permalink / raw)
To: openembedded-core; +Cc: Alex Kiernan
Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
---
(no changes since v1)
meta/recipes-devtools/rust/libstd-rs.inc | 40 -------------------
.../recipes-devtools/rust/libstd-rs_1.66.0.bb | 40 ++++++++++++++++++-
2 files changed, 39 insertions(+), 41 deletions(-)
delete mode 100644 meta/recipes-devtools/rust/libstd-rs.inc
diff --git a/meta/recipes-devtools/rust/libstd-rs.inc b/meta/recipes-devtools/rust/libstd-rs.inc
deleted file mode 100644
index 44cf683837db..000000000000
--- a/meta/recipes-devtools/rust/libstd-rs.inc
+++ /dev/null
@@ -1,40 +0,0 @@
-SUMMARY = "Rust standard libaries"
-HOMEPAGE = "http://www.rust-lang.org"
-SECTION = "devel"
-LICENSE = "(MIT | Apache-2.0) & Unicode-TOU"
-LIC_FILES_CHKSUM = "file://../../COPYRIGHT;md5=92289ed52a60b63ab715612ad2915603"
-
-RUSTLIB_DEP = ""
-inherit cargo
-
-DEPENDS:append:libc-musl = " libunwind"
-# rv32 does not have libunwind ported yet
-DEPENDS:remove:riscv32 = "libunwind"
-DEPENDS:remove:riscv64 = "libunwind"
-
-# Embed bitcode in order to allow compiling both with and without LTO
-RUSTFLAGS += "-Cembed-bitcode=yes"
-# Needed so cargo can find libbacktrace
-RUSTFLAGS += "-L ${STAGING_LIBDIR} -C link-arg=-Wl,-soname,libstd.so"
-
-S = "${RUSTSRC}/src/libstd"
-
-CARGO_FEATURES ?= "panic-unwind backtrace"
-CARGO_BUILD_FLAGS += "--features '${CARGO_FEATURES}'"
-CARGO_VENDORING_DIRECTORY = "${RUSTSRC}/vendor"
-
-do_compile:prepend () {
- export CARGO_TARGET_DIR="${B}"
- # For Rust 1.13.0 and newer
- export RUSTC_BOOTSTRAP="1"
-}
-
-do_install () {
- mkdir -p ${D}${rustlibdir}
-
- # With the incremental build support added in 1.24, the libstd deps directory also includes dependency
- # files that get installed. Those are really only needed to incrementally rebuild the libstd library
- # itself and don't need to be installed.
- rm -f ${B}/${RUST_TARGET_SYS}/${BUILD_DIR}/deps/*.d
- cp ${B}/${RUST_TARGET_SYS}/${BUILD_DIR}/deps/* ${D}${rustlibdir}
-}
diff --git a/meta/recipes-devtools/rust/libstd-rs_1.66.0.bb b/meta/recipes-devtools/rust/libstd-rs_1.66.0.bb
index eec0245ae19b..6c5a979f4f23 100644
--- a/meta/recipes-devtools/rust/libstd-rs_1.66.0.bb
+++ b/meta/recipes-devtools/rust/libstd-rs_1.66.0.bb
@@ -1,7 +1,45 @@
+SUMMARY = "Rust standard libaries"
+HOMEPAGE = "http://www.rust-lang.org"
+SECTION = "devel"
+LICENSE = "(MIT | Apache-2.0) & Unicode-TOU"
+LIC_FILES_CHKSUM = "file://../../COPYRIGHT;md5=92289ed52a60b63ab715612ad2915603"
+
require rust-source.inc
-require libstd-rs.inc
# libstd moved from src/libstd to library/std in 1.47+
S = "${RUSTSRC}/library/std"
+RUSTLIB_DEP = ""
+inherit cargo
+
+DEPENDS:append:libc-musl = " libunwind"
+# rv32 does not have libunwind ported yet
+DEPENDS:remove:riscv32 = "libunwind"
+DEPENDS:remove:riscv64 = "libunwind"
+
+# Embed bitcode in order to allow compiling both with and without LTO
+RUSTFLAGS += "-Cembed-bitcode=yes"
+# Needed so cargo can find libbacktrace
+RUSTFLAGS += "-L ${STAGING_LIBDIR} -C link-arg=-Wl,-soname,libstd.so"
+
+CARGO_FEATURES ?= "panic-unwind backtrace"
+CARGO_BUILD_FLAGS += "--features '${CARGO_FEATURES}'"
+CARGO_VENDORING_DIRECTORY = "${RUSTSRC}/vendor"
+
+do_compile:prepend () {
+ export CARGO_TARGET_DIR="${B}"
+ # For Rust 1.13.0 and newer
+ export RUSTC_BOOTSTRAP="1"
+}
+
+do_install () {
+ mkdir -p ${D}${rustlibdir}
+
+ # With the incremental build support added in 1.24, the libstd deps directory also includes dependency
+ # files that get installed. Those are really only needed to incrementally rebuild the libstd library
+ # itself and don't need to be installed.
+ rm -f ${B}/${RUST_TARGET_SYS}/${BUILD_DIR}/deps/*.d
+ cp ${B}/${RUST_TARGET_SYS}/${BUILD_DIR}/deps/* ${D}${rustlibdir}
+}
+
BBCLASSEXTEND = "nativesdk"
--
2.39.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [OE-Core][PATCH v2 03/10] libstd-rs: Move source directory to library/test
2022-12-21 12:52 [OE-Core][PATCH v2 00/10] Add rust runtime tests Alex Kiernan
2022-12-21 12:52 ` [OE-Core][PATCH v2 01/10] oeqa/runtime/rust: Add basic compile/run test Alex Kiernan
2022-12-21 12:52 ` [OE-Core][PATCH v2 02/10] libstd-rs: Merge .inc into .bb Alex Kiernan
@ 2022-12-21 12:52 ` Alex Kiernan
2022-12-21 12:52 ` [OE-Core][PATCH v2 04/10] rust-llvm: Merge .inc into .bb Alex Kiernan
` (7 subsequent siblings)
10 siblings, 0 replies; 16+ messages in thread
From: Alex Kiernan @ 2022-12-21 12:52 UTC (permalink / raw)
To: openembedded-core; +Cc: Alex Kiernan
Building libstd-rs from library/std omits proc_macro from the sysroot.
Using library/test causes that to be installed which then allows cargo
to build (https://github.com/meta-rust/meta-rust/issues/266)
Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
---
(no changes since v1)
meta/recipes-devtools/rust/libstd-rs_1.66.0.bb | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/meta/recipes-devtools/rust/libstd-rs_1.66.0.bb b/meta/recipes-devtools/rust/libstd-rs_1.66.0.bb
index 6c5a979f4f23..8802e9790ce4 100644
--- a/meta/recipes-devtools/rust/libstd-rs_1.66.0.bb
+++ b/meta/recipes-devtools/rust/libstd-rs_1.66.0.bb
@@ -6,8 +6,10 @@ LIC_FILES_CHKSUM = "file://../../COPYRIGHT;md5=92289ed52a60b63ab715612ad2915603"
require rust-source.inc
-# libstd moved from src/libstd to library/std in 1.47+
-S = "${RUSTSRC}/library/std"
+# Building with library/std omits proc_macro from the sysroot. Using
+# library/test causes that to be installed which then allows cargo to
+# build (https://github.com/meta-rust/meta-rust/issues/266)
+S = "${RUSTSRC}/library/test"
RUSTLIB_DEP = ""
inherit cargo
--
2.39.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [OE-Core][PATCH v2 04/10] rust-llvm: Merge .inc into .bb
2022-12-21 12:52 [OE-Core][PATCH v2 00/10] Add rust runtime tests Alex Kiernan
` (2 preceding siblings ...)
2022-12-21 12:52 ` [OE-Core][PATCH v2 03/10] libstd-rs: Move source directory to library/test Alex Kiernan
@ 2022-12-21 12:52 ` Alex Kiernan
2022-12-21 12:53 ` [OE-Core][PATCH v2 05/10] rust-llvm: Update LLVM_VERSION to match embedded version Alex Kiernan
` (6 subsequent siblings)
10 siblings, 0 replies; 16+ messages in thread
From: Alex Kiernan @ 2022-12-21 12:52 UTC (permalink / raw)
To: openembedded-core; +Cc: Alex Kiernan
Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
---
(no changes since v1)
meta/recipes-devtools/rust/rust-llvm.inc | 78 ------------------
.../recipes-devtools/rust/rust-llvm_1.66.0.bb | 80 ++++++++++++++++++-
2 files changed, 79 insertions(+), 79 deletions(-)
delete mode 100644 meta/recipes-devtools/rust/rust-llvm.inc
diff --git a/meta/recipes-devtools/rust/rust-llvm.inc b/meta/recipes-devtools/rust/rust-llvm.inc
deleted file mode 100644
index 625eb5704166..000000000000
--- a/meta/recipes-devtools/rust/rust-llvm.inc
+++ /dev/null
@@ -1,78 +0,0 @@
-SUMMARY = "LLVM compiler framework (packaged with rust)"
-LICENSE ?= "Apache-2.0-with-LLVM-exception"
-HOMEPAGE = "http://www.rust-lang.org"
-
-SRC_URI += "file://0002-llvm-allow-env-override-of-exe-path.patch;striplevel=2 \
- file://0001-AsmMatcherEmitter-sort-ClassInfo-lists-by-name-as-we.patch;striplevel=2 \
- file://0003-llvm-fix-include-benchmarks.patch;striplevel=2"
-
-S = "${RUSTSRC}/src/llvm-project/llvm"
-
-LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=8a15a0759ef07f2682d2ba4b893c9afe"
-
-inherit cmake python3native
-
-DEPENDS += "ninja-native rust-llvm-native"
-
-ARM_INSTRUCTION_SET:armv5 = "arm"
-ARM_INSTRUCTION_SET:armv4t = "arm"
-
-# rustc_llvm with debug info is not recognized as a valid crate that's
-# generated by rust-llvm-native.
-CFLAGS:remove = "-g"
-CXXFLAGS:remove = "-g"
-
-LLVM_DIR = "llvm${LLVM_RELEASE}"
-
-EXTRA_OECMAKE = " \
- -DCMAKE_BUILD_TYPE=Release \
- -DLLVM_TARGETS_TO_BUILD='ARM;AArch64;Mips;PowerPC;RISCV;X86' \
- -DLLVM_BUILD_DOCS=OFF \
- -DLLVM_ENABLE_TERMINFO=OFF \
- -DLLVM_ENABLE_ZLIB=OFF \
- -DLLVM_ENABLE_LIBXML2=OFF \
- -DLLVM_ENABLE_FFI=OFF \
- -DLLVM_INSTALL_UTILS=ON \
- -DLLVM_BUILD_EXAMPLES=OFF \
- -DLLVM_INCLUDE_EXAMPLES=OFF \
- -DLLVM_BUILD_TESTS=OFF \
- -DLLVM_INCLUDE_TESTS=OFF \
- -DLLVM_TARGET_ARCH=${TARGET_ARCH} \
- -DCMAKE_INSTALL_PREFIX:PATH=${libdir}/llvm-rust \
-"
-EXTRA_OECMAKE:append:class-target = "\
- -DCMAKE_CROSSCOMPILING:BOOL=ON \
- -DLLVM_BUILD_TOOLS=OFF \
- -DLLVM_TABLEGEN=${STAGING_LIBDIR_NATIVE}/llvm-rust/bin/llvm-tblgen \
- -DLLVM_CONFIG_PATH=${STAGING_LIBDIR_NATIVE}/llvm-rust/bin/llvm-config \
-"
-
-EXTRA_OECMAKE:append:class-nativesdk = "\
- -DCMAKE_CROSSCOMPILING:BOOL=ON \
- -DLLVM_BUILD_TOOLS=OFF \
- -DLLVM_TABLEGEN=${STAGING_LIBDIR_NATIVE}/llvm-rust/bin/llvm-tblgen \
- -DLLVM_CONFIG_PATH=${STAGING_LIBDIR_NATIVE}/llvm-rust/bin/llvm-config \
-"
-
-# The debug symbols are huge here (>2GB) so suppress them since they
-# provide almost no value. If you really need them then override this
-INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
-
-export YOCTO_ALTERNATE_EXE_PATH = "${STAGING_LIBDIR}/llvm-rust/bin/llvm-config"
-
-do_install:append () {
- # we don't need any of this stuff to build Rust
- rm -rf "${D}/usr/lib/cmake"
-}
-
-PACKAGES =+ "${PN}-bugpointpasses ${PN}-llvmhello ${PN}-liblto"
-
-# Add the extra locations to avoid the complaints about unpackaged files
-FILES:${PN}-bugpointpasses = "${libdir}/llvm-rust/lib/BugpointPasses.so"
-FILES:${PN}-llvmhello = "${libdir}/llvm-rust/lib/LLVMHello.so"
-FILES:${PN}-liblto = "${libdir}/llvm-rust/lib/libLTO.so.*"
-FILES:${PN}-staticdev =+ "${libdir}/llvm-rust/*/*.a"
-FILES:${PN} += "${libdir}/libLLVM*.so.* ${libdir}/llvm-rust/lib/*.so.* ${libdir}/llvm-rust/bin"
-FILES:${PN}-dev += "${datadir}/llvm ${libdir}/llvm-rust/lib/*.so ${libdir}/llvm-rust/include ${libdir}/llvm-rust/share ${libdir}/llvm-rust/lib/cmake"
-
-BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-devtools/rust/rust-llvm_1.66.0.bb b/meta/recipes-devtools/rust/rust-llvm_1.66.0.bb
index 396f741953ed..e1baeb78574f 100644
--- a/meta/recipes-devtools/rust/rust-llvm_1.66.0.bb
+++ b/meta/recipes-devtools/rust/rust-llvm_1.66.0.bb
@@ -1,6 +1,84 @@
+SUMMARY = "LLVM compiler framework (packaged with rust)"
+LICENSE ?= "Apache-2.0-with-LLVM-exception"
+HOMEPAGE = "http://www.rust-lang.org"
+
# check src/llvm-project/llvm/CMakeLists.txt for llvm version in use
#
LLVM_RELEASE = "14.0.5"
+
require rust-source.inc
-require rust-llvm.inc
+SRC_URI += "file://0002-llvm-allow-env-override-of-exe-path.patch;striplevel=2 \
+ file://0001-AsmMatcherEmitter-sort-ClassInfo-lists-by-name-as-we.patch;striplevel=2 \
+ file://0003-llvm-fix-include-benchmarks.patch;striplevel=2"
+
+S = "${RUSTSRC}/src/llvm-project/llvm"
+
+LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=8a15a0759ef07f2682d2ba4b893c9afe"
+
+inherit cmake python3native
+
+DEPENDS += "ninja-native rust-llvm-native"
+
+ARM_INSTRUCTION_SET:armv5 = "arm"
+ARM_INSTRUCTION_SET:armv4t = "arm"
+
+# rustc_llvm with debug info is not recognized as a valid crate that's
+# generated by rust-llvm-native.
+CFLAGS:remove = "-g"
+CXXFLAGS:remove = "-g"
+
+LLVM_DIR = "llvm${LLVM_RELEASE}"
+
+EXTRA_OECMAKE = " \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DLLVM_TARGETS_TO_BUILD='ARM;AArch64;Mips;PowerPC;RISCV;X86' \
+ -DLLVM_BUILD_DOCS=OFF \
+ -DLLVM_ENABLE_TERMINFO=OFF \
+ -DLLVM_ENABLE_ZLIB=OFF \
+ -DLLVM_ENABLE_LIBXML2=OFF \
+ -DLLVM_ENABLE_FFI=OFF \
+ -DLLVM_INSTALL_UTILS=ON \
+ -DLLVM_BUILD_EXAMPLES=OFF \
+ -DLLVM_INCLUDE_EXAMPLES=OFF \
+ -DLLVM_BUILD_TESTS=OFF \
+ -DLLVM_INCLUDE_TESTS=OFF \
+ -DLLVM_TARGET_ARCH=${TARGET_ARCH} \
+ -DCMAKE_INSTALL_PREFIX:PATH=${libdir}/llvm-rust \
+"
+EXTRA_OECMAKE:append:class-target = "\
+ -DCMAKE_CROSSCOMPILING:BOOL=ON \
+ -DLLVM_BUILD_TOOLS=OFF \
+ -DLLVM_TABLEGEN=${STAGING_LIBDIR_NATIVE}/llvm-rust/bin/llvm-tblgen \
+ -DLLVM_CONFIG_PATH=${STAGING_LIBDIR_NATIVE}/llvm-rust/bin/llvm-config \
+"
+
+EXTRA_OECMAKE:append:class-nativesdk = "\
+ -DCMAKE_CROSSCOMPILING:BOOL=ON \
+ -DLLVM_BUILD_TOOLS=OFF \
+ -DLLVM_TABLEGEN=${STAGING_LIBDIR_NATIVE}/llvm-rust/bin/llvm-tblgen \
+ -DLLVM_CONFIG_PATH=${STAGING_LIBDIR_NATIVE}/llvm-rust/bin/llvm-config \
+"
+
+# The debug symbols are huge here (>2GB) so suppress them since they
+# provide almost no value. If you really need them then override this
+INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
+
+export YOCTO_ALTERNATE_EXE_PATH = "${STAGING_LIBDIR}/llvm-rust/bin/llvm-config"
+
+do_install:append () {
+ # we don't need any of this stuff to build Rust
+ rm -rf "${D}/usr/lib/cmake"
+}
+
+PACKAGES =+ "${PN}-bugpointpasses ${PN}-llvmhello ${PN}-liblto"
+
+# Add the extra locations to avoid the complaints about unpackaged files
+FILES:${PN}-bugpointpasses = "${libdir}/llvm-rust/lib/BugpointPasses.so"
+FILES:${PN}-llvmhello = "${libdir}/llvm-rust/lib/LLVMHello.so"
+FILES:${PN}-liblto = "${libdir}/llvm-rust/lib/libLTO.so.*"
+FILES:${PN}-staticdev =+ "${libdir}/llvm-rust/*/*.a"
+FILES:${PN} += "${libdir}/libLLVM*.so.* ${libdir}/llvm-rust/lib/*.so.* ${libdir}/llvm-rust/bin"
+FILES:${PN}-dev += "${datadir}/llvm ${libdir}/llvm-rust/lib/*.so ${libdir}/llvm-rust/include ${libdir}/llvm-rust/share ${libdir}/llvm-rust/lib/cmake"
+
+BBCLASSEXTEND = "native nativesdk"
--
2.39.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [OE-Core][PATCH v2 05/10] rust-llvm: Update LLVM_VERSION to match embedded version
2022-12-21 12:52 [OE-Core][PATCH v2 00/10] Add rust runtime tests Alex Kiernan
` (3 preceding siblings ...)
2022-12-21 12:52 ` [OE-Core][PATCH v2 04/10] rust-llvm: Merge .inc into .bb Alex Kiernan
@ 2022-12-21 12:53 ` Alex Kiernan
2022-12-21 12:53 ` [OE-Core][PATCH v2 06/10] cargo: Merge .inc into .bb Alex Kiernan
` (5 subsequent siblings)
10 siblings, 0 replies; 16+ messages in thread
From: Alex Kiernan @ 2022-12-21 12:53 UTC (permalink / raw)
To: openembedded-core; +Cc: Alex Kiernan
Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
---
(no changes since v1)
meta/recipes-devtools/rust/rust-llvm_1.66.0.bb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/recipes-devtools/rust/rust-llvm_1.66.0.bb b/meta/recipes-devtools/rust/rust-llvm_1.66.0.bb
index e1baeb78574f..4cf244bb67f5 100644
--- a/meta/recipes-devtools/rust/rust-llvm_1.66.0.bb
+++ b/meta/recipes-devtools/rust/rust-llvm_1.66.0.bb
@@ -4,7 +4,7 @@ HOMEPAGE = "http://www.rust-lang.org"
# check src/llvm-project/llvm/CMakeLists.txt for llvm version in use
#
-LLVM_RELEASE = "14.0.5"
+LLVM_RELEASE = "15.0.2"
require rust-source.inc
--
2.39.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [OE-Core][PATCH v2 06/10] cargo: Merge .inc into .bb
2022-12-21 12:52 [OE-Core][PATCH v2 00/10] Add rust runtime tests Alex Kiernan
` (4 preceding siblings ...)
2022-12-21 12:53 ` [OE-Core][PATCH v2 05/10] rust-llvm: Update LLVM_VERSION to match embedded version Alex Kiernan
@ 2022-12-21 12:53 ` Alex Kiernan
2022-12-21 12:53 ` [OE-Core][PATCH v2 07/10] cargo: Extend DEBUG_PREFIX_MAP to cover vendor Alex Kiernan
` (4 subsequent siblings)
10 siblings, 0 replies; 16+ messages in thread
From: Alex Kiernan @ 2022-12-21 12:53 UTC (permalink / raw)
To: openembedded-core; +Cc: Alex Kiernan
Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
---
(no changes since v1)
meta/recipes-devtools/cargo/cargo.inc | 69 --------------------
meta/recipes-devtools/cargo/cargo_1.66.0.bb | 71 ++++++++++++++++++++-
2 files changed, 69 insertions(+), 71 deletions(-)
delete mode 100644 meta/recipes-devtools/cargo/cargo.inc
diff --git a/meta/recipes-devtools/cargo/cargo.inc b/meta/recipes-devtools/cargo/cargo.inc
deleted file mode 100644
index 40421df4f76d..000000000000
--- a/meta/recipes-devtools/cargo/cargo.inc
+++ /dev/null
@@ -1,69 +0,0 @@
-SUMMARY ?= "Cargo, a package manager for Rust."
-HOMEPAGE = "https://crates.io"
-LICENSE = "MIT | Apache-2.0"
-SECTION = "devel"
-
-DEPENDS = "openssl zlib curl ca-certificates libssh2"
-
-LIC_FILES_CHKSUM = " \
- file://LICENSE-MIT;md5=b377b220f43d747efdec40d69fcaa69d \
- file://LICENSE-APACHE;md5=71b224ca933f0676e26d5c2e2271331c \
- file://LICENSE-THIRD-PARTY;md5=f257ad009884cb88a3a87d6920e7180a \
-"
-
-
-S = "${RUSTSRC}/src/tools/cargo"
-CARGO_VENDORING_DIRECTORY = "${RUSTSRC}/vendor"
-EXCLUDE_FROM_WORLD = "1"
-
-inherit cargo pkgconfig
-
-do_cargo_setup_snapshot () {
- ${WORKDIR}/rust-snapshot-components/${CARGO_SNAPSHOT}/install.sh --prefix="${WORKDIR}/${CARGO_SNAPSHOT}" --disable-ldconfig
- # Need to use uninative's loader if enabled/present since the library paths
- # are used internally by rust and result in symbol mismatches if we don't
- if [ ! -z "${UNINATIVE_LOADER}" -a -e "${UNINATIVE_LOADER}" ]; then
- patchelf-uninative ${WORKDIR}/${CARGO_SNAPSHOT}/bin/cargo --set-interpreter ${UNINATIVE_LOADER}
- fi
-}
-
-addtask cargo_setup_snapshot after do_unpack before do_configure
-do_cargo_setup_snapshot[dirs] += "${WORKDIR}/${CARGO_SNAPSHOT}"
-do_cargo_setup_snapshot[vardepsexclude] += "UNINATIVE_LOADER"
-
-
-do_compile:prepend () {
- export RUSTC_BOOTSTRAP="1"
-}
-
-do_install () {
- install -d "${D}${bindir}"
- install -m 755 "${B}/target/${CARGO_TARGET_SUBDIR}/cargo" "${D}${bindir}"
-}
-
-do_install:append:class-nativesdk() {
- # To quote the cargo docs, "Cargo also sets the dynamic library path when compiling
- # and running binaries with commands like `cargo run` and `cargo test`". Sadly it
- # sets to libdir but not base_libdir leading to symbol mismatches depending on the
- # host OS. Fully set LD_LIBRARY_PATH to contain both to avoid this.
- create_wrapper ${D}/${bindir}/cargo LD_LIBRARY_PATH=${libdir}:${base_libdir}
-}
-
-# Disabled due to incompatibility with libgit2 0.28.x (https://github.com/rust-lang/git2-rs/issues/458, https://bugs.gentoo.org/707746#c1)
-# as shipped by Yocto Dunfell.
-# According to https://github.com/rust-lang/git2-rs/issues/458#issuecomment-522567539, there are no compatibility guarantees between
-# libgit2-sys and arbitrary system libgit2 versions, so better keep this turned off.
-#export LIBGIT2_SYS_USE_PKG_CONFIG = "1"
-
-# Needed for pkg-config to be used
-export LIBSSH2_SYS_USE_PKG_CONFIG = "1"
-
-# When building cargo-native we don't have cargo-native to use and depend on,
-# so we must use the locally set up snapshot to bootstrap the build.
-BASEDEPENDS:remove:class-native = "cargo-native"
-CARGO:class-native = "${WORKDIR}/${CARGO_SNAPSHOT}/bin/cargo"
-
-DEPENDS:append:class-nativesdk = " nativesdk-rust"
-RUSTLIB:append:class-nativesdk = " -L ${STAGING_DIR_HOST}/${SDKPATHNATIVE}/usr/lib/rustlib/${RUST_HOST_SYS}/lib"
-
-
diff --git a/meta/recipes-devtools/cargo/cargo_1.66.0.bb b/meta/recipes-devtools/cargo/cargo_1.66.0.bb
index 5c8527708cb3..6c167c0c5f0b 100644
--- a/meta/recipes-devtools/cargo/cargo_1.66.0.bb
+++ b/meta/recipes-devtools/cargo/cargo_1.66.0.bb
@@ -1,5 +1,72 @@
+SUMMARY ?= "Cargo, a package manager for Rust."
+HOMEPAGE = "https://crates.io"
+LICENSE = "MIT | Apache-2.0"
+SECTION = "devel"
+
+DEPENDS = "openssl zlib curl ca-certificates libssh2"
+
+LIC_FILES_CHKSUM = " \
+ file://LICENSE-MIT;md5=b377b220f43d747efdec40d69fcaa69d \
+ file://LICENSE-APACHE;md5=71b224ca933f0676e26d5c2e2271331c \
+ file://LICENSE-THIRD-PARTY;md5=f257ad009884cb88a3a87d6920e7180a \
+"
+
require recipes-devtools/rust/rust-source.inc
require recipes-devtools/rust/rust-snapshot.inc
-require cargo.inc
+
+S = "${RUSTSRC}/src/tools/cargo"
+CARGO_VENDORING_DIRECTORY = "${RUSTSRC}/vendor"
+EXCLUDE_FROM_WORLD = "1"
+
+inherit cargo pkgconfig
+
+do_cargo_setup_snapshot () {
+ ${WORKDIR}/rust-snapshot-components/${CARGO_SNAPSHOT}/install.sh --prefix="${WORKDIR}/${CARGO_SNAPSHOT}" --disable-ldconfig
+ # Need to use uninative's loader if enabled/present since the library paths
+ # are used internally by rust and result in symbol mismatches if we don't
+ if [ ! -z "${UNINATIVE_LOADER}" -a -e "${UNINATIVE_LOADER}" ]; then
+ patchelf-uninative ${WORKDIR}/${CARGO_SNAPSHOT}/bin/cargo --set-interpreter ${UNINATIVE_LOADER}
+ fi
+}
+
+addtask cargo_setup_snapshot after do_unpack before do_configure
+do_cargo_setup_snapshot[dirs] += "${WORKDIR}/${CARGO_SNAPSHOT}"
+do_cargo_setup_snapshot[vardepsexclude] += "UNINATIVE_LOADER"
+
+
+do_compile:prepend () {
+ export RUSTC_BOOTSTRAP="1"
+}
+
+do_install () {
+ install -d "${D}${bindir}"
+ install -m 755 "${B}/target/${CARGO_TARGET_SUBDIR}/cargo" "${D}${bindir}"
+}
+
+do_install:append:class-nativesdk() {
+ # To quote the cargo docs, "Cargo also sets the dynamic library path when compiling
+ # and running binaries with commands like `cargo run` and `cargo test`". Sadly it
+ # sets to libdir but not base_libdir leading to symbol mismatches depending on the
+ # host OS. Fully set LD_LIBRARY_PATH to contain both to avoid this.
+ create_wrapper ${D}/${bindir}/cargo LD_LIBRARY_PATH=${libdir}:${base_libdir}
+}
+
+# Disabled due to incompatibility with libgit2 0.28.x (https://github.com/rust-lang/git2-rs/issues/458, https://bugs.gentoo.org/707746#c1)
+# as shipped by Yocto Dunfell.
+# According to https://github.com/rust-lang/git2-rs/issues/458#issuecomment-522567539, there are no compatibility guarantees between
+# libgit2-sys and arbitrary system libgit2 versions, so better keep this turned off.
+#export LIBGIT2_SYS_USE_PKG_CONFIG = "1"
+
+# Needed for pkg-config to be used
+export LIBSSH2_SYS_USE_PKG_CONFIG = "1"
+
+# When building cargo-native we don't have cargo-native to use and depend on,
+# so we must use the locally set up snapshot to bootstrap the build.
+BASEDEPENDS:remove:class-native = "cargo-native"
+CARGO:class-native = "${WORKDIR}/${CARGO_SNAPSHOT}/bin/cargo"
+
+DEPENDS:append:class-nativesdk = " nativesdk-rust"
+RUSTLIB:append:class-nativesdk = " -L ${STAGING_DIR_HOST}/${SDKPATHNATIVE}/usr/lib/rustlib/${RUST_HOST_SYS}/lib"
+RUSTLIB_DEP:class-nativesdk = ""
+
BBCLASSEXTEND = "native nativesdk"
-RUSTLIB_DEP:class-nativesdk = ""
\ No newline at end of file
--
2.39.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [OE-Core][PATCH v2 07/10] cargo: Extend DEBUG_PREFIX_MAP to cover vendor
2022-12-21 12:52 [OE-Core][PATCH v2 00/10] Add rust runtime tests Alex Kiernan
` (5 preceding siblings ...)
2022-12-21 12:53 ` [OE-Core][PATCH v2 06/10] cargo: Merge .inc into .bb Alex Kiernan
@ 2022-12-21 12:53 ` Alex Kiernan
2022-12-21 12:53 ` [OE-Core][PATCH v2 08/10] packagegroup-rust-sdk-target: Add Rust SDK target packagegroup Alex Kiernan
` (3 subsequent siblings)
10 siblings, 0 replies; 16+ messages in thread
From: Alex Kiernan @ 2022-12-21 12:53 UTC (permalink / raw)
To: openembedded-core; +Cc: Alex Kiernan
The cargo build builds vendored libgit and curl, but these exist outside
${S} which DEBUG_PREFIX_MAP covers.
Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
---
(no changes since v1)
meta/recipes-devtools/cargo/cargo_1.66.0.bb | 2 ++
1 file changed, 2 insertions(+)
diff --git a/meta/recipes-devtools/cargo/cargo_1.66.0.bb b/meta/recipes-devtools/cargo/cargo_1.66.0.bb
index 6c167c0c5f0b..fe8049b68c9b 100644
--- a/meta/recipes-devtools/cargo/cargo_1.66.0.bb
+++ b/meta/recipes-devtools/cargo/cargo_1.66.0.bb
@@ -20,6 +20,8 @@ EXCLUDE_FROM_WORLD = "1"
inherit cargo pkgconfig
+DEBUG_PREFIX_MAP += "-fdebug-prefix-map=${RUSTSRC}/vendor=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}"
+
do_cargo_setup_snapshot () {
${WORKDIR}/rust-snapshot-components/${CARGO_SNAPSHOT}/install.sh --prefix="${WORKDIR}/${CARGO_SNAPSHOT}" --disable-ldconfig
# Need to use uninative's loader if enabled/present since the library paths
--
2.39.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [OE-Core][PATCH v2 08/10] packagegroup-rust-sdk-target: Add Rust SDK target packagegroup
2022-12-21 12:52 [OE-Core][PATCH v2 00/10] Add rust runtime tests Alex Kiernan
` (6 preceding siblings ...)
2022-12-21 12:53 ` [OE-Core][PATCH v2 07/10] cargo: Extend DEBUG_PREFIX_MAP to cover vendor Alex Kiernan
@ 2022-12-21 12:53 ` Alex Kiernan
2022-12-21 12:53 ` [OE-Core][PATCH v2 09/10] packagegroup-core-sdk: Add SDK toolchain language selection support Alex Kiernan
` (2 subsequent siblings)
10 siblings, 0 replies; 16+ messages in thread
From: Alex Kiernan @ 2022-12-21 12:53 UTC (permalink / raw)
To: openembedded-core; +Cc: Alex Kiernan
Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
---
(no changes since v1)
.../packagegroups/packagegroup-rust-sdk-target.bb | 14 ++++++++++++++
1 file changed, 14 insertions(+)
create mode 100644 meta/recipes-core/packagegroups/packagegroup-rust-sdk-target.bb
diff --git a/meta/recipes-core/packagegroups/packagegroup-rust-sdk-target.bb b/meta/recipes-core/packagegroups/packagegroup-rust-sdk-target.bb
new file mode 100644
index 000000000000..59874c4c2c81
--- /dev/null
+++ b/meta/recipes-core/packagegroups/packagegroup-rust-sdk-target.bb
@@ -0,0 +1,14 @@
+#
+# Copyright OpenEmbedded Contributors
+#
+# SPDX-License-Identifier: MIT
+#
+
+SUMMARY = "Target packages for the Rust SDK"
+
+inherit packagegroup
+
+RDEPENDS:${PN} = " \
+ rust \
+ cargo \
+"
--
2.39.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [OE-Core][PATCH v2 09/10] packagegroup-core-sdk: Add SDK toolchain language selection support
2022-12-21 12:52 [OE-Core][PATCH v2 00/10] Add rust runtime tests Alex Kiernan
` (7 preceding siblings ...)
2022-12-21 12:53 ` [OE-Core][PATCH v2 08/10] packagegroup-rust-sdk-target: Add Rust SDK target packagegroup Alex Kiernan
@ 2022-12-21 12:53 ` Alex Kiernan
2022-12-21 16:39 ` Richard Purdie
2022-12-21 12:53 ` [OE-Core][PATCH v2 10/10] oeqa/runtime/rust: Add cargo test Alex Kiernan
2022-12-21 21:20 ` [OE-Core][PATCH v2 00/10] Add rust runtime tests Alexandre Belloni
10 siblings, 1 reply; 16+ messages in thread
From: Alex Kiernan @ 2022-12-21 12:53 UTC (permalink / raw)
To: openembedded-core; +Cc: Alex Kiernan
Use SDK_TOOLCHAIN_LANGS to allow different language support to be
selected within SDKs. Initially supported options are rust and go.
Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
---
(no changes since v1)
.../packagegroups/packagegroup-core-sdk.bb | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb b/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb
index d70aff22c725..0e480e6ac756 100644
--- a/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb
+++ b/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb
@@ -11,6 +11,11 @@ inherit packagegroup
#PACKAGEFUNCS =+ 'generate_sdk_pkgs'
+SDK_TOOLCHAIN_LANGS ??= ""
+SDK_TOOLCHAIN_LANGS:remove:sdkmingw32 = "rust"
+# libstd-rs doesn't build for mips n32 with compiler constraint errors
+SDK_TOOLCHAIN_LANGS:remove:mipsarchn32 = "rust"
+
RDEPENDS:packagegroup-core-sdk = "\
packagegroup-core-buildessential \
coreutils \
@@ -23,7 +28,10 @@ RDEPENDS:packagegroup-core-sdk = "\
less \
ldd \
file \
- tcl"
+ tcl \
+ ${@bb.utils.contains('SDK_TOOLCHAIN_LANGS', 'go', 'packagegroup-go-sdk-target', '', d)} \
+ ${@bb.utils.contains('SDK_TOOLCHAIN_LANGS', 'rust', 'packagegroup-rust-sdk-target', '', d)} \
+"
SANITIZERS = "libasan-dev libubsan-dev"
SANITIZERS:arc = ""
--
2.39.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [OE-Core][PATCH v2 10/10] oeqa/runtime/rust: Add cargo test
2022-12-21 12:52 [OE-Core][PATCH v2 00/10] Add rust runtime tests Alex Kiernan
` (8 preceding siblings ...)
2022-12-21 12:53 ` [OE-Core][PATCH v2 09/10] packagegroup-core-sdk: Add SDK toolchain language selection support Alex Kiernan
@ 2022-12-21 12:53 ` Alex Kiernan
2022-12-21 21:20 ` [OE-Core][PATCH v2 00/10] Add rust runtime tests Alexandre Belloni
10 siblings, 0 replies; 16+ messages in thread
From: Alex Kiernan @ 2022-12-21 12:53 UTC (permalink / raw)
To: openembedded-core; +Cc: Alex Kiernan
Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
---
(no changes since v1)
meta/lib/oeqa/runtime/cases/rust.py | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/meta/lib/oeqa/runtime/cases/rust.py b/meta/lib/oeqa/runtime/cases/rust.py
index 186bb0d79e15..e2793f65c932 100644
--- a/meta/lib/oeqa/runtime/cases/rust.py
+++ b/meta/lib/oeqa/runtime/cases/rust.py
@@ -20,6 +20,8 @@ class RustCompileTest(OERuntimeTestCase):
def tearDown(cls):
files = '/tmp/test.rs /tmp/test'
cls.tc.target.run('rm %s' % files)
+ dirs = '/tmp/hello'
+ cls.tc.target.run('rm -r %s' % dirs)
@OETestDepends(['ssh.SSHTest.test_ssh'])
@OEHasPackage(['rust'])
@@ -32,6 +34,21 @@ class RustCompileTest(OERuntimeTestCase):
msg = 'running compiled file failed, output: %s' % output
self.assertEqual(status, 0, msg=msg)
+ @OETestDepends(['ssh.SSHTest.test_ssh'])
+ @OEHasPackage(['cargo'])
+ def test_cargo_compile(self):
+ status, output = self.target.run('cargo new /tmp/hello')
+ msg = 'cargo new failed, output: %s' % output
+ self.assertEqual(status, 0, msg=msg)
+
+ status, output = self.target.run('cargo build --manifest-path=/tmp/hello/Cargo.toml')
+ msg = 'cargo build failed, output: %s' % output
+ self.assertEqual(status, 0, msg=msg)
+
+ status, output = self.target.run('/tmp/hello/target/debug/hello')
+ msg = 'running compiled file failed, output: %s' % output
+ self.assertEqual(status, 0, msg=msg)
+
class RustHelloworldTest(OERuntimeTestCase):
@OETestDepends(['ssh.SSHTest.test_ssh'])
@OEHasPackage(['rust-hello-world'])
--
2.39.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [OE-Core][PATCH v2 09/10] packagegroup-core-sdk: Add SDK toolchain language selection support
2022-12-21 12:53 ` [OE-Core][PATCH v2 09/10] packagegroup-core-sdk: Add SDK toolchain language selection support Alex Kiernan
@ 2022-12-21 16:39 ` Richard Purdie
2022-12-21 16:42 ` Alex Kiernan
2022-12-21 18:54 ` Khem Raj
0 siblings, 2 replies; 16+ messages in thread
From: Richard Purdie @ 2022-12-21 16:39 UTC (permalink / raw)
To: Alex Kiernan, openembedded-core
On Wed, 2022-12-21 at 12:53 +0000, Alex Kiernan wrote:
> Use SDK_TOOLCHAIN_LANGS to allow different language support to be
> selected within SDKs. Initially supported options are rust and go.
>
> Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
> ---
>
> (no changes since v1)
>
> .../packagegroups/packagegroup-core-sdk.bb | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb b/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb
> index d70aff22c725..0e480e6ac756 100644
> --- a/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb
> +++ b/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb
> @@ -11,6 +11,11 @@ inherit packagegroup
>
> #PACKAGEFUNCS =+ 'generate_sdk_pkgs'
>
> +SDK_TOOLCHAIN_LANGS ??= ""
> +SDK_TOOLCHAIN_LANGS:remove:sdkmingw32 = "rust"
> +# libstd-rs doesn't build for mips n32 with compiler constraint errors
> +SDK_TOOLCHAIN_LANGS:remove:mipsarchn32 = "rust"
> +
> RDEPENDS:packagegroup-core-sdk = "\
> packagegroup-core-buildessential \
> coreutils \
> @@ -23,7 +28,10 @@ RDEPENDS:packagegroup-core-sdk = "\
> less \
> ldd \
> file \
> - tcl"
> + tcl \
> + ${@bb.utils.contains('SDK_TOOLCHAIN_LANGS', 'go', 'packagegroup-go-sdk-target', '', d)} \
> + ${@bb.utils.contains('SDK_TOOLCHAIN_LANGS', 'rust', 'packagegroup-rust-sdk-target', '', d)} \
> +"
I'm a little torn on this. I created SDK_TOOLCHAIN_LANGS as a control
for the SDKs from populate_sdk. Whether the target SDK images should
follow that as well, I'm less sure.
It is probably fine and I nearly didn't send a comment but I just
wanted to see what others think.
We could perhaps do something like:
TARGET_TOOLCHAIN_LANGS ??= "${SDK_TOOLCHAIN_LANGS}"
in the recipe to cover the ability to separate the two if we wanted...
Cheers,
Richard
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [OE-Core][PATCH v2 09/10] packagegroup-core-sdk: Add SDK toolchain language selection support
2022-12-21 16:39 ` Richard Purdie
@ 2022-12-21 16:42 ` Alex Kiernan
2022-12-21 18:54 ` Khem Raj
1 sibling, 0 replies; 16+ messages in thread
From: Alex Kiernan @ 2022-12-21 16:42 UTC (permalink / raw)
To: Richard Purdie; +Cc: openembedded-core
On Wed, Dec 21, 2022 at 4:39 PM Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
>
> On Wed, 2022-12-21 at 12:53 +0000, Alex Kiernan wrote:
> > Use SDK_TOOLCHAIN_LANGS to allow different language support to be
> > selected within SDKs. Initially supported options are rust and go.
> >
> > Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
> > ---
> >
> > (no changes since v1)
> >
> > .../packagegroups/packagegroup-core-sdk.bb | 10 +++++++++-
> > 1 file changed, 9 insertions(+), 1 deletion(-)
> >
> > diff --git a/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb b/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb
> > index d70aff22c725..0e480e6ac756 100644
> > --- a/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb
> > +++ b/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb
> > @@ -11,6 +11,11 @@ inherit packagegroup
> >
> > #PACKAGEFUNCS =+ 'generate_sdk_pkgs'
> >
> > +SDK_TOOLCHAIN_LANGS ??= ""
> > +SDK_TOOLCHAIN_LANGS:remove:sdkmingw32 = "rust"
> > +# libstd-rs doesn't build for mips n32 with compiler constraint errors
> > +SDK_TOOLCHAIN_LANGS:remove:mipsarchn32 = "rust"
> > +
> > RDEPENDS:packagegroup-core-sdk = "\
> > packagegroup-core-buildessential \
> > coreutils \
> > @@ -23,7 +28,10 @@ RDEPENDS:packagegroup-core-sdk = "\
> > less \
> > ldd \
> > file \
> > - tcl"
> > + tcl \
> > + ${@bb.utils.contains('SDK_TOOLCHAIN_LANGS', 'go', 'packagegroup-go-sdk-target', '', d)} \
> > + ${@bb.utils.contains('SDK_TOOLCHAIN_LANGS', 'rust', 'packagegroup-rust-sdk-target', '', d)} \
> > +"
>
> I'm a little torn on this. I created SDK_TOOLCHAIN_LANGS as a control
> for the SDKs from populate_sdk. Whether the target SDK images should
> follow that as well, I'm less sure.
>
> It is probably fine and I nearly didn't send a comment but I just
> wanted to see what others think.
>
> We could perhaps do something like:
>
> TARGET_TOOLCHAIN_LANGS ??= "${SDK_TOOLCHAIN_LANGS}"
>
> in the recipe to cover the ability to separate the two if we wanted...
>
I ummed and ahhed about reusing it... so I think it's a good discussion point...
--
Alex Kiernan
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [OE-Core][PATCH v2 09/10] packagegroup-core-sdk: Add SDK toolchain language selection support
2022-12-21 16:39 ` Richard Purdie
2022-12-21 16:42 ` Alex Kiernan
@ 2022-12-21 18:54 ` Khem Raj
1 sibling, 0 replies; 16+ messages in thread
From: Khem Raj @ 2022-12-21 18:54 UTC (permalink / raw)
To: Richard Purdie; +Cc: Alex Kiernan, openembedded-core
[-- Attachment #1: Type: text/plain, Size: 2693 bytes --]
On Wed, Dec 21, 2022 at 8:39 AM Richard Purdie <
richard.purdie@linuxfoundation.org> wrote:
> On Wed, 2022-12-21 at 12:53 +0000, Alex Kiernan wrote:
> > Use SDK_TOOLCHAIN_LANGS to allow different language support to be
> > selected within SDKs. Initially supported options are rust and go.
> >
> > Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
> > ---
> >
> > (no changes since v1)
> >
> > .../packagegroups/packagegroup-core-sdk.bb | 10 +++++++++-
> > 1 file changed, 9 insertions(+), 1 deletion(-)
> >
> > diff --git a/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb
> b/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb
> > index d70aff22c725..0e480e6ac756 100644
> > --- a/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb
> > +++ b/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb
> > @@ -11,6 +11,11 @@ inherit packagegroup
> >
> > #PACKAGEFUNCS =+ 'generate_sdk_pkgs'
> >
> > +SDK_TOOLCHAIN_LANGS ??= ""
> > +SDK_TOOLCHAIN_LANGS:remove:sdkmingw32 = "rust"
> > +# libstd-rs doesn't build for mips n32 with compiler constraint errors
> > +SDK_TOOLCHAIN_LANGS:remove:mipsarchn32 = "rust"
> > +
> > RDEPENDS:packagegroup-core-sdk = "\
> > packagegroup-core-buildessential \
> > coreutils \
> > @@ -23,7 +28,10 @@ RDEPENDS:packagegroup-core-sdk = "\
> > less \
> > ldd \
> > file \
> > - tcl"
> > + tcl \
> > + ${@bb.utils.contains('SDK_TOOLCHAIN_LANGS', 'go',
> 'packagegroup-go-sdk-target', '', d)} \
> > + ${@bb.utils.contains('SDK_TOOLCHAIN_LANGS', 'rust',
> 'packagegroup-rust-sdk-target', '', d)} \
> > +"
>
> I'm a little torn on this. I created SDK_TOOLCHAIN_LANGS as a control
> for the SDKs from populate_sdk. Whether the target SDK images should
> follow that as well, I'm less sure.
>
> It is probably fine and I nearly didn't send a comment but I just
> wanted to see what others think.
>
> We could perhaps do something like:
>
> TARGET_TOOLCHAIN_LANGS ??= "${SDK_TOOLCHAIN_LANGS}"
Let’s go with this approach. It’s in line with other similar variables
>
> in the recipe to cover the ability to separate the two if we wanted...
>
> Cheers,
>
> Richard
>
>
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#174922):
> https://lists.openembedded.org/g/openembedded-core/message/174922
> Mute This Topic: https://lists.openembedded.org/mt/95805446/1997914
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [
> raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>
[-- Attachment #2: Type: text/html, Size: 4506 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [OE-Core][PATCH v2 00/10] Add rust runtime tests
2022-12-21 12:52 [OE-Core][PATCH v2 00/10] Add rust runtime tests Alex Kiernan
` (9 preceding siblings ...)
2022-12-21 12:53 ` [OE-Core][PATCH v2 10/10] oeqa/runtime/rust: Add cargo test Alex Kiernan
@ 2022-12-21 21:20 ` Alexandre Belloni
2022-12-21 22:34 ` Alex Kiernan
10 siblings, 1 reply; 16+ messages in thread
From: Alexandre Belloni @ 2022-12-21 21:20 UTC (permalink / raw)
To: Alex Kiernan; +Cc: openembedded-core
Hello,
This is currently running on the AB and I got the following failures:
https://autobuilder.yoctoproject.org/typhoon/#/builders/64/builds/6375/steps/11/logs/stdio
https://autobuilder.yoctoproject.org/typhoon/#/builders/102/builds/3985/steps/11/logs/stdio
https://autobuilder.yoctoproject.org/typhoon/#/builders/63/builds/6334/steps/11/logs/stdio
https://autobuilder.yoctoproject.org/typhoon/#/builders/107/builds/3960/steps/11/logs/stdio
On 21/12/2022 12:52:55+0000, Alex Kiernan wrote:
>
> This series adds runtime tests for rust and cargo, merges (most of) the
> include files into the base recipes and fixes target cargo builds.
>
> Also add SDK_TOOLCHAIN_LANGS for selection of target toolchains as part
> of packagegroup-core-sdk.
>
> Changes in v2:
> - Drop rust.inc/rust.bb merge, not actually made use of in the change
> set
> - Reorder so cargo test goes after build fixes
>
> Alex Kiernan (10):
> oeqa/runtime/rust: Add basic compile/run test
> libstd-rs: Merge .inc into .bb
> libstd-rs: Move source directory to library/test
> rust-llvm: Merge .inc into .bb
> rust-llvm: Update LLVM_VERSION to match embedded version
> cargo: Merge .inc into .bb
> cargo: Extend DEBUG_PREFIX_MAP to cover vendor
> packagegroup-rust-sdk-target: Add Rust SDK target packagegroup
> packagegroup-core-sdk: Add SDK toolchain language selection support
> oeqa/runtime/rust: Add cargo test
>
> meta/lib/oeqa/files/test.rs | 2 +
> meta/lib/oeqa/runtime/cases/rust.py | 41 ++++++++++
> .../packagegroups/packagegroup-core-sdk.bb | 10 ++-
> .../packagegroup-rust-sdk-target.bb | 14 ++++
> meta/recipes-devtools/cargo/cargo.inc | 69 ----------------
> meta/recipes-devtools/cargo/cargo_1.66.0.bb | 73 ++++++++++++++++-
> meta/recipes-devtools/rust/libstd-rs.inc | 40 ---------
> .../recipes-devtools/rust/libstd-rs_1.66.0.bb | 46 ++++++++++-
> meta/recipes-devtools/rust/rust-llvm.inc | 78 ------------------
> .../recipes-devtools/rust/rust-llvm_1.66.0.bb | 82 ++++++++++++++++++-
> 10 files changed, 260 insertions(+), 195 deletions(-)
> create mode 100644 meta/lib/oeqa/files/test.rs
> create mode 100644 meta/recipes-core/packagegroups/packagegroup-rust-sdk-target.bb
> delete mode 100644 meta/recipes-devtools/cargo/cargo.inc
> delete mode 100644 meta/recipes-devtools/rust/libstd-rs.inc
> delete mode 100644 meta/recipes-devtools/rust/rust-llvm.inc
>
> --
> 2.39.0
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#174906): https://lists.openembedded.org/g/openembedded-core/message/174906
> Mute This Topic: https://lists.openembedded.org/mt/95805431/3617179
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alexandre.belloni@bootlin.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [OE-Core][PATCH v2 00/10] Add rust runtime tests
2022-12-21 21:20 ` [OE-Core][PATCH v2 00/10] Add rust runtime tests Alexandre Belloni
@ 2022-12-21 22:34 ` Alex Kiernan
0 siblings, 0 replies; 16+ messages in thread
From: Alex Kiernan @ 2022-12-21 22:34 UTC (permalink / raw)
To: Alexandre Belloni; +Cc: Patches and discussions about the oe-core layer
[-- Attachment #1: Type: text/plain, Size: 3347 bytes --]
Thanks. Busy the next few days, but at least one looks like the crossbeam
atomics problem.
On Wed, 21 Dec 2022, 21:20 Alexandre Belloni, <alexandre.belloni@bootlin.com>
wrote:
> Hello,
>
> This is currently running on the AB and I got the following failures:
>
>
> https://autobuilder.yoctoproject.org/typhoon/#/builders/64/builds/6375/steps/11/logs/stdio
>
> https://autobuilder.yoctoproject.org/typhoon/#/builders/102/builds/3985/steps/11/logs/stdio
>
> https://autobuilder.yoctoproject.org/typhoon/#/builders/63/builds/6334/steps/11/logs/stdio
>
> https://autobuilder.yoctoproject.org/typhoon/#/builders/107/builds/3960/steps/11/logs/stdio
>
> On 21/12/2022 12:52:55+0000, Alex Kiernan wrote:
> >
> > This series adds runtime tests for rust and cargo, merges (most of) the
> > include files into the base recipes and fixes target cargo builds.
> >
> > Also add SDK_TOOLCHAIN_LANGS for selection of target toolchains as part
> > of packagegroup-core-sdk.
> >
> > Changes in v2:
> > - Drop rust.inc/rust.bb merge, not actually made use of in the change
> > set
> > - Reorder so cargo test goes after build fixes
> >
> > Alex Kiernan (10):
> > oeqa/runtime/rust: Add basic compile/run test
> > libstd-rs: Merge .inc into .bb
> > libstd-rs: Move source directory to library/test
> > rust-llvm: Merge .inc into .bb
> > rust-llvm: Update LLVM_VERSION to match embedded version
> > cargo: Merge .inc into .bb
> > cargo: Extend DEBUG_PREFIX_MAP to cover vendor
> > packagegroup-rust-sdk-target: Add Rust SDK target packagegroup
> > packagegroup-core-sdk: Add SDK toolchain language selection support
> > oeqa/runtime/rust: Add cargo test
> >
> > meta/lib/oeqa/files/test.rs | 2 +
> > meta/lib/oeqa/runtime/cases/rust.py | 41 ++++++++++
> > .../packagegroups/packagegroup-core-sdk.bb | 10 ++-
> > .../packagegroup-rust-sdk-target.bb | 14 ++++
> > meta/recipes-devtools/cargo/cargo.inc | 69 ----------------
> > meta/recipes-devtools/cargo/cargo_1.66.0.bb | 73 ++++++++++++++++-
> > meta/recipes-devtools/rust/libstd-rs.inc | 40 ---------
> > .../recipes-devtools/rust/libstd-rs_1.66.0.bb | 46 ++++++++++-
> > meta/recipes-devtools/rust/rust-llvm.inc | 78 ------------------
> > .../recipes-devtools/rust/rust-llvm_1.66.0.bb | 82 ++++++++++++++++++-
> > 10 files changed, 260 insertions(+), 195 deletions(-)
> > create mode 100644 meta/lib/oeqa/files/test.rs
> > create mode 100644 meta/recipes-core/packagegroups/
> packagegroup-rust-sdk-target.bb
> > delete mode 100644 meta/recipes-devtools/cargo/cargo.inc
> > delete mode 100644 meta/recipes-devtools/rust/libstd-rs.inc
> > delete mode 100644 meta/recipes-devtools/rust/rust-llvm.inc
> >
> > --
> > 2.39.0
> >
>
> >
> > -=-=-=-=-=-=-=-=-=-=-=-
> > Links: You receive all messages sent to this group.
> > View/Reply Online (#174906):
> https://lists.openembedded.org/g/openembedded-core/message/174906
> > Mute This Topic: https://lists.openembedded.org/mt/95805431/3617179
> > Group Owner: openembedded-core+owner@lists.openembedded.org
> > Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [
> alexandre.belloni@bootlin.com]
> > -=-=-=-=-=-=-=-=-=-=-=-
> >
>
>
> --
> Alexandre Belloni, co-owner and COO, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
>
[-- Attachment #2: Type: text/html, Size: 6042 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2022-12-21 22:34 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-21 12:52 [OE-Core][PATCH v2 00/10] Add rust runtime tests Alex Kiernan
2022-12-21 12:52 ` [OE-Core][PATCH v2 01/10] oeqa/runtime/rust: Add basic compile/run test Alex Kiernan
2022-12-21 12:52 ` [OE-Core][PATCH v2 02/10] libstd-rs: Merge .inc into .bb Alex Kiernan
2022-12-21 12:52 ` [OE-Core][PATCH v2 03/10] libstd-rs: Move source directory to library/test Alex Kiernan
2022-12-21 12:52 ` [OE-Core][PATCH v2 04/10] rust-llvm: Merge .inc into .bb Alex Kiernan
2022-12-21 12:53 ` [OE-Core][PATCH v2 05/10] rust-llvm: Update LLVM_VERSION to match embedded version Alex Kiernan
2022-12-21 12:53 ` [OE-Core][PATCH v2 06/10] cargo: Merge .inc into .bb Alex Kiernan
2022-12-21 12:53 ` [OE-Core][PATCH v2 07/10] cargo: Extend DEBUG_PREFIX_MAP to cover vendor Alex Kiernan
2022-12-21 12:53 ` [OE-Core][PATCH v2 08/10] packagegroup-rust-sdk-target: Add Rust SDK target packagegroup Alex Kiernan
2022-12-21 12:53 ` [OE-Core][PATCH v2 09/10] packagegroup-core-sdk: Add SDK toolchain language selection support Alex Kiernan
2022-12-21 16:39 ` Richard Purdie
2022-12-21 16:42 ` Alex Kiernan
2022-12-21 18:54 ` Khem Raj
2022-12-21 12:53 ` [OE-Core][PATCH v2 10/10] oeqa/runtime/rust: Add cargo test Alex Kiernan
2022-12-21 21:20 ` [OE-Core][PATCH v2 00/10] Add rust runtime tests Alexandre Belloni
2022-12-21 22:34 ` Alex Kiernan
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.