From patchwork Wed Dec 21 21:16:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Kiernan X-Patchwork-Id: 17099 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 90BD4C10F1D for ; Wed, 21 Dec 2022 21:17:16 +0000 (UTC) Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) by mx.groups.io with SMTP id smtpd.web11.30730.1671657434978134351 for ; Wed, 21 Dec 2022 13:17:15 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=U0kr8HRd; spf=pass (domain: gmail.com, ip: 209.85.221.49, mailfrom: alex.kiernan@gmail.com) Received: by mail-wr1-f49.google.com with SMTP id bx10so16254785wrb.0 for ; Wed, 21 Dec 2022 13:17:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=uaZVSThNxhLP0U5ZelX6j69OiGr3IC3+Zk5gqf7nA5c=; b=U0kr8HRdCoLdWmFUAb3rdySMWGRnI9YK319/U+pUrN8gNljrxUfEYHcaB9P6V/IYi9 WgHISat8JtNH6FVhFT1jnoNfS+LxewdDVIt3Lck50Ryy8hc6RjoSFthgav50GaDHLLR6 rbeOKEwPPmTAZpSpiP6mI9GJF+XaC0GD0cB0HZ+iC0oxWsIaEZ5Ako5/BgZPU4Vfv1pe 5XVXJwAyX0LpkpPrBPWze+3L7NskFMk180ocZljzHss+kBgdqWT0+oAbPBkdIazdjueI OyNF7b9pQM4tUYeTsJcPJeJBAril5VdWhBzF6qByx5AO7kqaZ6ApPnR3Y06flwsgP6LM uM7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uaZVSThNxhLP0U5ZelX6j69OiGr3IC3+Zk5gqf7nA5c=; b=rw6YtXzN/FQgsKMvZuBJpWCPbDW2myYUWM8wGK4B7/ptDefjoYJwyBdtM2sSceN0Yh fG7+V8LZL6Xt6g8IppQh56LjohCoWHT+Z+pZlCwd2EhUcLGwxUP2vsJ6gOp4QV6hFduM kyfgjRCw2EEfDVY0lJCzNdBVbXBjwn29td9Zc0THVEHIyEJ1WpOJits/iJq3K1Al2YKk PbRybki8j0wduvSfSWkNYZFW42NrKVXyP6ovdybzku7yWV94t3tALy+36E+rbnNX+lW7 AimFBXwh6kZ8zLf0444nF5G0pEDK/MtSbo1D6/PjNci1BGwimM0xYKZqguKn5aPAhOfC MBlg== X-Gm-Message-State: AFqh2kp/7ITxK1vz1LXphlP3XqyClMYCcPUGtK3sc8Txg33BgXFt6uWw Q+1m6gmhAPORWGytMyFTcpYna9yJA/s= X-Google-Smtp-Source: AMrXdXtVeLQepp+8Us8hKnG8K4YXf5T+4DMbczUWtjbyjc8iwRBcLCEJqrtZtoHKinp3cMsFaJcvZA== X-Received: by 2002:a5d:58fc:0:b0:242:7f6e:9192 with SMTP id f28-20020a5d58fc000000b002427f6e9192mr2209531wrd.52.1671657433211; Wed, 21 Dec 2022 13:17:13 -0800 (PST) Received: from localhost.localdomain (cust246-dsl91-135-6.idnet.net. [91.135.6.246]) by smtp.gmail.com with ESMTPSA id bx25-20020a5d5b19000000b00225307f43fbsm16312442wrb.44.2022.12.21.13.17.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Dec 2022 13:17:12 -0800 (PST) From: Alex Kiernan To: openembedded-core@lists.openembedded.org Cc: Alex Kiernan Subject: [OE-Core][PATCH v3 01/10] oeqa/runtime/rust: Add basic compile/run test Date: Wed, 21 Dec 2022 21:16:57 +0000 Message-Id: <20221221211706.25347-2-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221221211706.25347-1-alex.kiernan@gmail.com> References: <20221221211706.25347-1-alex.kiernan@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 21 Dec 2022 21:17:16 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/174941 Signed-off-by: Alex Kiernan --- Changes in v3: - Switch to packagegroup-core-sdk driven from TARGET_TOOLCHAIN_LANGS (which defaults to SDK_TOOLCHAIN_LANGS) 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']) From patchwork Wed Dec 21 21:16:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Kiernan X-Patchwork-Id: 17104 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5ED58C4167B for ; Wed, 21 Dec 2022 21:17:26 +0000 (UTC) Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) by mx.groups.io with SMTP id smtpd.web10.30955.1671657436449879373 for ; Wed, 21 Dec 2022 13:17:16 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=WrLk5t6P; spf=pass (domain: gmail.com, ip: 209.85.221.43, mailfrom: alex.kiernan@gmail.com) Received: by mail-wr1-f43.google.com with SMTP id a17so15038304wrt.11 for ; Wed, 21 Dec 2022 13:17:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=tHqatNsqcFxI50LPeZTo5jfd2/mA6woHq+ctiPQac0I=; b=WrLk5t6PmEoAAWqjWjj032pLpcEUIDyG7BNNXXrCIo1BWALm5yXAD8GaiRXPbrmHwx UzbbjheTkckvVsCH5rOugjT9x1BM5wGFkIcudZMwlF83mpPKRedtbbI7/sYsuLPB8Diy qiPg17HOYw+TBvjNK0PWs+cSs61dq1Ssj3kUjNqPzwxigT+W9BklwLjy5qREKblde6I5 BEkvl9/Ok5vhsuhwvGFEPgD4QFKu1LMRynH3qOL2kYziHpQgzfjmcUXcrumzjyZxG0pX 0MA9JzhWiQIeCW8V0CVo2mLzFrxWZxNcgOFN74T2yd0+ddSqui8U3od9ED0oWrO+6HTu W7pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tHqatNsqcFxI50LPeZTo5jfd2/mA6woHq+ctiPQac0I=; b=2Qg+kFi1e4Z/4ZQX3Zv1iVnW2lnEGGMBHXcaR1PJoAstSIUbwd27uGXpOPtEBSYs0d H+zyrHTo6akgFO2YWUmktx7OwAki4+t82TOOacZGuMJb3nDU3USPLnBHFi4OFAjzWsdZ ZOhrPnQwAw3sL82uR3Mx4qV1+Jn82XXPvjdvNwI2vJgIcNXog75vNlpGUU80abeV/roc wMaPfjVGN1GkclmhjnvdULnFGcjeskTJ5+JDKGZVCn2QNyptLSSU6e4G6Xpm/m/NlZyz Vq6ylutJi94Lp+yZnrm6XgIpr0pQ4C2P3HZRHc1hUz1YztQf0HtUbs6rN6QUQfKEV8H1 aObQ== X-Gm-Message-State: AFqh2kq2ZNk5SZUsP1Qu2pE6kBE1m6j7IqZdaZLInOWGQ027ucID8rNc O0oCQmnkhRit8HkwfmehkjJ6DbV8vIk= X-Google-Smtp-Source: AMrXdXs9x3Yjc93afocm4q1DeyFpxeUAWB8DVQ3fnFsAOU+F/sZ5ybGWZH7X3sH3PCjYHYJQj+8djA== X-Received: by 2002:adf:f983:0:b0:24d:cac0:96bb with SMTP id f3-20020adff983000000b0024dcac096bbmr2064007wrr.67.1671657434786; Wed, 21 Dec 2022 13:17:14 -0800 (PST) Received: from localhost.localdomain (cust246-dsl91-135-6.idnet.net. [91.135.6.246]) by smtp.gmail.com with ESMTPSA id bx25-20020a5d5b19000000b00225307f43fbsm16312442wrb.44.2022.12.21.13.17.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Dec 2022 13:17:13 -0800 (PST) From: Alex Kiernan To: openembedded-core@lists.openembedded.org Cc: Alex Kiernan Subject: [OE-Core][PATCH v3 02/10] libstd-rs: Merge .inc into .bb Date: Wed, 21 Dec 2022 21:16:58 +0000 Message-Id: <20221221211706.25347-3-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221221211706.25347-1-alex.kiernan@gmail.com> References: <20221221211706.25347-1-alex.kiernan@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 21 Dec 2022 21:17:26 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/174942 Signed-off-by: Alex Kiernan --- (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" From patchwork Wed Dec 21 21:16:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Kiernan X-Patchwork-Id: 17103 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7CDCBC3DA79 for ; Wed, 21 Dec 2022 21:17:26 +0000 (UTC) Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) by mx.groups.io with SMTP id smtpd.web11.30733.1671657438307240519 for ; Wed, 21 Dec 2022 13:17:18 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=GtZfcxvt; spf=pass (domain: gmail.com, ip: 209.85.221.51, mailfrom: alex.kiernan@gmail.com) Received: by mail-wr1-f51.google.com with SMTP id w15so16182915wrl.9 for ; Wed, 21 Dec 2022 13:17:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=C/bcoh8mrr5x0qx9JKuQrmbDQU5745WgEa5whVlg5mw=; b=GtZfcxvtVbu8IqeTEqkZ7zyQGh9VS/45lgC3Woc8UYdmXpWVspaLsxS2x5+d2Hi/Qa 6L4/9qD7q3GYVwojjyF0UXk/3xSQYAtbc3898iL0FiE4divVCXcc+o+Z2pXOtJMWD4gj OWJzrDerqPjDf0665qeBLA9XzZLcKrJk0AUyQCDebbnNe/1VKKOEC4PlZOb+G+R9iy+c Mb07rPpfXIozlwxeth6i53fbhVgqyJNNcNu4OeaI7gqhpD0idaDH/Z/xSWEISFYeVux2 2YcbMtdsp7iZX0Uqp3p3MHiBuEvr/2pygrutHyPjGsp74Pt2RvZHvsv2xYcwAo/4PvvR duow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=C/bcoh8mrr5x0qx9JKuQrmbDQU5745WgEa5whVlg5mw=; b=0cCQtQUxDiIgOxDGmvnlKfFwo4zP6t7mAIlepePL6SFsUk5ntnwUYBzxyQegjB3ZNR 9gVWCECKHRNOhwgh+w8+2a8jOkqZeUMFj+bePcALT42+EFOUuoPoIY27+5ttfuCHfZ64 JJLjrhB2a8YtTZgyDug7t90gKmuaR7dlz9xeMxCazGxNkn+hHzmgOGliT3B2/a4Khm8c E5baHIIldB09f+q1GEALysdZLXfHTrLlSV8B8a+mUejhqM4IOSeWl/k9q3Zdo9hO7Fzp fHPS0EH/TLU00ExX9EotzrIlqVKuHV3fbBwT8hSf4OW3RG+KxoxwPz2YQ2tMb/WyZdFP QGZA== X-Gm-Message-State: AFqh2kroFjrbdpd46nGvfOCjMLZ6nMfwUkTtwoMLY68xoXuG9rApc5PE A4xBmh8LbLz9yoNb7UDIU06zUrNGlaE= X-Google-Smtp-Source: AMrXdXsuwp7dnczODGK0SCe/TJ0ZUL/CRfkQyd+YDTpgzEsTmJV/ez3S3md2XZqsZPwuFmTEu/Si0A== X-Received: by 2002:adf:e409:0:b0:242:45e7:db17 with SMTP id g9-20020adfe409000000b0024245e7db17mr1863159wrm.66.1671657436693; Wed, 21 Dec 2022 13:17:16 -0800 (PST) Received: from localhost.localdomain (cust246-dsl91-135-6.idnet.net. [91.135.6.246]) by smtp.gmail.com with ESMTPSA id bx25-20020a5d5b19000000b00225307f43fbsm16312442wrb.44.2022.12.21.13.17.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Dec 2022 13:17:15 -0800 (PST) From: Alex Kiernan To: openembedded-core@lists.openembedded.org Cc: Alex Kiernan Subject: [OE-Core][PATCH v3 03/10] libstd-rs: Move source directory to library/test Date: Wed, 21 Dec 2022 21:16:59 +0000 Message-Id: <20221221211706.25347-4-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221221211706.25347-1-alex.kiernan@gmail.com> References: <20221221211706.25347-1-alex.kiernan@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 21 Dec 2022 21:17:26 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/174943 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 --- (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 From patchwork Wed Dec 21 21:17:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Kiernan X-Patchwork-Id: 17106 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 720B4C46467 for ; Wed, 21 Dec 2022 21:17:26 +0000 (UTC) Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) by mx.groups.io with SMTP id smtpd.web10.30958.1671657440239179906 for ; Wed, 21 Dec 2022 13:17:20 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=YLCL8MMu; spf=pass (domain: gmail.com, ip: 209.85.221.45, mailfrom: alex.kiernan@gmail.com) Received: by mail-wr1-f45.google.com with SMTP id h7so16204770wrs.6 for ; Wed, 21 Dec 2022 13:17:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Ut1aiMdzTisZiqksv21t+MHqZQCsufFeklbDKVth+Po=; b=YLCL8MMuvZeNhds/21GoA9cdDx1zgVGMfH0BGVGfjlucIB/xH2T3Ic3XFTNVJg4MbB 5w13z1O9nlWDO0WjxUpYC0heBAweTnlK05//pbWlOygcxG71eqX/H8r7aDtzTnNuQMt0 CuVyoeRVBcvYB7jv2uvEQNfqGlLluPXoft+IifS2kcHHvTh56xE0+5evJTvtbfeidnD7 JM2APHJeRsIPNTV5s9/afsytZV5m476fjViZenvLe92YtDZxK7x/7mnOrywMmN8P/D0M CMFypEyR2OSTudd8RalzKokvRMEaEQXzdLMirZd3lJL4kuODnZHWc0/izswoqXFjeOww 03AA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ut1aiMdzTisZiqksv21t+MHqZQCsufFeklbDKVth+Po=; b=QtUhlRDAcVh68c627ysJLxUWOrdEk8QfUaRiSwAZHsaGgg9KLFBPioYjl26P6ewdZs 8wGzXkcIobmB55vNU2+CTs6/rxdxBwfi8xtqInSqCMnmQGlIMdo+0461+wgu4Amf8hD+ 1klzrIjRbH7LBvICOTeIYi6hMLIWgOUmTELR5tG8nrOpYXNH8aSj11fdvBNYDEPDZMd/ sRtwR8nG/QZhDpB3dwETyEjbFrNyWaN1m2TUHb5i5taxkumZwchsryIlmJnn6k/bEp2M TeHT/XBpWbjSKZZ5JuSHaJouIlcwfSpem8+jGMsjWZEERPrTOGPiS4XcNS1ayhnVXZrr Qtag== X-Gm-Message-State: AFqh2kpZ+bEnzZHRZNhY4R4tyxCTwvHBBC3hPOz5NUVPSxWOlsqL4YJE 7a6+KXC/Judhxo1VqWBtrtxL/U9xOyI= X-Google-Smtp-Source: AMrXdXsQbqIpdW7U9BpmwFKInLSP/BAZNIYzXUfvSXZ7JM8MHOSjJhYCzPiZMP2NwzPljYPLtp4uvQ== X-Received: by 2002:a5d:66ce:0:b0:242:7c7a:7ee7 with SMTP id k14-20020a5d66ce000000b002427c7a7ee7mr4478611wrw.53.1671657438223; Wed, 21 Dec 2022 13:17:18 -0800 (PST) Received: from localhost.localdomain (cust246-dsl91-135-6.idnet.net. [91.135.6.246]) by smtp.gmail.com with ESMTPSA id bx25-20020a5d5b19000000b00225307f43fbsm16312442wrb.44.2022.12.21.13.17.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Dec 2022 13:17:17 -0800 (PST) From: Alex Kiernan To: openembedded-core@lists.openembedded.org Cc: Alex Kiernan Subject: [OE-Core][PATCH v3 04/10] rust-llvm: Merge .inc into .bb Date: Wed, 21 Dec 2022 21:17:00 +0000 Message-Id: <20221221211706.25347-5-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221221211706.25347-1-alex.kiernan@gmail.com> References: <20221221211706.25347-1-alex.kiernan@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 21 Dec 2022 21:17:26 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/174944 Signed-off-by: Alex Kiernan --- (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" From patchwork Wed Dec 21 21:17:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Kiernan X-Patchwork-Id: 17102 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6B816C41535 for ; Wed, 21 Dec 2022 21:17:26 +0000 (UTC) Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) by mx.groups.io with SMTP id smtpd.web11.30735.1671657441973301734 for ; Wed, 21 Dec 2022 13:17:22 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Hg9rqQUD; spf=pass (domain: gmail.com, ip: 209.85.221.50, mailfrom: alex.kiernan@gmail.com) Received: by mail-wr1-f50.google.com with SMTP id y16so16225573wrm.2 for ; Wed, 21 Dec 2022 13:17:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=d4gQi8OuYoeZcVag7RZJ3HkFSj96ezDIqCzNwhzZp4I=; b=Hg9rqQUDS2JahgVV19hcUtT36bitHghPfuYgMMluvA285bfSVuEdERLEpRejBVcF2O 8jnK8W8y4QW3MD173HuXM3WqcQaDUezERyqntxC7yM4QHymThGBGaj6mO9EZiQHnZ9d1 zmDssEBuu3d6XV4J0tlQRXk+RK9pEnvn/u0FMM63eOxc8xXighi19Vz+QJfURu+eTtI7 Wovvf7ijvAgz312xcZp5PM2puLWAeySpT2QatTfD+MnVCEImgpP9MQi/LcSJmxrLT0e7 arQmtaxGRxfFwnS/nLkm9H5pSefzyeJkHwUhZkxlah9LkkVDtguZ8gVC1BpdlRGZPPHJ F89g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=d4gQi8OuYoeZcVag7RZJ3HkFSj96ezDIqCzNwhzZp4I=; b=kaniAYZA4IFXpG+p1lK9VvDYcOrYI/UImcvxIeelleRIwsGEaTLRpm/57xX9AnaS9x 8hV2DbEfRYIhXQu8Xm4wo4Zun2MD3ABKtbBTlgYGXzH765BuTnAkDjpykLcuWhvsk18p WSM78AYIXqUVSzQy6Q1B1wJHlkueyJdIdH3+agntokYGyCkI6C0FY0jkuRJvbSUrDq4Y FEw6KJgE1+aUQ+IzIo4tjSzP1BVwSyR678HV/vKza6ei/an/Zz4Hp0aV/n3EDJTZZgBH wte1LFTIXT+TFLodBhJ2JSoT7GqCm3Al1Arr/gONzda1L4HsGEkRqSx4GRRfOr7EW4Y8 b5UA== X-Gm-Message-State: AFqh2kqNhRR+grOYhnOr23eLivBsm7VkM2Ilv7vFIvGuee2izf3HeJ/D U97FhKQy2lGywZXI2VFbmT1vV2G/zXA= X-Google-Smtp-Source: AMrXdXutChj7u+dHJ4RzJ5/pSTKYqPkdHxtzXhQvf+bw2Zs5hTtGwlPzCAr41tZUpW0ZRbMLVImmDw== X-Received: by 2002:a05:6000:18d1:b0:242:1f46:fb8c with SMTP id w17-20020a05600018d100b002421f46fb8cmr1964950wrq.41.1671657440189; Wed, 21 Dec 2022 13:17:20 -0800 (PST) Received: from localhost.localdomain (cust246-dsl91-135-6.idnet.net. [91.135.6.246]) by smtp.gmail.com with ESMTPSA id bx25-20020a5d5b19000000b00225307f43fbsm16312442wrb.44.2022.12.21.13.17.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Dec 2022 13:17:19 -0800 (PST) From: Alex Kiernan To: openembedded-core@lists.openembedded.org Cc: Alex Kiernan Subject: [OE-Core][PATCH v3 05/10] rust-llvm: Update LLVM_VERSION to match embedded version Date: Wed, 21 Dec 2022 21:17:01 +0000 Message-Id: <20221221211706.25347-6-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221221211706.25347-1-alex.kiernan@gmail.com> References: <20221221211706.25347-1-alex.kiernan@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 21 Dec 2022 21:17:26 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/174945 Signed-off-by: Alex Kiernan --- (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 From patchwork Wed Dec 21 21:17:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Kiernan X-Patchwork-Id: 17105 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6DE57C10F1B for ; Wed, 21 Dec 2022 21:17:26 +0000 (UTC) Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) by mx.groups.io with SMTP id smtpd.web10.30960.1671657443193836384 for ; Wed, 21 Dec 2022 13:17:23 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=pgf/bL5y; spf=pass (domain: gmail.com, ip: 209.85.221.44, mailfrom: alex.kiernan@gmail.com) Received: by mail-wr1-f44.google.com with SMTP id y16so16225623wrm.2 for ; Wed, 21 Dec 2022 13:17:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xXKqORzweSvujDCxv+GaazsPIlo9TE4kGXHlHGAWgvI=; b=pgf/bL5y/zef5BFRoRCb9Yewta3BqjAOUQ98JBVtsdRYWMOjh3rIfsqZCnDrb8QN+X B2Qv4iDd4a0Yzj0PgxLZlzXaF3hl2/N2FoGqcx2VKyNfK+AKDiTD4OHO9Ce7Y/+ggA6a J4a9PyW9AHjGMiUkSpyHSAODr4q6NMOnCTJbmH76WIPp5QY3wRgPNRL6xS6nhqxcb4i1 tKrV4pGkPgfRy9PF0N38p7yP8I2LGl5qvE5y4MvxK5xY/zN9PGuyAnklpF+UerPfFYkq scmAXQns9uLgYFZ1LgGUiC9AY5EBbKOCZXseZjBgf7ewXNnJBqEDpiXhlJVdBLzQUB7G IIHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xXKqORzweSvujDCxv+GaazsPIlo9TE4kGXHlHGAWgvI=; b=cOERwrQStlqykq/m42eijd58I5I0Ak5WUnjUdcpIDgZ3vaGzkMot8mIjdVyTg0Lz4t 185bkVXBamdSZrCy4/aO26c39P34z6CXBQUMTagXDby7BssvMEOvB3H1NBYaslH7BiAx jMrvmfaijGz0l193/FhDYvYIldm3/91r+gMMJz7SOU8u2Jkd4Zffjbmy+jGxGDDxyUUN yFhLgb5dwj1WSYGCg+ZOWCU8hZyTCvstjwRJpc0mbVv8A3NX1PsAIxxkGWfivJvHHb4P grc90i4TJHchzbF/4pEwQ7BWGAzTc1YYaKTHoEeWeO3kHlwQyxC8szyUiRV7SutsYaz4 /+nA== X-Gm-Message-State: AFqh2krMpE/dXm7qUOW1Bejbkf37L2nz8w4+PJoYNAb9TCibgSL8hJsM oJEctIhLMSB+A94cP8I1uPkZ3Ps58kw= X-Google-Smtp-Source: AMrXdXuO7agwHekziJefvDPxcsr6UPVxCchZMJoXbdNlt1nFxdqC6coxtBHa4CS9y8+6kF+PpfAdPA== X-Received: by 2002:adf:f00c:0:b0:242:4d1a:aa36 with SMTP id j12-20020adff00c000000b002424d1aaa36mr2173758wro.56.1671657441445; Wed, 21 Dec 2022 13:17:21 -0800 (PST) Received: from localhost.localdomain (cust246-dsl91-135-6.idnet.net. [91.135.6.246]) by smtp.gmail.com with ESMTPSA id bx25-20020a5d5b19000000b00225307f43fbsm16312442wrb.44.2022.12.21.13.17.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Dec 2022 13:17:20 -0800 (PST) From: Alex Kiernan To: openembedded-core@lists.openembedded.org Cc: Alex Kiernan Subject: [OE-Core][PATCH v3 06/10] cargo: Merge .inc into .bb Date: Wed, 21 Dec 2022 21:17:02 +0000 Message-Id: <20221221211706.25347-7-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221221211706.25347-1-alex.kiernan@gmail.com> References: <20221221211706.25347-1-alex.kiernan@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 21 Dec 2022 21:17:26 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/174946 Signed-off-by: Alex Kiernan --- (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 From patchwork Wed Dec 21 21:17:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Kiernan X-Patchwork-Id: 17101 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 60B21C10F1D for ; Wed, 21 Dec 2022 21:17:26 +0000 (UTC) Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) by mx.groups.io with SMTP id smtpd.web11.30738.1671657444730131267 for ; Wed, 21 Dec 2022 13:17:25 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=i1dFRSZm; spf=pass (domain: gmail.com, ip: 209.85.221.42, mailfrom: alex.kiernan@gmail.com) Received: by mail-wr1-f42.google.com with SMTP id z10so5632840wrh.10 for ; Wed, 21 Dec 2022 13:17:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2HA/VgbRt4K5DtgWiWJz+bCKxX+eSYbjrNMB/rIykaA=; b=i1dFRSZmmhWa9gvdrj6e5naSac6Fakbxt0C6EW1suBaD6S94nNg8bT7YV80zw9b7Vx r22K84oA2DUNGIiiU/qSQi3ee3yn8xkCuWoFhtVii9rwytc4zMnzpO12fhxT5CQA1DkE NKDtODPg3X/FdimQVC4f1/cVkY3TpJqnnD2R83wo/ULFAQEym/JGKEq/McGtbk5aw7F5 chZRWrUKyx0qTfawM20KwayQ0ZH1+wSwib3iMphx7t6ngDedDgT647jH7U7DH3ogYm5O +b48M2zTICkPUj2Q7ro1qbcx4TfqceIR/RL+kNNkF5qnd9kTBiiFWMtXjGhiiu8XYLtF QgRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2HA/VgbRt4K5DtgWiWJz+bCKxX+eSYbjrNMB/rIykaA=; b=s+tZbQZJtEL5nL3SkoI1j0ExMvVpF/Y5AUBRJOgBKE/eL7B8Bk+kI+pQfRd8QpBnh3 dzkokwsfJnlsXdMuDX9HXPBOtz3g2+7PQZ4TWCNWsZ91r85cJQrr+OpKba8sV7ALzZOE HpssX19Z+2zxo5lvv+NDq0o1HaKlfR86Yx/SbwTovCEVU7nYnfXaXaeWmzqzSPmpBrjD AJhxQ/+YAOaQ1CETE3mnQ4UWuV6R4lEJ7bi+lCwAsLlKtzU1wy5mh8R0rfMqdDNydFof k+pU9Gu7jrS+ogO1hxqe8oMxFMO9SLbQmdvoA0OlF52L2EHSnerhlFOjKIvLZ1JSLGVU 2V/A== X-Gm-Message-State: AFqh2koIqp69RNMjo57RrG68GWMvl7dEyFPAp6yHdOjjDCM0eSIGJAO0 ENRcLKUzHbLqDPIartcKrcII1AaSFEM= X-Google-Smtp-Source: AMrXdXvmZ8ekFdtWqqvK0WYFDCKpwb9zSVWissULrbmAN5b7Zi0+sYWcxPI8p2OaYKzcIt346oeSjA== X-Received: by 2002:a05:6000:120a:b0:24d:58b3:e55b with SMTP id e10-20020a056000120a00b0024d58b3e55bmr2261130wrx.22.1671657443124; Wed, 21 Dec 2022 13:17:23 -0800 (PST) Received: from localhost.localdomain (cust246-dsl91-135-6.idnet.net. [91.135.6.246]) by smtp.gmail.com with ESMTPSA id bx25-20020a5d5b19000000b00225307f43fbsm16312442wrb.44.2022.12.21.13.17.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Dec 2022 13:17:22 -0800 (PST) From: Alex Kiernan To: openembedded-core@lists.openembedded.org Cc: Alex Kiernan Subject: [OE-Core][PATCH v3 07/10] cargo: Extend DEBUG_PREFIX_MAP to cover vendor Date: Wed, 21 Dec 2022 21:17:03 +0000 Message-Id: <20221221211706.25347-8-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221221211706.25347-1-alex.kiernan@gmail.com> References: <20221221211706.25347-1-alex.kiernan@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 21 Dec 2022 21:17:26 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/174947 The cargo build builds vendored libgit and curl, but these exist outside ${S} which DEBUG_PREFIX_MAP covers. Signed-off-by: Alex Kiernan --- (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 From patchwork Wed Dec 21 21:17:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Kiernan X-Patchwork-Id: 17100 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5D8E3C4332F for ; Wed, 21 Dec 2022 21:17:26 +0000 (UTC) Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) by mx.groups.io with SMTP id smtpd.web10.30962.1671657445911287787 for ; Wed, 21 Dec 2022 13:17:26 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=JE0ZHGDs; spf=pass (domain: gmail.com, ip: 209.85.221.45, mailfrom: alex.kiernan@gmail.com) Received: by mail-wr1-f45.google.com with SMTP id m14so16191185wrh.7 for ; Wed, 21 Dec 2022 13:17:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+KTwWqstqugEIhkp7pEb97N3UY4xkdK+Q0LeYPIX/1I=; b=JE0ZHGDsnpbwKdhB6iqoltMx6w27SWxsXY0TSp7f/QH17NxX3UrtD/Xag7oqTNTmyu YXdtMF7V7xvg82rUWHIvzSwO6XYq6gTZuAOi3ACbVBdEgoEeAXQ4bXpHSqrZeLsXbgoi Y/mo1Z9uDdDFGs8APGBOo4le/huKuk5Fcz+nJz4JzRO3NvEoodAviVDoMiWXC1hqZ2qG PzmMGLmKgd6f9cmZgiMsz3CnCD0D6oZKIInM8+t+Vb8EmzIEAF4gDw3Bd4Wh5JOsFjzC XMF/yy7R4kSLIRENazuAR7UyZwrt3XNXjjUAdmYp6/1mBVPE98nftMHXrV5+GZKs8bFj egmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+KTwWqstqugEIhkp7pEb97N3UY4xkdK+Q0LeYPIX/1I=; b=E+nkalYMBsnxs5ou6qwmy45Ei0w1uws6BNFr+H5vBsMfvr7xJ1yaOelJWUYav+TGDk 74Kj2ix8YnwFUMCoQEwVieNOO7mOO9qAhEzd8pya6S0LbWJmLXL5lOQ2TC+kjMJlcH+S ybEn1KlFhlqGJJlSSDSk/OmzNY6eiDJ7Pr4ZpCfQXMneIkrf90zTjiUOAdAvS6vi6eOE iqsJUA2yGC8VrSMzrs/ZCyQPRl+IyoDtHdEYPgwsqjPceMsmZcE6JPuFfrV4ECmt/ryC JjVKGRl/UL+eQFnCNFYaFT4x4lu6er3Ns7AJHDyWC6l8uzlkYytN9gonIVzWxCmNA+zG +O5A== X-Gm-Message-State: AFqh2kr3wmwzh4LGBlUhQWie8ep/O95SjswKfyydkxRe2CIjsiKFHDRJ iqiT8J8H65q1VzYrgMbO0I8BeOj/qgM= X-Google-Smtp-Source: AMrXdXs2NdmoALwMDy3TW00Lgd9urx05vP4AfnBej1e6Gyh/JQBXhV5Wvhk1JEyXPVEHdhG7WGeLmA== X-Received: by 2002:a5d:4005:0:b0:268:7106:a318 with SMTP id n5-20020a5d4005000000b002687106a318mr2073785wrp.21.1671657444321; Wed, 21 Dec 2022 13:17:24 -0800 (PST) Received: from localhost.localdomain (cust246-dsl91-135-6.idnet.net. [91.135.6.246]) by smtp.gmail.com with ESMTPSA id bx25-20020a5d5b19000000b00225307f43fbsm16312442wrb.44.2022.12.21.13.17.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Dec 2022 13:17:23 -0800 (PST) From: Alex Kiernan To: openembedded-core@lists.openembedded.org Cc: Alex Kiernan Subject: [OE-Core][PATCH v3 08/10] packagegroup-rust-sdk-target: Add Rust SDK target packagegroup Date: Wed, 21 Dec 2022 21:17:04 +0000 Message-Id: <20221221211706.25347-9-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221221211706.25347-1-alex.kiernan@gmail.com> References: <20221221211706.25347-1-alex.kiernan@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 21 Dec 2022 21:17:26 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/174948 Signed-off-by: Alex Kiernan --- (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 \ +" From patchwork Wed Dec 21 21:17:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Kiernan X-Patchwork-Id: 17107 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6F538C4167B for ; Wed, 21 Dec 2022 21:17:36 +0000 (UTC) Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) by mx.groups.io with SMTP id smtpd.web10.30963.1671657447042274178 for ; Wed, 21 Dec 2022 13:17:27 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=LwfDtxHd; spf=pass (domain: gmail.com, ip: 209.85.221.42, mailfrom: alex.kiernan@gmail.com) Received: by mail-wr1-f42.google.com with SMTP id o5so16211081wrm.1 for ; Wed, 21 Dec 2022 13:17:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=bQrkW3e4aR74/DLIkNV2mBNqPpH0PSvh8VIWn2sAero=; b=LwfDtxHdzGybbGnZAwmJ30hiumEwywPi/XiYUXy2bVusWk1q02NuUVUCOriKepyX+p 6M3k62rhCVQvRKyush2YOXbfLxD2OBjPoOF+a/6IQ9gMd4gUUdZBkGF7tw/CI+wMRjLy 9Ki9Hxg/Qdqcy4LZ9eWbOcjTg4kIEhn3e9X3md2y7Ar1NHb5KFvpAlQ1zwBtnjPyLLVI sKXBP2cJqXqMmh0PPUTl677c+Yf68RwcV4g6Ej3uFhmvkfy79EVcvtnxJu/2w+n1OY4A 16wCm8qvnMuaEfrq/LqiXNjiz2bj3biXtQtsF6xZ62K6cjOlaKm5rbXnaSxICFph+o7r biIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bQrkW3e4aR74/DLIkNV2mBNqPpH0PSvh8VIWn2sAero=; b=DpCBB4R1QiatJw2gr8kUwkNd1gXsRjKu9cDv+O7/BnUND88zXyz0EcfUvBZBt+Jnck iKvolqf4i7KlKrsN0q5Vuwtt64ZxPBLG0D0Mv9zsT9ZWfTUFGR8tB0uTTPKy59k5DEPI KeRNw0mE/61NioyTHAOswO3gNeFd1cm1TBQLyxIsLkCvo3H0a4JntyvdecLsyxJ+s2dR CLbHQbGfF/sJPglH8oG3gI6IbUWHoBG5sTajbdSP8wF/gFCpWBQSuCqHJHF2JtpEDTYQ 3tQz7GHxC3WCWj+fTJekBXlgVpTmQ7HeR1to3OsFhZIYVVzioBmp42Kj+xwGxKG6YOtd 6ESw== X-Gm-Message-State: AFqh2kpyA37dmPQE2VJEcWdG+oagwn/VHMFpJ8YThplOnLe17vXjq5CS LxavECXB89VoW3O37L1vbFfXg9Yc+b8= X-Google-Smtp-Source: AMrXdXuI7g/FelTh2p81Ceyk3KHGCY7fYziN5Etcj4yDzJ8ua1wQq/Z+Z/TDp552rGzlWRirry/6PA== X-Received: by 2002:a5d:4008:0:b0:241:997a:4f57 with SMTP id n8-20020a5d4008000000b00241997a4f57mr2051648wrp.39.1671657445393; Wed, 21 Dec 2022 13:17:25 -0800 (PST) Received: from localhost.localdomain (cust246-dsl91-135-6.idnet.net. [91.135.6.246]) by smtp.gmail.com with ESMTPSA id bx25-20020a5d5b19000000b00225307f43fbsm16312442wrb.44.2022.12.21.13.17.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Dec 2022 13:17:24 -0800 (PST) From: Alex Kiernan To: openembedded-core@lists.openembedded.org Cc: Alex Kiernan Subject: [OE-Core][PATCH v3 09/10] packagegroup-core-sdk: Add SDK toolchain language selection support Date: Wed, 21 Dec 2022 21:17:05 +0000 Message-Id: <20221221211706.25347-10-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221221211706.25347-1-alex.kiernan@gmail.com> References: <20221221211706.25347-1-alex.kiernan@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 21 Dec 2022 21:17:36 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/174949 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 --- (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..104f3549d593 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' +TARGET_TOOLCHAIN_LANGS ??= "${SDK_TOOLCHAIN_LANGS}" +TARGET_TOOLCHAIN_LANGS:remove:sdkmingw32 = "rust" +# libstd-rs doesn't build for mips n32 with compiler constraint errors +TARGET_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('TARGET_TOOLCHAIN_LANGS', 'go', 'packagegroup-go-sdk-target', '', d)} \ + ${@bb.utils.contains('TARGET_TOOLCHAIN_LANGS', 'rust', 'packagegroup-rust-sdk-target', '', d)} \ +" SANITIZERS = "libasan-dev libubsan-dev" SANITIZERS:arc = "" From patchwork Wed Dec 21 21:17:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Kiernan X-Patchwork-Id: 17108 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6F32CC4332F for ; Wed, 21 Dec 2022 21:17:36 +0000 (UTC) Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) by mx.groups.io with SMTP id smtpd.web10.30962.1671657445911287787 for ; Wed, 21 Dec 2022 13:17:28 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=b+v4TrVr; spf=pass (domain: gmail.com, ip: 209.85.221.45, mailfrom: alex.kiernan@gmail.com) Received: by mail-wr1-f45.google.com with SMTP id m14so16191266wrh.7 for ; Wed, 21 Dec 2022 13:17:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4dQHPa1jl42Qnqzrk65PfWAhCFFrh3E/g4lPOBwYjb8=; b=b+v4TrVruwr+RPXnm71rIYPtmOMK8BjIyur3LHhuFldzgced8iGa93lMbU/Oar6gvf cxMG5RlTtiIs8+oIq244hny0GVfq+6nnpb4UNZL95qa54uDMJkY+Dp0XsAZtSV44I719 LugwqE5yLD/glULj+3Qnw2sqw+jV2NFoBAtL3h+sXBIZl9VkZIHb6fWLGAsyAbMEsQw8 sBMNb5QqhJYOA7m59auadK5gZyWBYj28DyGDbaE74+q2l8HS7QoWj+CyhRi2Df2kb7rW TmwtG+lWGna4baDe0hYE+tO2uhDnZRu7dbYYi5s2LTYOVBaDTKM4G8mQlgSNiE6x8PSj Ew0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4dQHPa1jl42Qnqzrk65PfWAhCFFrh3E/g4lPOBwYjb8=; b=fUpZEwJytInNQWZ84y/plf4eLdUl3TPdaAakvXOWVjyTi+R7ZxkAq2BpOPesDuWHkB aARk4dzB5AIhZ+PThhqD869VZpBlftG0mpjZyBgq98lJgC9EQGH8Jfx3InXYTVAP7hlJ 51zaHKyuVhSiK9xMiBIvqTs34vx5rZZMBQETXTf8PYHunkyvVQVaCVxFU/bdEewdahmi ckbV134qzf+1IF5yDoXXhUWvvI8tC3oXdbANUMLUn91CCplqMqJbQEFIo+zldYcLeiyy 2piGcB5r4fv6L93Cfpj9zPO1LHrxMAxb2SzvmL3h2bW4I7sx/dlHid25ROkxLgNwhDI/ lGfQ== X-Gm-Message-State: AFqh2kpz4IgljekaQXet6M3lhuPrPkUBT4GeE1hvfDiumv28ps7oSW6y tQ4lwpOXaygLGTwgBbs2wqvk2NyVmjM= X-Google-Smtp-Source: AMrXdXvZqmkDL7kZ8wXQTfeP5V2UyD0Km4eAxWFpTozsnEnza/4sSABOrH5+KA9TaD1bMoip+b6xNQ== X-Received: by 2002:adf:e10d:0:b0:242:cdf:ab91 with SMTP id t13-20020adfe10d000000b002420cdfab91mr2122831wrz.56.1671657447018; Wed, 21 Dec 2022 13:17:27 -0800 (PST) Received: from localhost.localdomain (cust246-dsl91-135-6.idnet.net. [91.135.6.246]) by smtp.gmail.com with ESMTPSA id bx25-20020a5d5b19000000b00225307f43fbsm16312442wrb.44.2022.12.21.13.17.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Dec 2022 13:17:26 -0800 (PST) From: Alex Kiernan To: openembedded-core@lists.openembedded.org Cc: Alex Kiernan Subject: [OE-Core][PATCH v3 10/10] oeqa/runtime/rust: Add cargo test Date: Wed, 21 Dec 2022 21:17:06 +0000 Message-Id: <20221221211706.25347-11-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221221211706.25347-1-alex.kiernan@gmail.com> References: <20221221211706.25347-1-alex.kiernan@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 21 Dec 2022 21:17:36 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/174950 Signed-off-by: Alex Kiernan --- (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'])