From patchwork Tue Dec 20 18:06: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: 17006 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 B7A43C3DA7B for ; Tue, 20 Dec 2022 18:07:24 +0000 (UTC) Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) by mx.groups.io with SMTP id smtpd.web11.57309.1671559636214307821 for ; Tue, 20 Dec 2022 10:07:16 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=QQvwOcxs; spf=pass (domain: gmail.com, ip: 209.85.128.43, mailfrom: alex.kiernan@gmail.com) Received: by mail-wm1-f43.google.com with SMTP id f13-20020a1cc90d000000b003d08c4cf679so9451770wmb.5 for ; Tue, 20 Dec 2022 10:07:15 -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=AkX+OL5XGvyNxIw1EJ1jBvBfH7lZ2ywO9otqk6cGgFY=; b=QQvwOcxsaICNWgpGWxeySH3FTFQFsVSFKIMxPFid7MiriR1RKWj7c2U1YUShIqSiIl NnLQ5MzCFUayA9hwGDr1gUR/euskY5qGGWl17EbqaFHPJRaME94/DbVsRM/JsF71yC3O 6w55EjaFJkqVa0rQCcgijWfcWu+5cLQ2hwIKs6ksFF+ZJF3Gss+r3o6acKidjssk1paI 8lpaBV2k4SINPDKeKuWD2QZDNLSkythwhqJPyghSco/Ylx9geLa+uqJ1MsyJvFIKs1N/ H4Rq4W7bDSxQ7Gxe9KpAoUrgR82XFibCpzEciyy0TeSIHTPAImSmrWWVYCiyw4SUZQ9k CnLw== 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=AkX+OL5XGvyNxIw1EJ1jBvBfH7lZ2ywO9otqk6cGgFY=; b=2R+gE4G2AXsEjjJMxQicm3KTdmRGWbZd1hoASRQ4s5BYQF2+ZzPBJIWL6MMA/Yefl7 ysFc8kQmFmISUlBJFankAfWpsGQ5yHrXCqZTotQPI4sXwgbEoswxRP0kK9/RQ996f+Ve uewg1OL4O8+faprKAoaKzHlH/+GqSeZiYAEV4z8JwoREPBOcHAQ2OJac6CAwm+UdPiIn ZWjp2pjiMh41MZnmesNpfT2NJjbB+mPtOMPNA11ilX2n4C5m5N8a4b3NSAAVnq7LFEtk 42sATuZO3ce9TntdSWizlIVVEfluYYxJ2y0zw2NUew/5yBk5QaV3LjHQo/4wjJkGsZKM MQ3A== X-Gm-Message-State: ANoB5pnL6FmJJ5j0gk6uGXBD4bqZUJX2drDNyPv6vCJxiKPqS9U6RYRP zaFzXXewHldYILTWP9a+hm44joY/Zg8= X-Google-Smtp-Source: AA0mqf7jYUibT9H5j797GwnDdhcc6XccUDKyn8gXTDZiyuGg16J+pWvYS+NXoHffWJvLEt3KqRWfug== X-Received: by 2002:a05:600c:5407:b0:3c6:e63e:89a6 with SMTP id he7-20020a05600c540700b003c6e63e89a6mr36279169wmb.2.1671559634447; Tue, 20 Dec 2022 10:07:14 -0800 (PST) Received: from localhost.localdomain (cust246-dsl91-135-6.idnet.net. [91.135.6.246]) by smtp.gmail.com with ESMTPSA id u9-20020a05600c00c900b003cf37c5ddc0sm16243754wmm.22.2022.12.20.10.07.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Dec 2022 10:07:14 -0800 (PST) From: Alex Kiernan To: openembedded-core@lists.openembedded.org Cc: Alex Kiernan Subject: [OE-Core][PATCH][PATCH 01/11] oeqa/runtime/rust: Add basic compile/run test Date: Tue, 20 Dec 2022 18:06:02 +0000 Message-Id: <20221220180612.24555-2-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221220180612.24555-1-alex.kiernan@gmail.com> References: <20221220180612.24555-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 ; Tue, 20 Dec 2022 18:07:24 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/174861 Signed-off-by: Alex Kiernan --- 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 Tue Dec 20 18:06: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: 17013 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 E4EC9C5479D for ; Tue, 20 Dec 2022 18:07:24 +0000 (UTC) Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) by mx.groups.io with SMTP id smtpd.web10.57097.1671559636978449023 for ; Tue, 20 Dec 2022 10:07:17 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=AbilzMuY; spf=pass (domain: gmail.com, ip: 209.85.128.51, mailfrom: alex.kiernan@gmail.com) Received: by mail-wm1-f51.google.com with SMTP id ay2-20020a05600c1e0200b003d22e3e796dso9503689wmb.0 for ; Tue, 20 Dec 2022 10:07: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=thRuJtmTssIyG7l2IJePOzLYheC6XwEfWOGtbQPzcbQ=; b=AbilzMuYSsY5jjn66PMXY1cxASYqVzN3WA3ZWKMhJsayZO4kb3F74TSVw2nMzS7yAg ysMyU1N6G8JKupebrY+nXnP8UTx2jhjbIw8JwbCkpg3yGmVxDKJh0ffDPh5Og+pNlMln sTxw7dWZ0xHdqj00gFkeGL3RDo9ntGe09fFZprW+uUZvz6LgNv84FIFDW/P1CuRGqJpZ CEpkXaCn37a43CK/hPTZUdg1iIgqI0QkGHiupSQrr/6f/FMeWM5fhCEt+kh9YNhW8khi 6aBzaNZceJuFoVmageHUffYJq9eNIP5QzxnH5A67oLC1PQPrSy/ieqfxWEIGP2mNe2C3 392A== 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=thRuJtmTssIyG7l2IJePOzLYheC6XwEfWOGtbQPzcbQ=; b=UVaC2P6ku0zwptORY/1xPVlbfDvd75AOUh9/wwELbPd5XY2+/s48UplAr4TqK4Kv9h vzGTT/nNhuYNIYBwKVrxBxf7Tpm2rmWF4OwoI/HOzdlHLIO7k6sw8oN8Q6Eet9UNwmVr Y8pd9Ynp+NlpdIF1VYMA4qfjiEFaTJnuEvAHlMADm1YlnGCETU76T6NNWvD/4DQzIQvH 73Y7M81NHtWOEONWrlyg0btWkIynqc6iNc9grPnOiZLnTD2pSaOytXY8CZUlJbFdnQzB bXYcqMRE0K/Xwaxz3HoMEbnrdUML/ECwCzot42mvdtPPvA1jfwk6oRb4r8xyNXd9zqGV HkPQ== X-Gm-Message-State: AFqh2krsd6mfE1nV+DMPX9x3rrkjDcOEvMH0RoGrWzVk1qZAjRK5y4C0 n6a1CRgoKIx9Fp8WBIIZ89I4HrqQ2uE= X-Google-Smtp-Source: AMrXdXt9cn5dkneZjrlrlXx4Y9yaWg9HelOUjij5VAR8DGb8UAhASmOSz1nBDEXebqFsMrEFJnK/Og== X-Received: by 2002:a05:600c:34cb:b0:3d5:79bb:d7da with SMTP id d11-20020a05600c34cb00b003d579bbd7damr2631861wmq.18.1671559635345; Tue, 20 Dec 2022 10:07:15 -0800 (PST) Received: from localhost.localdomain (cust246-dsl91-135-6.idnet.net. [91.135.6.246]) by smtp.gmail.com with ESMTPSA id u9-20020a05600c00c900b003cf37c5ddc0sm16243754wmm.22.2022.12.20.10.07.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Dec 2022 10:07:14 -0800 (PST) From: Alex Kiernan To: openembedded-core@lists.openembedded.org Cc: Alex Kiernan Subject: [OE-Core][PATCH][PATCH 02/11] libstd-rs: Merge .inc into .bb Date: Tue, 20 Dec 2022 18:06:03 +0000 Message-Id: <20221220180612.24555-3-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221220180612.24555-1-alex.kiernan@gmail.com> References: <20221220180612.24555-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 ; Tue, 20 Dec 2022 18:07:24 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/174862 Signed-off-by: Alex Kiernan --- 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 Tue Dec 20 18:06: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: 17011 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 DFD38C53210 for ; Tue, 20 Dec 2022 18:07:24 +0000 (UTC) Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) by mx.groups.io with SMTP id smtpd.web10.57098.1671559637866644549 for ; Tue, 20 Dec 2022 10:07:18 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=YuGPBLYz; spf=pass (domain: gmail.com, ip: 209.85.128.50, mailfrom: alex.kiernan@gmail.com) Received: by mail-wm1-f50.google.com with SMTP id b24-20020a05600c4a9800b003d21efdd61dso9458986wmp.3 for ; Tue, 20 Dec 2022 10:07:17 -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=ryQHzelt9hqYn6CEjiK0iQUD2tjFJw9kA1aNefr2W8A=; b=YuGPBLYzxnSmmhn9CGEhniwSsmcY9PA93L/IPVKgkvDWJ6bN9HYL8OHpEiT01MKWRT 42jlLfsBlLYGkB23Ne96foPT5x07iudgI9STsfhqoddLFi6fAjgBjSjqIj1IuEcnyGnC 7MHwNuZmRtu8pIoXfZwNMCC27U+iKy5kFmkbGMnYiJFpCZbH/FKfXJyEa3KjDltxYzRZ 9E3Tp0gY1bDNcvStwXGNqGffw+QfEXyDUgyNPu8+oxScbxB//wnwThaBvhnOzRSqwfM2 nnzMtz0YsxYUNzjPrzOtXQovh5DAlhJu2kFFLVWcEFUj4LDUlxgkpcLmDj+hb2RKgGjX q5Aw== 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=ryQHzelt9hqYn6CEjiK0iQUD2tjFJw9kA1aNefr2W8A=; b=o4jzMIQySZ+Y4uz2sAi8HPEXlEA5w3hrv/w/U6BF3uzNpDldDG1/cBEWbA4uOFMuER NzKbOAu1ippk7euEpkmY8CDqpyqOhiP2BdaWWisParx426hCBnWtzC57aNK1z7t/I4ks mMDEvvUkPwkpqJAO24IiOfDWng2QLaalaJ3lwEWzrEivFDfz1Mhz4rzd5U1ahFpnEh8l MwGUlTIbcsxBdY+Kbd0i6xURn7cf1qCC9uMY9iVdfaEV4NZNlecD+u4YxrndOA1ZWlV8 r7F8PLqa6tqGi68Bub+l9+1gl69Ux62FX+/fdqBKxUGs/bivFrRHLct7aZf2ZZnzchvw SGqg== X-Gm-Message-State: AFqh2kqyxluXlh+AhB+PJRCFSq8KoKxdF4rt8dD5fgmXYFj4wle0k2iI ojPCyxMvW84qrY3E6zJs+PMwcnLg8/E= X-Google-Smtp-Source: AMrXdXtzmtMduvPLsxp2F/Rn+07oMLWv4jPDfUmWisj6PTsZs5x+Brttb5V/UbX/hTXo7dVsFCU+lQ== X-Received: by 2002:a05:600c:19d2:b0:3d5:1175:92c3 with SMTP id u18-20020a05600c19d200b003d5117592c3mr2598271wmq.23.1671559636160; Tue, 20 Dec 2022 10:07:16 -0800 (PST) Received: from localhost.localdomain (cust246-dsl91-135-6.idnet.net. [91.135.6.246]) by smtp.gmail.com with ESMTPSA id u9-20020a05600c00c900b003cf37c5ddc0sm16243754wmm.22.2022.12.20.10.07.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Dec 2022 10:07:15 -0800 (PST) From: Alex Kiernan To: openembedded-core@lists.openembedded.org Cc: Alex Kiernan Subject: [OE-Core][PATCH][PATCH 03/11] libstd-rs: Move source directory to library/test Date: Tue, 20 Dec 2022 18:06:04 +0000 Message-Id: <20221220180612.24555-4-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221220180612.24555-1-alex.kiernan@gmail.com> References: <20221220180612.24555-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 ; Tue, 20 Dec 2022 18:07:24 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/174863 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 --- 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 Tue Dec 20 18:06: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: 17012 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 DA098C46467 for ; Tue, 20 Dec 2022 18:07:24 +0000 (UTC) Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) by mx.groups.io with SMTP id smtpd.web11.57312.1671559638624404252 for ; Tue, 20 Dec 2022 10:07:18 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=kVyIN+pw; spf=pass (domain: gmail.com, ip: 209.85.128.51, mailfrom: alex.kiernan@gmail.com) Received: by mail-wm1-f51.google.com with SMTP id c65-20020a1c3544000000b003cfffd00fc0so11779252wma.1 for ; Tue, 20 Dec 2022 10:07: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=FagPer16TqSGKfWM657hm6JiI+yBiVBCvqxCOmlxkMA=; b=kVyIN+pwoAHWJODr9Rf96si+4MKvsNfKYVMWuR/tZnsLwlPYlNEWOOXmHNfWRGYHy+ Oo/H5pCq5aJ78qOuDWV3QF4X5mMnN57hBAWSW2ePxKqose572LyvHeYHsHbGz5cQLccr 2HOnP8L9J+7qC1e7LDknCHwgyZnPj6RhvvxQ5w9IIEae2/6rHvt08fIfUGMQN1Ca9tZm pTtjuNWcK0KmO3vkJPNMYk3lJZEdcIu3WcG0cPFpHF4rgQuauntLnYKrGCD5OpHG/54y DS9eJfZvQCrV3rrw79CGYW9iWPSTmSpQ5QgVshmaaSC6YIfFa/MVUvjYoOFhmF8wLYF3 3AGw== 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=FagPer16TqSGKfWM657hm6JiI+yBiVBCvqxCOmlxkMA=; b=G6TSBBw2p+Sjw0S5yDwmEq+23Ev2VFVw7HNaYU7VSiQnvwtqQH049FQinHgfaTPyps vVVPwVb4EPKITbtDQGjLc5tL/DxBGIX+dliH2pAXooQdEhqV/AYGbENtCB/jI/HsrXSD ROwvOnZrxh3enfnXKrIxDG8P/a7GmFM8MrVCJKHrwtWJEy6ZPi6K8+3hTPKkeCEtSX4n V4GtkoO/nuY93qWCOVHDcl0/g8SiENaut/SP/5ApMlUQ1PTYfjAd3dmQx53nfQ/9cWJN JJ5WQ2TfvoVVqHMAg8P6kqg/xCU/9NqUvmXrbVODTZl7TFmI1s2dwWhL2SBY/MiAz7vF Cnkg== X-Gm-Message-State: AFqh2koql0FAyeyFYziE/LB85Inb4oUD5o2fKp+C+STtqkgRchvewDSx a1JgvXhz4RwFUxFrOMLJOtaHZrelUO4= X-Google-Smtp-Source: AMrXdXtoos1zEcrEwTG+s/dQJzfEq/j4IIkOYFXa78Rv8rmniG6PT67vrwx3st/b7FmPjdMHnWXgRQ== X-Received: by 2002:a1c:4b06:0:b0:3cf:5e42:de64 with SMTP id y6-20020a1c4b06000000b003cf5e42de64mr2314421wma.39.1671559637042; Tue, 20 Dec 2022 10:07:17 -0800 (PST) Received: from localhost.localdomain (cust246-dsl91-135-6.idnet.net. [91.135.6.246]) by smtp.gmail.com with ESMTPSA id u9-20020a05600c00c900b003cf37c5ddc0sm16243754wmm.22.2022.12.20.10.07.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Dec 2022 10:07:16 -0800 (PST) From: Alex Kiernan To: openembedded-core@lists.openembedded.org Cc: Alex Kiernan Subject: [OE-Core][PATCH][PATCH 04/11] rust-llvm: Merge .inc into .bb Date: Tue, 20 Dec 2022 18:06:05 +0000 Message-Id: <20221220180612.24555-5-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221220180612.24555-1-alex.kiernan@gmail.com> References: <20221220180612.24555-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 ; Tue, 20 Dec 2022 18:07:24 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/174864 Signed-off-by: Alex Kiernan --- 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 Tue Dec 20 18:06: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: 17010 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 D5ADEC4708E for ; Tue, 20 Dec 2022 18:07:24 +0000 (UTC) Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) by mx.groups.io with SMTP id smtpd.web10.57099.1671559639564572644 for ; Tue, 20 Dec 2022 10:07:19 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=GXcJaMYR; spf=pass (domain: gmail.com, ip: 209.85.128.53, mailfrom: alex.kiernan@gmail.com) Received: by mail-wm1-f53.google.com with SMTP id m5-20020a7bca45000000b003d2fbab35c6so9460322wml.4 for ; Tue, 20 Dec 2022 10:07:19 -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=ZoflZfWDH81eQMvYh/JbpZ0jkloqgFnLy17tqaBqt5Y=; b=GXcJaMYR3NJFonEd89GpC54SY12W7D1iAV60hazu4lIUjWujuEcHlH7go0U8ZZTU4t waIKSy49Ei003wkZY+ub/EV7tAefjnIlZlBA0p4BaVJNgLjwuhrPju+nkzT8vmUKWrjj NI6ETDVOwLQlxoVbABK04FsPWSumbMi4xF9kyWTIX6visFZBp7qi9ecr0YK6b/sZ5nCn 1U/sAIwpP2JIm7dZfOVNDZkp9bDzqKJZpxTmtChBPviVA8xzfyXSrcSsfoDvpZoxCYBQ /EK4DDtEnBpnoPNl7CCPZS+GFdV7X/ER6oSK2UkPTFQP1lk5F2vNy9BgeuBH70EEd8p1 ZzAg== 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=ZoflZfWDH81eQMvYh/JbpZ0jkloqgFnLy17tqaBqt5Y=; b=VJypOzMknKSu2wKvx9z8Tgnohwx8fWcftixX9G6QL/H1Ov2EQmueUsHku6W1AOAkm3 fr/j5hS2beo32918tW+58wN24k76OJYbfRdR9bYwD+XNntDzwiRrBguc8ah3/pHi+nOU L15byqkExDhf5prTpdDmnvFGVVmH2zh0cG1ZyyVRRUHMTh6QIylCKoe7R5uqcZATaw0p r7Yj9OGWjLyrERTs7DRRaP6wIJ/E1yjDddNWE+sXr737MSy/6LwUHyR4k/iFdBfq/LdO bTv5R6BcebIqhd6KEiaGXl0oMKusMj3cnsYSlejwTVd1rRPcc2Ba3n1is00XDnPKJgUl DlRw== X-Gm-Message-State: AFqh2krRLhwTJu7jn2SoA1iLCa1KnAOJO2zbmqkb+hC9LIec17k3gbQ0 0y87JhRD8n9zZJtmbFzVQHYj4ZAAciE= X-Google-Smtp-Source: AMrXdXuV6oGNYBPiEZdIARlaZXMAZFjYCsY0wyKGF9FBsyOU/zZeXIJ+/48pblTcui81zsPPM3lX9Q== X-Received: by 2002:a05:600c:35d5:b0:3d3:864a:1173 with SMTP id r21-20020a05600c35d500b003d3864a1173mr3498095wmq.18.1671559637866; Tue, 20 Dec 2022 10:07:17 -0800 (PST) Received: from localhost.localdomain (cust246-dsl91-135-6.idnet.net. [91.135.6.246]) by smtp.gmail.com with ESMTPSA id u9-20020a05600c00c900b003cf37c5ddc0sm16243754wmm.22.2022.12.20.10.07.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Dec 2022 10:07:17 -0800 (PST) From: Alex Kiernan To: openembedded-core@lists.openembedded.org Cc: Alex Kiernan Subject: [OE-Core][PATCH][PATCH 05/11] rust-llvm: Update LLVM_VERSION to match embedded version Date: Tue, 20 Dec 2022 18:06:06 +0000 Message-Id: <20221220180612.24555-6-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221220180612.24555-1-alex.kiernan@gmail.com> References: <20221220180612.24555-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 ; Tue, 20 Dec 2022 18:07:24 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/174865 Signed-off-by: Alex Kiernan --- 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 Tue Dec 20 18:06:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Kiernan X-Patchwork-Id: 17008 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 D3B99C3DA7D for ; Tue, 20 Dec 2022 18:07:24 +0000 (UTC) Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) by mx.groups.io with SMTP id smtpd.web11.57315.1671559640228553669 for ; Tue, 20 Dec 2022 10:07:20 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=GEBAJDdA; spf=pass (domain: gmail.com, ip: 209.85.128.49, mailfrom: alex.kiernan@gmail.com) Received: by mail-wm1-f49.google.com with SMTP id m5-20020a7bca45000000b003d2fbab35c6so9460342wml.4 for ; Tue, 20 Dec 2022 10:07:19 -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=7qrGf0by00v18zFZYloKhIUkn1mSXxDrmdLn4kDjb0I=; b=GEBAJDdAkSRHcz2+6MOLJ2x+C8es+xMWhmCiz0/fMSAKgF96wv2HmbUBj8MCgg51wP Pmyfu6ygS08sqgzDV2fMtzNAuFtYulCBGiXVhG+NN3f1yIjEsRH61npZvUz/CWo1RoLu SFNVkEMhgOWBC5Vcm89ptA42X5PZbaLy7Tr0jtzsp2QXiDs9yLYXFiH1sLKM70y/2mez 6jgvfad754XazRbT6KuhSpdm1KRrj1j9Gi3sM48McWNSQds5V1GXXmE1SBM3/QNqRUta XlcDary6sP2slxWjk/FchXc9e7MOa8jdf24/w8xIxVDEohF4GqJWpJqrLRomGa5UPbCu 3JOg== 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=7qrGf0by00v18zFZYloKhIUkn1mSXxDrmdLn4kDjb0I=; b=gvwZWbetxvOGRIQI1SH9y29g63OiZONfmj/0spGS5OYnqhojx4WjT/TQ6VHL8aLSHU tdAj2Cg9Ot3/DTt+cWcCyxnBBNEc/IwmuM+dG0j3sXwFiyKR+lqB/2aascwVs/ND9+jm PgmmDR7JVo2feAwKR23r2d1aBZY3KWPVLot4NGXif/cqjJlXS3HnCL+JyfAl5n7E03RQ ql99PoVgBzhlig/VCDq+AaHYjIqO7TYOCehWsI4n8fdqJPbJeYf26iLE1x5n7FXoEKi4 /Ea1GMsaN+8PFK2JBRLSMCEvQ27uui1/SS+noXvSHsU4Im5Mv2sgFZzUdca8JJOYjGGG R77w== X-Gm-Message-State: ANoB5pn2wNeOFxALns6JeRfvqNtNy8OwT7/tvFa7pPYcHWPyC44YUNIq 1C1CnWVJGKD3O0+lJSlcBzvaOxs7HqI= X-Google-Smtp-Source: AA0mqf7B2kuQobrgNqy33YmXoIHKAu1CcwpnK5BqE4CmRxqu4eZdVG5dF0CpvDngpzFLHtTz8alYRQ== X-Received: by 2002:a05:600c:3b8a:b0:3d1:f0f1:ceb4 with SMTP id n10-20020a05600c3b8a00b003d1f0f1ceb4mr35426094wms.19.1671559638620; Tue, 20 Dec 2022 10:07:18 -0800 (PST) Received: from localhost.localdomain (cust246-dsl91-135-6.idnet.net. [91.135.6.246]) by smtp.gmail.com with ESMTPSA id u9-20020a05600c00c900b003cf37c5ddc0sm16243754wmm.22.2022.12.20.10.07.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Dec 2022 10:07:18 -0800 (PST) From: Alex Kiernan To: openembedded-core@lists.openembedded.org Cc: Alex Kiernan Subject: [OE-Core][PATCH][PATCH 06/11] packagegroup-rust-sdk-target: Add Rust SDK target packagegroup Date: Tue, 20 Dec 2022 18:06:07 +0000 Message-Id: <20221220180612.24555-7-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221220180612.24555-1-alex.kiernan@gmail.com> References: <20221220180612.24555-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 ; Tue, 20 Dec 2022 18:07:24 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/174866 Signed-off-by: Alex Kiernan --- .../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 Tue Dec 20 18:06:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Kiernan X-Patchwork-Id: 17007 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 C8680C41535 for ; Tue, 20 Dec 2022 18:07:24 +0000 (UTC) Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) by mx.groups.io with SMTP id smtpd.web11.57318.1671559641120083356 for ; Tue, 20 Dec 2022 10:07:21 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ZBgJrTlR; spf=pass (domain: gmail.com, ip: 209.85.128.45, mailfrom: alex.kiernan@gmail.com) Received: by mail-wm1-f45.google.com with SMTP id p13-20020a05600c468d00b003cf8859ed1bso9476084wmo.1 for ; Tue, 20 Dec 2022 10:07: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=dLmadIfCOQneY28PsYFKv/FyI+0rwD+tX3CNbqBwmyU=; b=ZBgJrTlRWcF1Mmu27rBpQlSkjunx3odd9O5TAL2QDidpkLYpFxoZzeAKZRzTdQVPLP iAd3qv7ESURkoLXbB31fPjNlGAFHZ5S5eIeBkVtVwR98UZYNqaHG/+GQK/NaY3sgHUoM hey4bhjaPVtHqHKH/l3s87p8DobSsE9SR55/Rp6qDcbX3UOtnC9NEil7AiPFi6i1ovk9 u4fUFvXMMBogMKnpTe2fqF4bUJndKu7LsNW4Bg8qSzByZO1Fz5SMOFT7M4CV9to4hgdA SxSW4CcPNih/SfDH24DAmHLBS+lrEKTf9u2yu+2xf814MCC17yWBepr1AwNvFjmP6pgw hTcg== 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=dLmadIfCOQneY28PsYFKv/FyI+0rwD+tX3CNbqBwmyU=; b=X3Uerysag3z857jdfO7umEwuFPvUidObWzipHmVBfhkiBYfBKJ31VwaL2xff5foq53 DcIKAcw6TMj680GDAX/xGaxfA+PxQ8OwOQIHGtuUOA6ngXaQd4cD1R7MQe9+GDm4lyNT c+900aSi/Z08/UKPXfz4Z4dDcWK9iYQE4tu0XwAe4UKScaJU7i6LKvLJkWWRJSk1gYtt qsPxRoZ3LGdOLMTiAT4UWXTe6nJE/PJjzwm1BiKrvsq6xoyi6AWUBNp0fR9DrGZtaLIH BG1s26MQg5dPWak3TW4YbUOjUnrF9NO5X6dm2dLQALphxrT8zjFjqXCmWBHrMW+lZYL6 OLmA== X-Gm-Message-State: ANoB5pkMnPz2UzyPPnlcPQQAyS+D4fDDJZOmRBEvhJ4sHNqK+vKzvng5 IiMaLOWHDAes6c14aFOevTxeQanZtmc= X-Google-Smtp-Source: AA0mqf6JRKZdOdQXWv4MKoVv4N7L2PVntjkj4NyCI0XIN7E2tVyeJRIogA+TEYeOsAv3lvu8ikE7CQ== X-Received: by 2002:a05:600c:2d0b:b0:3d2:2d2a:d581 with SMTP id x11-20020a05600c2d0b00b003d22d2ad581mr21816203wmf.30.1671559639382; Tue, 20 Dec 2022 10:07:19 -0800 (PST) Received: from localhost.localdomain (cust246-dsl91-135-6.idnet.net. [91.135.6.246]) by smtp.gmail.com with ESMTPSA id u9-20020a05600c00c900b003cf37c5ddc0sm16243754wmm.22.2022.12.20.10.07.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Dec 2022 10:07:18 -0800 (PST) From: Alex Kiernan To: openembedded-core@lists.openembedded.org Cc: Alex Kiernan Subject: [OE-Core][PATCH][PATCH 07/11] packagegroup-core-sdk: Add SDK toolchain language selection support Date: Tue, 20 Dec 2022 18:06:08 +0000 Message-Id: <20221220180612.24555-8-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221220180612.24555-1-alex.kiernan@gmail.com> References: <20221220180612.24555-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 ; Tue, 20 Dec 2022 18:07:24 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/174868 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 --- .../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 = "" From patchwork Tue Dec 20 18:06:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Kiernan X-Patchwork-Id: 17005 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 C6119C3DA7C for ; Tue, 20 Dec 2022 18:07:24 +0000 (UTC) Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) by mx.groups.io with SMTP id smtpd.web10.57099.1671559639564572644 for ; Tue, 20 Dec 2022 10:07:21 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=GnYXf0ef; spf=pass (domain: gmail.com, ip: 209.85.128.53, mailfrom: alex.kiernan@gmail.com) Received: by mail-wm1-f53.google.com with SMTP id m5-20020a7bca45000000b003d2fbab35c6so9460407wml.4 for ; Tue, 20 Dec 2022 10:07: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=p2uDT9EtozHV2LCFszTE7ApqM52rI85QXrWs5TqtHw8=; b=GnYXf0efGMqYc/R9DxnK3j67oci2Tlhuyfa/rEFznHaRnoqFDi26yj2fRFnK2QSMNj yRqlMzIcTD5ZxZ16W/Bpa+/o7uwWkzIhgL2Hnar4BxsX1yevkA61viNVHFcyWZMYyAc8 2jVThmRjZk2pwcydroxvJEugBpQFfeWqkfv4QLIiX5Uqf49ecxagIw2Joxv9uu5BxUFQ ASFZtwR2HVO5gUh0A5i372t3WCBRaHT/AkGrR0WfiespT0Wu+v+/7hdQiWvCgjNbhuw+ I0Ok6oPtMmcAYkcO5zrvJel9bhf6dmUxP5oxx2kcBYmHmaaOJL0v1lNChuilF5hjGvv5 8StQ== 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=p2uDT9EtozHV2LCFszTE7ApqM52rI85QXrWs5TqtHw8=; b=g7d6jdCUoeY/uor2bmY3OioGtEbjRD9ZqlNpXKCHDxpHKx08XWk4Pe0XI3NW+lZgRy wHu9VibHw3sQPTsG+SKlQaJ0blq9Tlxs9voLkdR73T3w6DaKOu3u7xh4IfI/TPKBu10r Ec8zQV4a2Kt7FkR/YkC7iTYPDGBN9aEtCyA7FYxLLIaSdRbLScaQqklLiuIImCAlZtDz kryYz6rixo+pZx/mOlDLxOGx578ENs4T/ZSDyyzIZqs9DtCoehLSsU8n4DzQABwv6B6p oqRFjOkJsWnydljpZphxuLrmQOKv2agz9SS/sDYCjw9TDswbrx87KbVZrAGKUPrSnayy Hujw== X-Gm-Message-State: ANoB5pmV+2zunONAP3yF7hwmQuUdTudaLg/bUdEmQc+UWr19wUl8qRC7 HmviGqj8ArfbD4Gl6B07ZIQOMdBisvI= X-Google-Smtp-Source: AA0mqf7Gn+3gd04dCRq9ADCHTz/daC6OP16TvaJuTswKtaRNeL+q/0p3VanIvikIpEjmcN6ewXUDFQ== X-Received: by 2002:a05:600c:1e26:b0:3d2:2043:9cb7 with SMTP id ay38-20020a05600c1e2600b003d220439cb7mr28886556wmb.5.1671559640236; Tue, 20 Dec 2022 10:07:20 -0800 (PST) Received: from localhost.localdomain (cust246-dsl91-135-6.idnet.net. [91.135.6.246]) by smtp.gmail.com with ESMTPSA id u9-20020a05600c00c900b003cf37c5ddc0sm16243754wmm.22.2022.12.20.10.07.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Dec 2022 10:07:19 -0800 (PST) From: Alex Kiernan To: openembedded-core@lists.openembedded.org Cc: Alex Kiernan Subject: [OE-Core][PATCH][PATCH 08/11] oeqa/runtime/rust: Add cargo test Date: Tue, 20 Dec 2022 18:06:09 +0000 Message-Id: <20221220180612.24555-9-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221220180612.24555-1-alex.kiernan@gmail.com> References: <20221220180612.24555-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 ; Tue, 20 Dec 2022 18:07:24 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/174867 Signed-off-by: Alex Kiernan --- 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']) From patchwork Tue Dec 20 18:06:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Kiernan X-Patchwork-Id: 17004 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 C31DAC3DA7A for ; Tue, 20 Dec 2022 18:07:24 +0000 (UTC) Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) by mx.groups.io with SMTP id smtpd.web11.57319.1671559642910699743 for ; Tue, 20 Dec 2022 10:07:23 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=dtJ91pQh; spf=pass (domain: gmail.com, ip: 209.85.128.51, mailfrom: alex.kiernan@gmail.com) Received: by mail-wm1-f51.google.com with SMTP id o15so9345183wmr.4 for ; Tue, 20 Dec 2022 10:07: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=rANEk/igUBBQPK2ulUWi1cuO6QAlkAbEW+eCJMchwYg=; b=dtJ91pQhDv+mdFCIJqWFna+2o3PpEiZYkzQqqgbueBTaI3PCWYgAqZ8ln6gv9ggC6y ycypX3n6xQfYbWqhChbaDt0MnUo+1wK4RQpi2oGZm88kk2sTQMtAiH8j/g3PLBglpC6b B4oO2kw1SHwSMYq7aVeAHETGlifqIf95bHh/lA34yRjZGsH/zwxnge1Q2YnGiyR1vOYE QWYVy+DB06Tw9icIXzoceaIfyzc/d96c7wCXl4Dp8/74Z/fZluqtgdgNb5GFVyj++6S7 BpqV4mCBS6A+Ca7W7VKZvFsdVEmzKOMZ1Uv9WW5HvrUzK2LDOOErrUq3YceiJJUPeFsJ IpHA== 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=rANEk/igUBBQPK2ulUWi1cuO6QAlkAbEW+eCJMchwYg=; b=evubz08kqFVjSRYWztqqj9SkuCVVV28dl/asM94gzHSkp8lbWtGyOVejrSIQ6s+gu3 huDGB0prBZzIo9KULnBqxwRAqalopr/xbMkILZpM3hnDKHiT45ICPhMD5Z2oaViAD2in FAjDZSdJjnWKeld8BLSKqS+lCp5f+lYT3ygDh1Skm5sfv6D51KNIMD91mb+3ZLmuAoAi d48uTyh1emSkluFe4F67Zmklmc+RLW25BS5Cp3AGjr7fa1KH/Q4uwsPu+/GWxYsjTaV7 CBKDYMdgYNmf3XOiik10DfOvDu5D29Mu3YqKLq2/T9b+uSpy6eO8D/016XeWrY/GuD7U BZPw== X-Gm-Message-State: AFqh2koEj5Az4H36hNgMFh5iYyXti8tJnN7GqeMzu/qlcVk/BMainhCV pUa2u90P8S/U37a19hPiKLYoYdCdcg4= X-Google-Smtp-Source: AMrXdXv341K+Hqrk+DlZi5zbICWuP6UHyghQwedjqElTO8uNLVn+Um4OMvk9hj/5vyaNsKb9VgLRKQ== X-Received: by 2002:a05:600c:4fd4:b0:3d3:5c21:dd99 with SMTP id o20-20020a05600c4fd400b003d35c21dd99mr5256558wmq.18.1671559641033; Tue, 20 Dec 2022 10:07:21 -0800 (PST) Received: from localhost.localdomain (cust246-dsl91-135-6.idnet.net. [91.135.6.246]) by smtp.gmail.com with ESMTPSA id u9-20020a05600c00c900b003cf37c5ddc0sm16243754wmm.22.2022.12.20.10.07.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Dec 2022 10:07:20 -0800 (PST) From: Alex Kiernan To: openembedded-core@lists.openembedded.org Cc: Alex Kiernan Subject: [OE-Core][PATCH][PATCH 09/11] cargo: Merge .inc into .bb Date: Tue, 20 Dec 2022 18:06:10 +0000 Message-Id: <20221220180612.24555-10-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221220180612.24555-1-alex.kiernan@gmail.com> References: <20221220180612.24555-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 ; Tue, 20 Dec 2022 18:07:24 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/174869 Signed-off-by: Alex Kiernan --- 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 Tue Dec 20 18:06:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Kiernan X-Patchwork-Id: 17009 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 B4313C4167B for ; Tue, 20 Dec 2022 18:07:24 +0000 (UTC) Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) by mx.groups.io with SMTP id smtpd.web10.57098.1671559637866644549 for ; Tue, 20 Dec 2022 10:07:23 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=LdSclnbj; spf=pass (domain: gmail.com, ip: 209.85.128.50, mailfrom: alex.kiernan@gmail.com) Received: by mail-wm1-f50.google.com with SMTP id b24-20020a05600c4a9800b003d21efdd61dso9459200wmp.3 for ; Tue, 20 Dec 2022 10:07: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=1D7LI/k1XKyN+XD4ttwacoquADk4u/sMoHCo/SIuiHQ=; b=LdSclnbj63/V5uRwwu/tFJSZQ7O65Py2IYYrqXFjHwueJPNk86vkq+01eMjUeHsnKk rNesEdXZl2XRCp9BbJpAMULaij+JBNXQBR0Uw22AYx3Tf4gBKCWZZ3V9QdDmf5AASGQh hiSz89KDiQi2nsfChwaJQizITHJ1mdPMX5Br5ZHg/uXk0sXNI11RbvR/KzT1bpLRqlri I9e46g+GxCIB9OVbJ2mXB04f6KhOGdgqwyNg6a/oq+Tjn4hYe2mjJnmfgrsb8urx2SDc ifJK/FMRKr8gOWqUZr3FcPSa6kMg4u3wAu1OPxCr5/pR+BYVhh9VuVXvQtWZnM3/wdes u2nQ== 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=1D7LI/k1XKyN+XD4ttwacoquADk4u/sMoHCo/SIuiHQ=; b=D0zv6CmiMoQbaNBcRo7mpvAFA/tYng/wRFMGMbVojhB5GNOEpOG631L8eIgpzL1L4X cRgJ351JCnu6wEKjirvsJt4yTSBRCaM4izpVhO9+llp9+swn1QrKwdUIYczBwmXbTYa5 PDisBQz8r2a2QInFNaygPxYXS1IG+R84HYTaP8I/DsEYZ/jXGkBydtqChJLWsdR2gcSd fqP/NHI3bmd7P/NEDjy20+ZyY08l+Sm0K0j3UA9rDnokljmm/nL2aXY9fOiA2fVDlGPX M0nm+Q0hliT9PRq/Qa7aapedVBsXpmw+BfAl5obyB1IWPh8fIt2G8WxqcDqYn5UjEk3P X8vQ== X-Gm-Message-State: ANoB5pmsnOj4zw70qjlmKM4JieSj1qV9kHlh/UTslIeNPYH6I6JZxZij PHguQLhXw6LTm8Xu7VUhI7HelLKX4e4= X-Google-Smtp-Source: AA0mqf7YBqq4V65MSEP1tW7E9vPWuiswnYj2IyLOFRkdJv25kemXQDl4UWPhur52FS6ZqwmZKhvbVw== X-Received: by 2002:a05:600c:3647:b0:3d2:3e73:7175 with SMTP id y7-20020a05600c364700b003d23e737175mr19317827wmq.40.1671559642040; Tue, 20 Dec 2022 10:07:22 -0800 (PST) Received: from localhost.localdomain (cust246-dsl91-135-6.idnet.net. [91.135.6.246]) by smtp.gmail.com with ESMTPSA id u9-20020a05600c00c900b003cf37c5ddc0sm16243754wmm.22.2022.12.20.10.07.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Dec 2022 10:07:21 -0800 (PST) From: Alex Kiernan To: openembedded-core@lists.openembedded.org Cc: Alex Kiernan Subject: [OE-Core][PATCH][PATCH 10/11] rust: Merge .inc into .bb Date: Tue, 20 Dec 2022 18:06:11 +0000 Message-Id: <20221220180612.24555-11-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221220180612.24555-1-alex.kiernan@gmail.com> References: <20221220180612.24555-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 ; Tue, 20 Dec 2022 18:07:24 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/174870 Signed-off-by: Alex Kiernan --- meta/recipes-devtools/rust/rust-target.inc | 10 - meta/recipes-devtools/rust/rust.inc | 219 --------------------- meta/recipes-devtools/rust/rust_1.66.0.bb | 215 +++++++++++++++++++- 3 files changed, 214 insertions(+), 230 deletions(-) delete mode 100644 meta/recipes-devtools/rust/rust-target.inc delete mode 100644 meta/recipes-devtools/rust/rust.inc diff --git a/meta/recipes-devtools/rust/rust-target.inc b/meta/recipes-devtools/rust/rust-target.inc deleted file mode 100644 index dce2b47517b5..000000000000 --- a/meta/recipes-devtools/rust/rust-target.inc +++ /dev/null @@ -1,10 +0,0 @@ -require rust.inc - -DEPENDS += "rust-llvm (=${PV})" - -# Otherwise we'll depend on what we provide -INHIBIT_DEFAULT_RUST_DEPS:class-native = "1" -# We don't need to depend on gcc-native because yocto assumes it exists -PROVIDES:class-native = "virtual/${TARGET_PREFIX}rust" - -BBCLASSEXTEND = "native nativesdk" diff --git a/meta/recipes-devtools/rust/rust.inc b/meta/recipes-devtools/rust/rust.inc deleted file mode 100644 index 8d25e7993aef..000000000000 --- a/meta/recipes-devtools/rust/rust.inc +++ /dev/null @@ -1,219 +0,0 @@ -SUMMARY = "Rust compiler and runtime libaries" -HOMEPAGE = "http://www.rust-lang.org" -SECTION = "devel" -LICENSE = "(MIT | Apache-2.0) & Unicode-TOU" -LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=92289ed52a60b63ab715612ad2915603" - -inherit rust -inherit cargo_common - -DEPENDS += "file-native python3-native" -DEPENDS:append:class-native = " rust-llvm-native" -DEPENDS:append:class-nativesdk = " nativesdk-rust-llvm" - -S = "${RUSTSRC}" - -export FORCE_CRATE_HASH="${BB_TASKHASH}" - -RUST_ALTERNATE_EXE_PATH ?= "${STAGING_LIBDIR}/llvm-rust/bin/llvm-config" -RUST_ALTERNATE_EXE_PATH_NATIVE = "${STAGING_LIBDIR_NATIVE}/llvm-rust/bin/llvm-config" - -# We don't want to use bitbakes vendoring because the rust sources do their -# own vendoring. -CARGO_DISABLE_BITBAKE_VENDORING = "1" - -# We can't use RUST_BUILD_SYS here because that may be "musl" if -# TCLIBC="musl". Snapshots are always -unknown-linux-gnu -setup_cargo_environment () { - # The first step is to build bootstrap and some early stage tools, - # these are build for the same target as the snapshot, e.g. - # x86_64-unknown-linux-gnu. - # Later stages are build for the native target (i.e. target.x86_64-linux) - cargo_common_do_configure -} - -inherit rust-target-config - -do_rust_setup_snapshot () { - for installer in "${WORKDIR}/rust-snapshot-components/"*"/install.sh"; do - "${installer}" --prefix="${WORKDIR}/rust-snapshot" --disable-ldconfig - done - - # Some versions of rust (e.g. 1.18.0) tries to find cargo in stage0/bin/cargo - # and fail without it there. - mkdir -p ${RUSTSRC}/build/${BUILD_SYS} - ln -sf ${WORKDIR}/rust-snapshot/ ${RUSTSRC}/build/${BUILD_SYS}/stage0 - - # 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 - for bin in cargo rustc rustdoc; do - patchelf-uninative ${WORKDIR}/rust-snapshot/bin/$bin --set-interpreter ${UNINATIVE_LOADER} - done - fi -} -addtask rust_setup_snapshot after do_unpack before do_configure -do_rust_setup_snapshot[dirs] += "${WORKDIR}/rust-snapshot" -do_rust_setup_snapshot[vardepsexclude] += "UNINATIVE_LOADER" - -python do_configure() { - import json - try: - import configparser - except ImportError: - import ConfigParser as configparser - - # toml is rather similar to standard ini like format except it likes values - # that look more JSON like. So for our purposes simply escaping all values - # as JSON seem to work fine. - - e = lambda s: json.dumps(s) - - config = configparser.RawConfigParser() - - # [target.ARCH-poky-linux] - host_section = "target.{}".format(d.getVar('RUST_HOST_SYS', True)) - config.add_section(host_section) - - llvm_config_target = d.expand("${RUST_ALTERNATE_EXE_PATH}") - llvm_config_build = d.expand("${RUST_ALTERNATE_EXE_PATH_NATIVE}") - config.set(host_section, "llvm-config", e(llvm_config_target)) - - config.set(host_section, "cxx", e(d.expand("${RUST_TARGET_CXX}"))) - config.set(host_section, "cc", e(d.expand("${RUST_TARGET_CC}"))) - config.set(host_section, "linker", e(d.expand("${RUST_TARGET_CCLD}"))) - if "musl" in host_section: - config.set(host_section, "musl-root", e(d.expand("${STAGING_DIR_HOST}${exec_prefix}"))) - - # If we don't do this rust-native will compile it's own llvm for BUILD. - # [target.${BUILD_ARCH}-unknown-linux-gnu] - build_section = "target.{}".format(d.getVar('RUST_BUILD_SYS', True)) - if build_section != host_section: - config.add_section(build_section) - - config.set(build_section, "llvm-config", e(llvm_config_build)) - - config.set(build_section, "cxx", e(d.expand("${RUST_BUILD_CXX}"))) - config.set(build_section, "cc", e(d.expand("${RUST_BUILD_CC}"))) - config.set(build_section, "linker", e(d.expand("${RUST_BUILD_CCLD}"))) - - target_section = "target.{}".format(d.getVar('RUST_TARGET_SYS', True)) - if target_section != host_section and target_section != build_section: - config.add_section(target_section) - - config.set(target_section, "llvm-config", e(llvm_config_target)) - - config.set(target_section, "cxx", e(d.expand("${RUST_TARGET_CXX}"))) - config.set(target_section, "cc", e(d.expand("${RUST_TARGET_CC}"))) - config.set(target_section, "linker", e(d.expand("${RUST_TARGET_CCLD}"))) - - # [llvm] - config.add_section("llvm") - config.set("llvm", "static-libstdcpp", e(False)) - if "llvm" in (d.getVar('TC_CXX_RUNTIME') or ""): - config.set("llvm", "use-libcxx", e(True)) - - # [rust] - config.add_section("rust") - config.set("rust", "rpath", e(True)) - config.set("rust", "channel", e("stable")) - - # Whether or not to optimize the compiler and standard library - config.set("rust", "optimize", e(True)) - - # Emits extraneous output from tests to ensure that failures of the test - # harness are debuggable just from logfiles - config.set("rust", "verbose-tests", e(True)) - - # [build] - config.add_section("build") - config.set("build", "submodules", e(False)) - config.set("build", "docs", e(False)) - - rustc = d.expand("${WORKDIR}/rust-snapshot/bin/rustc") - config.set("build", "rustc", e(rustc)) - - # Support for the profiler runtime to generate e.g. coverage report, - # PGO etc. - config.set("build", "profiler", e(True)) - - cargo = d.expand("${WORKDIR}/rust-snapshot/bin/cargo") - config.set("build", "cargo", e(cargo)) - - config.set("build", "vendor", e(True)) - - if not "targets" in locals(): - targets = [d.getVar("RUST_TARGET_SYS", True)] - config.set("build", "target", e(targets)) - - if not "hosts" in locals(): - hosts = [d.getVar("RUST_HOST_SYS", True)] - config.set("build", "host", e(hosts)) - - # We can't use BUILD_SYS since that is something the rust snapshot knows - # nothing about when trying to build some stage0 tools (like fabricate) - config.set("build", "build", e(d.getVar("RUST_BUILD_SYS", True))) - - # [install] - config.add_section("install") - # ./x.py install doesn't have any notion of "destdir" - # but we can prepend ${D} to all the directories instead - config.set("install", "prefix", e(d.getVar("D", True) + d.getVar("prefix", True))) - config.set("install", "bindir", e(d.getVar("D", True) + d.getVar("bindir", True))) - config.set("install", "libdir", e(d.getVar("D", True) + d.getVar("libdir", True))) - config.set("install", "datadir", e(d.getVar("D", True) + d.getVar("datadir", True))) - config.set("install", "mandir", e(d.getVar("D", True) + d.getVar("mandir", True))) - - with open("config.toml", "w") as f: - f.write('changelog-seen = 2\n\n') - config.write(f) - - # set up ${WORKDIR}/cargo_home - bb.build.exec_func("setup_cargo_environment", d) -} - - -rust_runx () { - echo "COMPILE ${PN}" "$@" - - # CFLAGS, LDFLAGS, CXXFLAGS, CPPFLAGS are used by rust's build for a - # wide range of targets (not just TARGET). Yocto's settings for them will - # be inappropriate, avoid using. - unset CFLAGS - unset LDFLAGS - unset CXXFLAGS - unset CPPFLAGS - - export RUSTFLAGS="${RUST_DEBUG_REMAP}" - - # Copy the natively built llvm-config into the target so we can run it. Horrible, - # but works! - if [ ${RUST_ALTERNATE_EXE_PATH_NATIVE} != ${RUST_ALTERNATE_EXE_PATH} ]; then - mkdir -p `dirname ${RUST_ALTERNATE_EXE_PATH}` - cp ${RUST_ALTERNATE_EXE_PATH_NATIVE} ${RUST_ALTERNATE_EXE_PATH} - chrpath -d ${RUST_ALTERNATE_EXE_PATH} - fi - - oe_cargo_fix_env - - python3 src/bootstrap/bootstrap.py ${@oe.utils.parallel_make_argument(d, '-j %d')} "$@" --verbose -} -rust_runx[vardepsexclude] += "PARALLEL_MAKE" - -do_compile () { - rust_runx build -} - -rust_do_install () { - mkdir -p ${D}${bindir} - cp build/${RUST_HOST_SYS}/stage2/bin/* ${D}${bindir} - - mkdir -p ${D}${libdir}/rustlib - cp -pRd build/${RUST_HOST_SYS}/stage2/lib/* ${D}${libdir} - # Remove absolute symlink so bitbake doesn't complain - rm -f ${D}${libdir}/rustlib/src/rust -} - -do_install () { - rust_do_install -} diff --git a/meta/recipes-devtools/rust/rust_1.66.0.bb b/meta/recipes-devtools/rust/rust_1.66.0.bb index b39f772c5fe1..ed21a9ade24b 100644 --- a/meta/recipes-devtools/rust/rust_1.66.0.bb +++ b/meta/recipes-devtools/rust/rust_1.66.0.bb @@ -1,4 +1,212 @@ -require rust-target.inc +SUMMARY = "Rust compiler and runtime libaries" +HOMEPAGE = "http://www.rust-lang.org" +SECTION = "devel" +LICENSE = "(MIT | Apache-2.0) & Unicode-TOU" +LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=92289ed52a60b63ab715612ad2915603" + +inherit rust +inherit cargo_common + +DEPENDS += "file-native python3-native" +DEPENDS:append:class-native = " rust-llvm-native" +DEPENDS:append:class-nativesdk = " nativesdk-rust-llvm" + +S = "${RUSTSRC}" + +export FORCE_CRATE_HASH="${BB_TASKHASH}" + +RUST_ALTERNATE_EXE_PATH ?= "${STAGING_LIBDIR}/llvm-rust/bin/llvm-config" +RUST_ALTERNATE_EXE_PATH_NATIVE = "${STAGING_LIBDIR_NATIVE}/llvm-rust/bin/llvm-config" + +# We don't want to use bitbakes vendoring because the rust sources do their +# own vendoring. +CARGO_DISABLE_BITBAKE_VENDORING = "1" + +# We can't use RUST_BUILD_SYS here because that may be "musl" if +# TCLIBC="musl". Snapshots are always -unknown-linux-gnu +setup_cargo_environment () { + # The first step is to build bootstrap and some early stage tools, + # these are build for the same target as the snapshot, e.g. + # x86_64-unknown-linux-gnu. + # Later stages are build for the native target (i.e. target.x86_64-linux) + cargo_common_do_configure +} + +inherit rust-target-config + +do_rust_setup_snapshot () { + for installer in "${WORKDIR}/rust-snapshot-components/"*"/install.sh"; do + "${installer}" --prefix="${WORKDIR}/rust-snapshot" --disable-ldconfig + done + + # Some versions of rust (e.g. 1.18.0) tries to find cargo in stage0/bin/cargo + # and fail without it there. + mkdir -p ${RUSTSRC}/build/${BUILD_SYS} + ln -sf ${WORKDIR}/rust-snapshot/ ${RUSTSRC}/build/${BUILD_SYS}/stage0 + + # 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 + for bin in cargo rustc rustdoc; do + patchelf-uninative ${WORKDIR}/rust-snapshot/bin/$bin --set-interpreter ${UNINATIVE_LOADER} + done + fi +} +addtask rust_setup_snapshot after do_unpack before do_configure +do_rust_setup_snapshot[dirs] += "${WORKDIR}/rust-snapshot" +do_rust_setup_snapshot[vardepsexclude] += "UNINATIVE_LOADER" + +python do_configure() { + import json + try: + import configparser + except ImportError: + import ConfigParser as configparser + + # toml is rather similar to standard ini like format except it likes values + # that look more JSON like. So for our purposes simply escaping all values + # as JSON seem to work fine. + + e = lambda s: json.dumps(s) + + config = configparser.RawConfigParser() + + # [target.ARCH-poky-linux] + host_section = "target.{}".format(d.getVar('RUST_HOST_SYS', True)) + config.add_section(host_section) + + llvm_config_target = d.expand("${RUST_ALTERNATE_EXE_PATH}") + llvm_config_build = d.expand("${RUST_ALTERNATE_EXE_PATH_NATIVE}") + config.set(host_section, "llvm-config", e(llvm_config_target)) + + config.set(host_section, "cxx", e(d.expand("${RUST_TARGET_CXX}"))) + config.set(host_section, "cc", e(d.expand("${RUST_TARGET_CC}"))) + config.set(host_section, "linker", e(d.expand("${RUST_TARGET_CCLD}"))) + if "musl" in host_section: + config.set(host_section, "musl-root", e(d.expand("${STAGING_DIR_HOST}${exec_prefix}"))) + + # If we don't do this rust-native will compile it's own llvm for BUILD. + # [target.${BUILD_ARCH}-unknown-linux-gnu] + build_section = "target.{}".format(d.getVar('RUST_BUILD_SYS', True)) + if build_section != host_section: + config.add_section(build_section) + + config.set(build_section, "llvm-config", e(llvm_config_build)) + + config.set(build_section, "cxx", e(d.expand("${RUST_BUILD_CXX}"))) + config.set(build_section, "cc", e(d.expand("${RUST_BUILD_CC}"))) + config.set(build_section, "linker", e(d.expand("${RUST_BUILD_CCLD}"))) + + target_section = "target.{}".format(d.getVar('RUST_TARGET_SYS', True)) + if target_section != host_section and target_section != build_section: + config.add_section(target_section) + + config.set(target_section, "llvm-config", e(llvm_config_target)) + + config.set(target_section, "cxx", e(d.expand("${RUST_TARGET_CXX}"))) + config.set(target_section, "cc", e(d.expand("${RUST_TARGET_CC}"))) + config.set(target_section, "linker", e(d.expand("${RUST_TARGET_CCLD}"))) + + # [llvm] + config.add_section("llvm") + config.set("llvm", "static-libstdcpp", e(False)) + if "llvm" in (d.getVar('TC_CXX_RUNTIME') or ""): + config.set("llvm", "use-libcxx", e(True)) + + # [rust] + config.add_section("rust") + config.set("rust", "rpath", e(True)) + config.set("rust", "channel", e("stable")) + + # Whether or not to optimize the compiler and standard library + config.set("rust", "optimize", e(True)) + + # Emits extraneous output from tests to ensure that failures of the test + # harness are debuggable just from logfiles + config.set("rust", "verbose-tests", e(True)) + + # [build] + config.add_section("build") + config.set("build", "submodules", e(False)) + config.set("build", "docs", e(False)) + + rustc = d.expand("${WORKDIR}/rust-snapshot/bin/rustc") + config.set("build", "rustc", e(rustc)) + + # Support for the profiler runtime to generate e.g. coverage report, + # PGO etc. + config.set("build", "profiler", e(True)) + + cargo = d.expand("${WORKDIR}/rust-snapshot/bin/cargo") + config.set("build", "cargo", e(cargo)) + + config.set("build", "vendor", e(True)) + + if not "targets" in locals(): + targets = [d.getVar("RUST_TARGET_SYS", True)] + config.set("build", "target", e(targets)) + + if not "hosts" in locals(): + hosts = [d.getVar("RUST_HOST_SYS", True)] + config.set("build", "host", e(hosts)) + + # We can't use BUILD_SYS since that is something the rust snapshot knows + # nothing about when trying to build some stage0 tools (like fabricate) + config.set("build", "build", e(d.getVar("RUST_BUILD_SYS", True))) + + # [install] + config.add_section("install") + # ./x.py install doesn't have any notion of "destdir" + # but we can prepend ${D} to all the directories instead + config.set("install", "prefix", e(d.getVar("D", True) + d.getVar("prefix", True))) + config.set("install", "bindir", e(d.getVar("D", True) + d.getVar("bindir", True))) + config.set("install", "libdir", e(d.getVar("D", True) + d.getVar("libdir", True))) + config.set("install", "datadir", e(d.getVar("D", True) + d.getVar("datadir", True))) + config.set("install", "mandir", e(d.getVar("D", True) + d.getVar("mandir", True))) + + with open("config.toml", "w") as f: + f.write('changelog-seen = 2\n\n') + config.write(f) + + # set up ${WORKDIR}/cargo_home + bb.build.exec_func("setup_cargo_environment", d) +} + + +rust_runx () { + echo "COMPILE ${PN}" "$@" + + # CFLAGS, LDFLAGS, CXXFLAGS, CPPFLAGS are used by rust's build for a + # wide range of targets (not just TARGET). Yocto's settings for them will + # be inappropriate, avoid using. + unset CFLAGS + unset LDFLAGS + unset CXXFLAGS + unset CPPFLAGS + + export RUSTFLAGS="${RUST_DEBUG_REMAP}" + + # Copy the natively built llvm-config into the target so we can run it. Horrible, + # but works! + if [ ${RUST_ALTERNATE_EXE_PATH_NATIVE} != ${RUST_ALTERNATE_EXE_PATH} ]; then + mkdir -p `dirname ${RUST_ALTERNATE_EXE_PATH}` + cp ${RUST_ALTERNATE_EXE_PATH_NATIVE} ${RUST_ALTERNATE_EXE_PATH} + chrpath -d ${RUST_ALTERNATE_EXE_PATH} + fi + + oe_cargo_fix_env + + python3 src/bootstrap/bootstrap.py ${@oe.utils.parallel_make_argument(d, '-j %d')} "$@" --verbose +} +rust_runx[vardepsexclude] += "PARALLEL_MAKE" + +DEPENDS += "rust-llvm (=${PV})" + +# Otherwise we'll depend on what we provide +INHIBIT_DEFAULT_RUST_DEPS:class-native = "1" +# We don't need to depend on gcc-native because yocto assumes it exists +PROVIDES:class-native = "virtual/${TARGET_PREFIX}rust" + require rust-source.inc require rust-snapshot.inc @@ -77,6 +285,10 @@ rust_do_install:class-target() { rm ${D}${libdir}/rustlib/manifest* } +do_install () { + rust_do_install +} + # see recipes-devtools/gcc/gcc/0018-Add-ssp_nonshared-to-link-commandline-for-musl-targe.patch # we need to link with ssp_nonshared on musl to avoid "undefined reference to `__stack_chk_fail_local'" # when building MACHINE=qemux86 for musl @@ -87,3 +299,4 @@ RUSTLIB_DEP:class-nativesdk = "" # musl builds include libunwind.a INSANE_SKIP:${PN} = "staticdev" +BBCLASSEXTEND = "native nativesdk" From patchwork Tue Dec 20 18:06:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Kiernan X-Patchwork-Id: 17003 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 B28E2C4332F for ; Tue, 20 Dec 2022 18:07:24 +0000 (UTC) Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) by mx.groups.io with SMTP id smtpd.web10.57097.1671559636978449023 for ; Tue, 20 Dec 2022 10:07:23 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=IFa0/eN1; spf=pass (domain: gmail.com, ip: 209.85.128.51, mailfrom: alex.kiernan@gmail.com) Received: by mail-wm1-f51.google.com with SMTP id ay2-20020a05600c1e0200b003d22e3e796dso9504003wmb.0 for ; Tue, 20 Dec 2022 10:07:23 -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=ksYV95BQ8bPYBRNNBkhV9hxh0A8uxvnuBL03QfK9UC8=; b=IFa0/eN1cWOys6sK692gsnD1gqGKQk39MVaaH6IEN5zbGTCV02QKvCAOkwgtn2h69l oMkrQnVs/hypDpmSCu/f7Sfvu9KmE4j8/Ar2Nky9gTM7Y9Jw2Dsk1EylIAEnBIwXZY/W hUBINYtHFD0lc4Gcr79CesvnYwbycj8y8N+WnIzTW1j9voIxZP7EzOKZIbZUlEeH52RV xfY15FPdEr/NpK4jHhXoIz7LodfKHTmvo21ccoH0QTzn0fKRQie/2Q3/c0chnfEqxFhj 1lId7b+jzhfFt1UkTK48d1JtZGzqwYbl6PeFCdcA9IJS4McCtpqB/6ln5V4s6oFKFVPC 5jKw== 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=ksYV95BQ8bPYBRNNBkhV9hxh0A8uxvnuBL03QfK9UC8=; b=WRROAmqLt0XIZhYjiWFaobijtLJ4SM1cBQL1OWd0Fnayackc1QPLE5m4oV6VZt7Nhp solk7mt55ZYWqGRYTYIDtTvOgdKux79VboDSevBZeSSh5GNAY9WyAxRPHSt5aNG4Zx6b z0z6090VBjPyxNW7EyJPFtt6AiQE0kNDM/IfU0+DOmqktRMYBcEPqMbvSSE7VRGT7tW4 YI3A+9TqreJ7jgGMYEDFe6QlAKKO2YnhRdxMi7wB5mAXFfYyYhJvTPLcd/K8EsuJ14RV 6/M50X8sP/dzQfK16h2LIjEc6XYn/no7Ra/v9KTAiCImcFZb3l1AdoHdQLyNFQheU7PH 0UUg== X-Gm-Message-State: AFqh2kpk72bxzBkvM2OJSy6BvhAgV14u62b0CdP4zaESoRCdrnuZQfb3 hNmKxeF2kC7h+dSgA3LIkdGJlhwwtu0= X-Google-Smtp-Source: AMrXdXsxiJYznmZ5+KriiCKXab6ha8RkwidLwgZC2piap7d0tbNH3sQ2tcS5rVFkyyFcyOl9bmayNQ== X-Received: by 2002:a05:600c:1f15:b0:3cf:98e5:f72 with SMTP id bd21-20020a05600c1f1500b003cf98e50f72mr2411568wmb.3.1671559642974; Tue, 20 Dec 2022 10:07:22 -0800 (PST) Received: from localhost.localdomain (cust246-dsl91-135-6.idnet.net. [91.135.6.246]) by smtp.gmail.com with ESMTPSA id u9-20020a05600c00c900b003cf37c5ddc0sm16243754wmm.22.2022.12.20.10.07.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Dec 2022 10:07:22 -0800 (PST) From: Alex Kiernan To: openembedded-core@lists.openembedded.org Cc: Alex Kiernan Subject: [OE-Core][PATCH][PATCH 11/11] cargo: Extend DEBUG_PREFIX_MAP to cover vendor Date: Tue, 20 Dec 2022 18:06:12 +0000 Message-Id: <20221220180612.24555-12-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221220180612.24555-1-alex.kiernan@gmail.com> References: <20221220180612.24555-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 ; Tue, 20 Dec 2022 18:07:24 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/174871 The cargo build builds vendored libgit and curl, but these exist outside ${S} which DEBUG_PREFIX_MAP covers. Signed-off-by: Alex Kiernan --- 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