From patchwork Wed Dec 21 12:52:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Kiernan X-Patchwork-Id: 17064 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 82B1CC3DA7C for ; Wed, 21 Dec 2022 12:53:23 +0000 (UTC) Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) by mx.groups.io with SMTP id smtpd.web10.17930.1671627196303025828 for ; Wed, 21 Dec 2022 04:53:16 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=MfArz5sJ; spf=pass (domain: gmail.com, ip: 209.85.128.46, mailfrom: alex.kiernan@gmail.com) Received: by mail-wm1-f46.google.com with SMTP id i187-20020a1c3bc4000000b003d1e906ca23so1437650wma.3 for ; Wed, 21 Dec 2022 04:53: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=Gs7qJ10r1MW7uLXSk86BxIm8lJ3fMF94ITbsaI5Wy6Y=; b=MfArz5sJQE+gmhly6pUsGWXfYC2z3umuPRG70CbTV0YwQGkKE5CEumuQ0JQNrmUNPt RXKm6+0yYkwsU+SBTXrGH97wir6c1RVavgJZAGChFd3dXh40exPTA0GMsJgDNlxtA6Ai xvLuDEFXg4x4PwoqfR2TWD5tv1rC85Zu5Qw1gp2qMTlIL+OjVS8v+nMwbIUcxu2KCpTD J33/ly9cmqgjV3thvrA6qKrumZat+oXtd75Df2qspvDWGW9eC7AkNGAC6/FLXSTboc+A kgKB1oRd/YLIohxtuEwuDNLgFJtNHSpXaS7ApW2gTZpMHse6LGTlCG80I2bAWcJRbioa G+AA== 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=Gs7qJ10r1MW7uLXSk86BxIm8lJ3fMF94ITbsaI5Wy6Y=; b=UBu7dC2/f9cTqbsYWx9sxqWf7Hf+vjZXVEw0lyg7uXNRaLmomKLW1Gd3T/DFMccPJW sbclOtBfO0G4rLIKn9csVo/TqvCcVADW57EnOL/oHuJwP8nYbExFIMxOTw7J8AqHcw7F pSF8zg3HY1XSvHjYQ16lgnx5hRz6CK7hC+DWrqoMOA3pZcUxu1Nye/flv4/DNQFGqY8N jRtgRBHanpDnu/SSFHmUARhN/VyQwx1Yc4zOSgVOugLaLyrWReCT3T1JWGSZoarpQNG1 FrfSCjTl2QSSw/bztOQ9iHYciTXTXvN/c4mUElTsRmb6g3XzGdyTGa36EAtq6QNKbRIm UcGQ== X-Gm-Message-State: AFqh2krq0iSBnwuFgmedR6BhBhWbudU8w8zqZfdryGnrQvLzpyaG/2u5 6ao1tcrkOUTTESl9VhELmMz3cHBOLhQ= X-Google-Smtp-Source: AMrXdXvE48pLsKqMJCW3PdEDYYwwxIJ1gkyDB25XyotN+c0kLyb2fkSD/v2gyMch+DYiAI+3Gp1RGw== X-Received: by 2002:a1c:6a14:0:b0:3d1:f302:1975 with SMTP id f20-20020a1c6a14000000b003d1f3021975mr1569541wmc.33.1671627194360; Wed, 21 Dec 2022 04:53:14 -0800 (PST) Received: from localhost.localdomain (cust246-dsl91-135-6.idnet.net. [91.135.6.246]) by smtp.gmail.com with ESMTPSA id m6-20020a7bcb86000000b003b47ff307e1sm2124097wmi.31.2022.12.21.04.53.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Dec 2022 04:53:13 -0800 (PST) From: Alex Kiernan To: openembedded-core@lists.openembedded.org Cc: Alex Kiernan Subject: [OE-Core][PATCH v2 01/10] oeqa/runtime/rust: Add basic compile/run test Date: Wed, 21 Dec 2022 12:52:56 +0000 Message-Id: <20221221125306.13779-2-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221221125306.13779-1-alex.kiernan@gmail.com> References: <20221221125306.13779-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 12:53:23 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/174907 Signed-off-by: Alex Kiernan --- 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 12:52: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: 17063 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 5B2D8C3DA7B for ; Wed, 21 Dec 2022 12:53:23 +0000 (UTC) Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) by mx.groups.io with SMTP id smtpd.web10.17931.1671627197569508716 for ; Wed, 21 Dec 2022 04:53:17 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=MIXrukrF; spf=pass (domain: gmail.com, ip: 209.85.128.52, mailfrom: alex.kiernan@gmail.com) Received: by mail-wm1-f52.google.com with SMTP id ay40so11098728wmb.2 for ; Wed, 21 Dec 2022 04:53: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=tHqatNsqcFxI50LPeZTo5jfd2/mA6woHq+ctiPQac0I=; b=MIXrukrFACmToGu0Lz46rC+kRAWQmN82O+ClFKNkApYU5HhwktulGGqibc7U29zj1i iuhHlzbgGVugKWIXml1Sk3yCw93MsYwGVIrApV1I1ZfD8/UA9kxCYCMtreCdMKZvcwEp FEw8snybwo7PEfWmgvqIozw78s3WgeSFgHA2s4R/qIZGy7t0QhSQihDUTxRTSR56SN0j GbioToEJyJrgn+CBywyRk9FFbetA29JOXRB34n8Hk9xk7DvMPGlc62N+cjuU5JsT2B+w unV+z35fc4aDXTVWZJu7OLidiecvv4uQzSlw2GDegHlxNmKpeN3m5k07b2lRl3h2QomE Q4Sg== 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=nbgZgy8/h3Km4ibT+yQqfHNnDFrSEU6Tj5ksularK3O9zBJ0x0573oCbG/m2Yo9VkF CM4H6mP/7vaxsf2D8pJcJcbsRYilSzY+vTQy0SFGytYtystQITE3afyGTq1MBFYWApce eTuaVXlPAVGj2c6QlRkPiSjSoSMDL4j6r+2mLF8AARvMMyexOFby3QYGtz8SxwW5mbAZ qUHSTE4NU9CP4mrOfp/nGGvbyNL5FvFfNMqBbvTkPCcWZp3tor/ZTJ0PjrA1p1jJxg/X jBR7ynvTaRNkz3OjQz0xx43AJ48SLErmUpFpvkT3hWvIOduzKkIhaUWVTqr4fZM7L5BW t1yw== X-Gm-Message-State: AFqh2krAaGigO8UmXdsfW+oaQ0joBXTLvieJZinh6UrqdCg1wICZogDX LCG78qqBsU3y/zeynhe7YF8r7grOH6w= X-Google-Smtp-Source: AMrXdXsVXvTQJp293VX/eMjRZ4OsQZYuVdcxYr0XNeYF+w92kmokb8ul2CzvRaXJ2kSJRvtdCx+KBw== X-Received: by 2002:a05:600c:2e54:b0:3cf:ceac:94d3 with SMTP id q20-20020a05600c2e5400b003cfceac94d3mr1649453wmf.13.1671627195931; Wed, 21 Dec 2022 04:53:15 -0800 (PST) Received: from localhost.localdomain (cust246-dsl91-135-6.idnet.net. [91.135.6.246]) by smtp.gmail.com with ESMTPSA id m6-20020a7bcb86000000b003b47ff307e1sm2124097wmi.31.2022.12.21.04.53.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Dec 2022 04:53:15 -0800 (PST) From: Alex Kiernan To: openembedded-core@lists.openembedded.org Cc: Alex Kiernan Subject: [OE-Core][PATCH v2 02/10] libstd-rs: Merge .inc into .bb Date: Wed, 21 Dec 2022 12:52:57 +0000 Message-Id: <20221221125306.13779-3-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221221125306.13779-1-alex.kiernan@gmail.com> References: <20221221125306.13779-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 12:53:23 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/174908 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 12:52: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: 17062 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 5A5D1C4167B for ; Wed, 21 Dec 2022 12:53:23 +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.web10.17933.1671627199281179632 for ; Wed, 21 Dec 2022 04:53:19 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=dpxU7zhy; 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 bg10so11107628wmb.1 for ; Wed, 21 Dec 2022 04:53: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=C/bcoh8mrr5x0qx9JKuQrmbDQU5745WgEa5whVlg5mw=; b=dpxU7zhy+KIcpzfqCXT5abdj1yywrVZAi9kOtyedqttmyhFUQp0sSp4DaG/X7WNMrw ZMG17sMpJpLuecZqaRFQnhQyI99WUdDvHfjeahRb/1RrjisjeIj6z36s97+OXdHJJpKC YYH1KxCrCBUuWsmsjJg/ahToHw/nxyFCBcZSAXo837UW35VYXKKNuh71tBkuZQouIs+w DgwlH0e3Om4y0mbUWkEOcpz5GxymHv8JHSuKYUKgl7TmQNm/sN0Awp/2jeVaIk+mPjtF kl0OwwnRVP/HKZFSYMa17kTlfnVdsdcpcFEw+1PnlCUEQ23h4kXiJWBNYhDHGKeUU7oZ 0zhg== 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=s5NzcZMkoqpbCIj+s+3LVcUQl8Dr75THqham7PpX48lofeP8ubhX5oV/wQ9K6qMmZk 2IhxEPnMZZ7zh/rBW+5J2j7e8B2hn9ByDRDWZBg7QrXjLfJSSfbzXZ8vFy2u3gbUZACv T1WEKE5F8ZGYipLUjY7P3nr5/2OnoXLIg3fcBUoTbj5D1EeZlZeAqk3ByQ0uHiq5Xknj /CL0YtAhuPMOLlUJdz7EnmMOS/iPwShxbNF6KF4dvcMLvKx5h3EZiHm1cN/eJnIfI4MW 2Zbv03kVTkuIvl93UWDtMblgzqLw4JB2+uo0W7lEQpp+SaWHSqcpLYWK8FUlL9NmD+7C +08A== X-Gm-Message-State: AFqh2kqlfRjnTsbNUcI2dLUw2efPjV6jpgJp/dySxzZDmrioDdwAOy+4 h5XnfxUNiOjCwpvGjEgDbzSv0yQ7GXo= X-Google-Smtp-Source: AMrXdXsnjwT0QVEKyLuage/k0kw14QVNpsgsoDNcG+3sNRIVswQ+yHGwbsvnXiIuD1iIpcwVrljELA== X-Received: by 2002:a05:600c:4d22:b0:3cf:a5df:8bb0 with SMTP id u34-20020a05600c4d2200b003cfa5df8bb0mr1528192wmp.37.1671627197413; Wed, 21 Dec 2022 04:53:17 -0800 (PST) Received: from localhost.localdomain (cust246-dsl91-135-6.idnet.net. [91.135.6.246]) by smtp.gmail.com with ESMTPSA id m6-20020a7bcb86000000b003b47ff307e1sm2124097wmi.31.2022.12.21.04.53.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Dec 2022 04:53:16 -0800 (PST) From: Alex Kiernan To: openembedded-core@lists.openembedded.org Cc: Alex Kiernan Subject: [OE-Core][PATCH v2 03/10] libstd-rs: Move source directory to library/test Date: Wed, 21 Dec 2022 12:52:58 +0000 Message-Id: <20221221125306.13779-4-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221221125306.13779-1-alex.kiernan@gmail.com> References: <20221221125306.13779-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 12:53:23 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/174909 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 12:52: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: 17065 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 50F20C41535 for ; Wed, 21 Dec 2022 12:53:23 +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.web11.17634.1671627200304839881 for ; Wed, 21 Dec 2022 04:53:20 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=dejCNt+t; 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 ja17so11073953wmb.3 for ; Wed, 21 Dec 2022 04:53: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=dejCNt+tJuLeljgBJHJQX+U17lFzbQe8/YgAMcLn+dLLRxffbEo+oJx+B8rIsdBoda H8mwtpYIbCyDXgNC2Z+XAq7fwr/DWPKTCoJ3NoCZciu/heSbXK9iBq8wKcxo1hujJMjZ 7dt1ok4FFRi80Br7IVS5yLQiltHQmn96Xyf2HhkOH0rY/Z40AYSMW573axrLQar/Dl0S eTZrVmgrARI7fBLTOWVabRzPeb92aoJHV8i7RNJaxa9FWrzTBLGFA8SYTTrONZHEJ1J6 cw+NGXLR/8W2xTDy6lQNcPAwymc/z+HtgLllEe2GkGIpdqQzG5GILNdjwE9bvpqY3/bF oZJw== 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=cSQW9JBM7fB8TvKlE2ZqJS87J3Yowm+NjPm2XuMRHMp0BRfLHeESkvGm/mzpnlfF+1 b3xVreIE80YDvFQFMGTzlKSrrNIYCi9PIny7Kv+oz2t8L3UdOZtWDJPIFc+jpbQ18Jny SPP7bH328pYL2OzCQfYOGaLOXfCO9aByHvMIkWbgcz6UIogQOSBGiwTAuINFnf+d6XnP PcKoTpbqMUJ+un1lr3o58RrBlM6EeH39fikfyFRHBfV3NZ4EKm3nWlq4yqX1DG51WkoP R/5HSOegPx2yZJ8K0jVzIIHkmDQ1tMI71qZmRtjfCu7RRMA9+GLKoAePo4UisL0lP/q8 KS4w== X-Gm-Message-State: AFqh2kqPVNue6rf8YCJp2ZOtYCwk2Zxx9P1dKMYJ3pctD3LJV4NyOaKM EitsSZVrAtnmkx2z57p0QR9cWEtf7dc= X-Google-Smtp-Source: AMrXdXvueEIcfjMSQmy1d8MVwyGf+wTvACBJVhSpdKZXrxbzgngi4wPMdjCEXT1oWRqGUuwhXrQDpw== X-Received: by 2002:a05:600c:2247:b0:3d3:4b1a:6ff9 with SMTP id a7-20020a05600c224700b003d34b1a6ff9mr1597888wmm.26.1671627198545; Wed, 21 Dec 2022 04:53:18 -0800 (PST) Received: from localhost.localdomain (cust246-dsl91-135-6.idnet.net. [91.135.6.246]) by smtp.gmail.com with ESMTPSA id m6-20020a7bcb86000000b003b47ff307e1sm2124097wmi.31.2022.12.21.04.53.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Dec 2022 04:53:18 -0800 (PST) From: Alex Kiernan To: openembedded-core@lists.openembedded.org Cc: Alex Kiernan Subject: [OE-Core][PATCH v2 04/10] rust-llvm: Merge .inc into .bb Date: Wed, 21 Dec 2022 12:52:59 +0000 Message-Id: <20221221125306.13779-5-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221221125306.13779-1-alex.kiernan@gmail.com> References: <20221221125306.13779-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 12:53:23 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/174910 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 12:53: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: 17061 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 4B6EDC4332F for ; Wed, 21 Dec 2022 12:53:23 +0000 (UTC) Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) by mx.groups.io with SMTP id smtpd.web11.17635.1671627201557954335 for ; Wed, 21 Dec 2022 04:53:21 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=dj1moW9Y; spf=pass (domain: gmail.com, ip: 209.85.128.54, mailfrom: alex.kiernan@gmail.com) Received: by mail-wm1-f54.google.com with SMTP id o15so11076615wmr.4 for ; Wed, 21 Dec 2022 04:53: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=dj1moW9YmbdkuGkZNtIrhShZYg3aSlu32o1ck0G0zzhH2WQnIkVCP+a03VNDrEQjU6 3tPRZwpN2IulVj1VBpMjJAWghIjM+2XUVSK7Fl0cCVzDEWIBZD1upVACp62lU4o54knH jmvtBS8JywDuZwn2/JG2GHfrSddhApa8HaqoKQKvw+VFdbkoO9U73RmeD/LbRHpa+rZI 8Nh3TW4AhEQdLcILRz80/Hen80jm0uDqLSc0EYrh88LBBF5FDSQLvGmHVChAQUAHcWq8 dwsjj3Z5LOzbaSHjjlN9KpqjLuKsNNWFB8XdbzyJSgmxENpjNnuzMIUA930RXhBivldL bLfA== 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=OsntKRi4NjckWBqExYYH0OWIXm+zdnu6+O6xLGz7em+M4RGx/EYfjH9RNXBPTo4tbj bKuWYiP+S2Zv51B4S+KS76OFCwGFGj8jzZvKJBJXMS/x7zG1huOgoHuH/w1MSGy3tU+b 3nHCFOpCJIwSiinVN9QsYmDEEx5LRHhLlt9C0rN2RwrZ2/3DUsXxJkVU1yD9rCttS3cc 7KI/5v9oEVK8Fb7gHl4OTQZ5I1xk1Dr95VKMDGtewqvwIj3Ci2Rg23hxUW6hV4PbmHJR SzicssVIJHZIQusqiJTTxZ1QiUHaNYhA8cqnKepsyxhAKuwMw4YcRjRJ0ZfdzVcEwTPF wHoA== X-Gm-Message-State: AFqh2kqdL9aPpbAPdBla2TJdeRlbq9ovkcEpZufizozdfd780TqCfVM7 ppxxG1txy7nCkQOCdCZhpFwxZCr9SSQ= X-Google-Smtp-Source: AMrXdXvwQIxC/ndltmLdKcV6bDixFjRRogohgCXDQcasv9Dem6WaY8uG+cxalzXjNWMG7+hadPRE1g== X-Received: by 2002:a1c:1905:0:b0:3d1:e04f:9bf1 with SMTP id 5-20020a1c1905000000b003d1e04f9bf1mr1579117wmz.35.1671627199887; Wed, 21 Dec 2022 04:53:19 -0800 (PST) Received: from localhost.localdomain (cust246-dsl91-135-6.idnet.net. [91.135.6.246]) by smtp.gmail.com with ESMTPSA id m6-20020a7bcb86000000b003b47ff307e1sm2124097wmi.31.2022.12.21.04.53.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Dec 2022 04:53:19 -0800 (PST) From: Alex Kiernan To: openembedded-core@lists.openembedded.org Cc: Alex Kiernan Subject: [OE-Core][PATCH v2 05/10] rust-llvm: Update LLVM_VERSION to match embedded version Date: Wed, 21 Dec 2022 12:53:00 +0000 Message-Id: <20221221125306.13779-6-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221221125306.13779-1-alex.kiernan@gmail.com> References: <20221221125306.13779-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 12:53:23 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/174911 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 12:53: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: 17067 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 38033C4332F for ; Wed, 21 Dec 2022 12:53:33 +0000 (UTC) Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) by mx.groups.io with SMTP id smtpd.web11.17637.1671627202775453670 for ; Wed, 21 Dec 2022 04:53:23 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Ho8rWkX8; spf=pass (domain: gmail.com, ip: 209.85.128.46, mailfrom: alex.kiernan@gmail.com) Received: by mail-wm1-f46.google.com with SMTP id o5-20020a05600c510500b003d21f02fbaaso1435492wms.4 for ; Wed, 21 Dec 2022 04:53: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=Ho8rWkX8N+ordZw/wel2nogfZ+YkQkIZ9qoX2uoIbRVVcx1aGNF39GaQa4HleCU3ha FasSSqQaS0ufrJFuNuKHV7fXiV0c0+EW/Wv7TsIofPLWn2Ko2dcR0i/ec9+BbZxyRcJ7 LZwx3zP7U+5ALoFx5V3c2nip8dlV1Em3BQlmFsZXXp4HPLyXxFfj7CNm6bymxScEMwGX fMaRX/BMRCdwGCUqQ3xjfJzZ5ZjouUqLFKqsTjnmMhvSGycGCOFFX0V1U4HZlibuM9Wi l7p3Su3K8RoJDjs28uu4Mtgm+yd8PpS24lS58pLbwk+qgcgJjPrVuig3ivMizGzHV2ci 7SsQ== 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=MZfGbDmhU4sjhbY8KflD2ZHPdRARvlDF49AB2ulcB/+37beqz36PLCmH+OyJR4amof /2ZJLkohBqnN+/n8/XxabZwNfF1C/sukPP9NP+x1f9tb6itOvGg28vBZVGfyiYYjsiHr B/pe8QSj1bA5MPkKWfehmwKRvJl2uvu5GOvtQa3BP466qudk/CaS0VAXZ2DtA/vl24uI 2yYM+jthTfoT0RpKo01DnnxkxNXVnZ+w9a5RJCNcpxFwSNQIZWoYbInh/YlpyAFp3mfZ 3KyRb/M3x8qlWjZQ/yjKafhaoHFK22RzlSuBfiWMHD3q+VRbmZfdzdUTEkICupuCa+ku gzVQ== X-Gm-Message-State: AFqh2kqEJ2X7aP4jqHlTPdZVxH7ngD9fbwOj6EOdpvxFf++z61xgVCDd 096CW5Nk7YzOnJEW0LmLxcHiio7/aYY= X-Google-Smtp-Source: AMrXdXumGwpbzlYtGvEtNtKBhxB/2XzU6Wxiv+5aB+3JM8GasKRSo6c66u6xbd15e9xwGqBk9Ucx+Q== X-Received: by 2002:a05:600c:54cb:b0:3cf:d0be:1231 with SMTP id iw11-20020a05600c54cb00b003cfd0be1231mr1879210wmb.13.1671627201007; Wed, 21 Dec 2022 04:53:21 -0800 (PST) Received: from localhost.localdomain (cust246-dsl91-135-6.idnet.net. [91.135.6.246]) by smtp.gmail.com with ESMTPSA id m6-20020a7bcb86000000b003b47ff307e1sm2124097wmi.31.2022.12.21.04.53.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Dec 2022 04:53:20 -0800 (PST) From: Alex Kiernan To: openembedded-core@lists.openembedded.org Cc: Alex Kiernan Subject: [OE-Core][PATCH v2 06/10] cargo: Merge .inc into .bb Date: Wed, 21 Dec 2022 12:53:01 +0000 Message-Id: <20221221125306.13779-7-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221221125306.13779-1-alex.kiernan@gmail.com> References: <20221221125306.13779-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 12:53:33 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/174912 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 12:53: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: 17069 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 44E40C41535 for ; Wed, 21 Dec 2022 12:53:33 +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.web10.17933.1671627199281179632 for ; Wed, 21 Dec 2022 04:53:23 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=H92fd+Ok; 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 bg10so11107782wmb.1 for ; Wed, 21 Dec 2022 04:53: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=2HA/VgbRt4K5DtgWiWJz+bCKxX+eSYbjrNMB/rIykaA=; b=H92fd+OkvpAEszwa4otpSTINkF+7jnA25OWSbSSCSBlE6e3piryg/YCmnwCJwzRPOK l9W0tRKy769zpDEwTzP8Hfl925qv4xshmw5E0wsjjngWXlwDVoxd3aeMuAe4vgIEDg5n oJ7fHTtddiotLY+t7DcN11nsiz0HJT3iasIMWgpZ4hbsHfFvs+Cb1QN0daAx3fhHOAbe LB+CiezqR3iSi4KJUJEedz1ifKFz7njy/gw/GNAI22gZV9jYY0euHpiCb6QC0Oo+yIRJ 2lNWbxOlZfF20kGP0ilCUtab8zpmjWv8T8bAAl+ghI0Qv98lycFuwz9pynKwBQYrYOiU +dUg== 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=fepMDiFC3oQ8UQmyvys/DcbUf/nYOJsrSx2zJwRwDKZeTlPIMe0sVoIDCDgL6WHbbg uLMSJ6u8PTI2+ErQU2D2dWqSYMG3XWQT1RgOrrlDcjDJEtFgPxJLqlXhUAxvP7xvh9nu 3QpnTaHreyDT9zJIxlqLiPZDqso+hKVPPT1hSjly+jMYDRGN1DXkT7jEzBU71eRu7YvM dFVwjmMzW+x4V/tjUjPLW0MFz4vF4bDqVgpd1Za3VvoUV3zCAFC8laDLuJL8gapzeLX9 pqSOPsx753SeYQXpZk6ew7j3guXZ3rfTqiYQQ7yAJ/KDBGUYj5myfFLLRhvZL+Eagc3O bZ3A== X-Gm-Message-State: AFqh2kpz5WPqyBbSJWFPxUnATk8M9r4KAOod8XK/fv82KXkaAeTBA08P uR5IImfrgZyIlBdZz1XVL7sG++xaKrI= X-Google-Smtp-Source: AMrXdXvhrkdFl9Dsk1KHILBf1mfMnJi0gaje9IlOrTPW6yVh0H1zwV/LLecZrL9ct+43x/AANEM3+w== X-Received: by 2002:a05:600c:3b16:b0:3d5:365b:7749 with SMTP id m22-20020a05600c3b1600b003d5365b7749mr1674282wms.16.1671627202162; Wed, 21 Dec 2022 04:53:22 -0800 (PST) Received: from localhost.localdomain (cust246-dsl91-135-6.idnet.net. [91.135.6.246]) by smtp.gmail.com with ESMTPSA id m6-20020a7bcb86000000b003b47ff307e1sm2124097wmi.31.2022.12.21.04.53.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Dec 2022 04:53:21 -0800 (PST) From: Alex Kiernan To: openembedded-core@lists.openembedded.org Cc: Alex Kiernan Subject: [OE-Core][PATCH v2 07/10] cargo: Extend DEBUG_PREFIX_MAP to cover vendor Date: Wed, 21 Dec 2022 12:53:02 +0000 Message-Id: <20221221125306.13779-8-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221221125306.13779-1-alex.kiernan@gmail.com> References: <20221221125306.13779-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 12:53:33 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/174913 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 12:53: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: 17070 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 44E0BC10F1B for ; Wed, 21 Dec 2022 12:53:33 +0000 (UTC) Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) by mx.groups.io with SMTP id smtpd.web11.17639.1671627205210396201 for ; Wed, 21 Dec 2022 04:53:25 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Z7zUQrDQ; spf=pass (domain: gmail.com, ip: 209.85.128.52, mailfrom: alex.kiernan@gmail.com) Received: by mail-wm1-f52.google.com with SMTP id m19so11069315wms.5 for ; Wed, 21 Dec 2022 04:53: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=+KTwWqstqugEIhkp7pEb97N3UY4xkdK+Q0LeYPIX/1I=; b=Z7zUQrDQffw9oZU+FBzrTQEqXB9BPu8oIV+FWdmd3BEo5ED4CSw2tmz6b2aPvd6gaZ KgY+e0gwRLTnjMRRVAZculhHko3Y6B8YNYkOZiyrvedAluXwzWfk9sbSOpiddo4FWXGm 3kGtUJUZGSibJrseZ7FEZtp5XICO0pXsWvpkAeRm+txvS1gXFH3EHCsP9He9Mmt3Da1x oc87ow2n6gIwnK1vXsiHmMkQ47N/y4y8UCmfjbwJZ39OeUKnknx0iAvJYVQxWiRbvU08 FIXVgCj/p2MTmQSN8AbmiuB+ak7whFqUh2kd4S+uDDyHOwxOzzBjBZWAvB725dvhhXuJ ME8g== 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=qQ0aHS0ipXM9plAakerxGTzllB9c2DivrXgpCzy14CflFJhTqhvNH1eE/yY0SV/M2I H2Wiv+XqADmYeg9HxO/JqmhC8IcC4CIVWPX5OkhYcQuyqjB0Zl+bpaOmRyILThvN/aff nUvVP3J4QRHiEdJPh+3WPgV5j5U5uCedsDdzFSxaTcUtL0GYBeQDPbHkQ/WbwnTiONnJ oF5E4h0jmfBi/8gDvu1anfS/PeoeEtDFbmKJKpU/iJDhM96ab/quU3iuv/35LgPJbaw6 AmWev0QyMmPmqb0fjihkXCgoDXy8O4/wpUnPV6S9jqBklka/wsVA+PwZoMMu5sPdJjbu gaOQ== X-Gm-Message-State: AFqh2kpbKZXEfGknpVoAK0YpUnv46eDAl+rPQhuj3wRZvb2wWDzkNzTM MWfqXwmfxatERhXjCfLPtg7TWAey+xI= X-Google-Smtp-Source: AMrXdXuwdiMjxZINErjNZJPFpOKxF+SpAS2a4OGr3rWqBucd2TeSomWkXezqglwUIaSN1Afjc+ESxg== X-Received: by 2002:a05:600c:41c2:b0:3d3:5565:3617 with SMTP id t2-20020a05600c41c200b003d355653617mr4345678wmh.24.1671627203393; Wed, 21 Dec 2022 04:53:23 -0800 (PST) Received: from localhost.localdomain (cust246-dsl91-135-6.idnet.net. [91.135.6.246]) by smtp.gmail.com with ESMTPSA id m6-20020a7bcb86000000b003b47ff307e1sm2124097wmi.31.2022.12.21.04.53.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Dec 2022 04:53:22 -0800 (PST) From: Alex Kiernan To: openembedded-core@lists.openembedded.org Cc: Alex Kiernan Subject: [OE-Core][PATCH v2 08/10] packagegroup-rust-sdk-target: Add Rust SDK target packagegroup Date: Wed, 21 Dec 2022 12:53:03 +0000 Message-Id: <20221221125306.13779-9-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221221125306.13779-1-alex.kiernan@gmail.com> References: <20221221125306.13779-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 12:53:33 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/174914 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 12:53: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: 17066 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 38064C4167B for ; Wed, 21 Dec 2022 12:53:33 +0000 (UTC) Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) by mx.groups.io with SMTP id smtpd.web10.17929.1671627193831878430 for ; Wed, 21 Dec 2022 04:53:25 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=pDfpQ4VX; spf=pass (domain: gmail.com, ip: 209.85.128.47, mailfrom: alex.kiernan@gmail.com) Received: by mail-wm1-f47.google.com with SMTP id f13-20020a1cc90d000000b003d08c4cf679so1363242wmb.5 for ; Wed, 21 Dec 2022 04:53: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=zz5soOyitzRGpcfby0vWFDxQPip+7qK8tU8MjYrkAQ4=; b=pDfpQ4VXbEnUgx001VK/hAm32WgRmsMAsM+ik/eBOiDVph8IaDOFJ4waHfcIFWGtL/ ZF3vdbZxHo2aZmt9/qIrN/mlJ3o2yM2PB5lQNJ79XACiOCXtk9KCQQQQdpdIt/UbRWKY Y05aotdRgA7FcBB0mzafmKfQOsedCGdCnK+Cf0PqJSF3I4o/9y9tAQpXQRq+ksVYjjWs O/O/KHVq+IAdVL83q94tgoMAV2vPto4ZfwpnErLFdkKQ8A92NWayjjiT3dFA0dpKnYcw jChSUShMGEVQ3pC8dwAm0FJg17EGAvPPLo6J/hRufJxUI0qo6diX891/cwIAALkTXYWP gZrQ== 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=zz5soOyitzRGpcfby0vWFDxQPip+7qK8tU8MjYrkAQ4=; b=ti4+K0yeWLaRTnroxzZBnJiqkbwODMEZZQyaJN+uEQe/pyCaoJ+HRw1c9A820QaweL nbPHuODSqh73JvEtg7ofhbqRbA+1gdtYEPK7kyGOt+MGaeiewlKA/pY4ktyHyYe5f9Zj YvqsFsX7vqzPcWmLAmVFAUPiBrgxSj4agW2HMkMUe9+KRSrvJzHwnHfsiXJN7vP2OsIV xLOGTXceYZLhA4qj87PA3Vb6nMOQJlpS8H/qb9QThm1mfWBOr8P5UK3FVZGEpPxTjqXc gce+5eOV5HBXE4qqykq6HH5dThv5Sn2Z/6RFppKYZdNP79ysJwSNGVBm2iwhV9ZNJOIZ 1xDA== X-Gm-Message-State: AFqh2kpoSM70v4Eu+hpDa04owIhm5P8mOM2vxJbo0A0+HpOsSfalFbjw 5J3e0vg3I1j+bdp6m8EI+EQxqAPhyDY= X-Google-Smtp-Source: AMrXdXujbVzP9NtLQs19h7EqPhXfTtieV2NfAIZghYn1CKH0wrouwIukM1eLgF577YfOO3/HFUAQVA== X-Received: by 2002:a05:600c:1e16:b0:3d1:d1a9:efde with SMTP id ay22-20020a05600c1e1600b003d1d1a9efdemr4347559wmb.12.1671627204783; Wed, 21 Dec 2022 04:53:24 -0800 (PST) Received: from localhost.localdomain (cust246-dsl91-135-6.idnet.net. [91.135.6.246]) by smtp.gmail.com with ESMTPSA id m6-20020a7bcb86000000b003b47ff307e1sm2124097wmi.31.2022.12.21.04.53.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Dec 2022 04:53:24 -0800 (PST) From: Alex Kiernan To: openembedded-core@lists.openembedded.org Cc: Alex Kiernan Subject: [OE-Core][PATCH v2 09/10] packagegroup-core-sdk: Add SDK toolchain language selection support Date: Wed, 21 Dec 2022 12:53:04 +0000 Message-Id: <20221221125306.13779-10-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221221125306.13779-1-alex.kiernan@gmail.com> References: <20221221125306.13779-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 12:53:33 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/174915 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..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 Wed Dec 21 12:53: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: 17068 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 3D387C3DA7B for ; Wed, 21 Dec 2022 12:53:33 +0000 (UTC) Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) by mx.groups.io with SMTP id smtpd.web11.17640.1671627207796468335 for ; Wed, 21 Dec 2022 04:53:28 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=lPd5lSfc; spf=pass (domain: gmail.com, ip: 209.85.128.54, mailfrom: alex.kiernan@gmail.com) Received: by mail-wm1-f54.google.com with SMTP id bi26-20020a05600c3d9a00b003d3404a89faso2389130wmb.1 for ; Wed, 21 Dec 2022 04:53: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=lPd5lSfcXGAwNDHUfTNjfMufpVptuLnbXLY4Qo+IIcMOpvh3CVmJdfsq7qSJswC2TJ OrkdmbNu1ik9yuMVSeEOVdbo0AnHsavusSCg1Tn9k91OPf9eyiqnQpYCMRKnyhs6QLRp tzqoa6ptHZnVPg8ga/KMvLtEBOoPDA2a74Xqb3lfL4N5A9qDqkSDr2SIiRQf0YFo4iPK HJ+3r8qkw3vDqQHtCEl/aJsVRLwp6XavZrYJwdeGXVlfzxV1rfZkrGZiVdgBOpJ1QWDD tMYltB2ktC0Dcm+p+qzjv6e0Vw6qJGu5+1zhywgwfscof7iEpUPihsUYmHMRw44AwWkC XdGA== 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=iknPRyoI9/Mqktexx1NvRzAamInGOY4wSHzTtKGbnFgbzSbJRUELZAK0HqKEreAxnq p9hFTxW4z2zwCFnYe6FGn36axSn6s1RvUSL/fLNJD1BkVkWIqeze9HWDk5hLD8wY1aKr J0wUW0vf3TJelOhauhIO0VKHnxnEYbbro6OcPiXRiHQozKGAhaN+BXXr5HU8OwTsnYNw BBrKJu/e7E30m3aKB8p9UPezj3BsKrFtcc4hE6dV7ex1W+iMdiFAiXO4WPB9Om/5ZF/m ySczzaFbww1C6+FBns6cvICmgcxwGYVAyTLRkwgOdQQuwjKHxHcxRGwXQddPDaU/og8Q fNUQ== X-Gm-Message-State: AFqh2koGiJPjwtyDm0U/7oJd3gwDi29Gh8Cec8A2Pj0UP4n2dwQp4CVn slpb8H8GOVBI4/jXFSmJCV52WyKPgZM= X-Google-Smtp-Source: AMrXdXu7lAkAiK+6e+KlwXu5MAsPxwAGFFkY0qRdE17K6EtAJpJSondzMMo2cP6BEC2t/My/ow4YoQ== X-Received: by 2002:a05:600c:4e51:b0:3cf:7b8b:6521 with SMTP id e17-20020a05600c4e5100b003cf7b8b6521mr1555394wmq.32.1671627206163; Wed, 21 Dec 2022 04:53:26 -0800 (PST) Received: from localhost.localdomain (cust246-dsl91-135-6.idnet.net. [91.135.6.246]) by smtp.gmail.com with ESMTPSA id m6-20020a7bcb86000000b003b47ff307e1sm2124097wmi.31.2022.12.21.04.53.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Dec 2022 04:53:25 -0800 (PST) From: Alex Kiernan To: openembedded-core@lists.openembedded.org Cc: Alex Kiernan Subject: [OE-Core][PATCH v2 10/10] oeqa/runtime/rust: Add cargo test Date: Wed, 21 Dec 2022 12:53:05 +0000 Message-Id: <20221221125306.13779-11-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221221125306.13779-1-alex.kiernan@gmail.com> References: <20221221125306.13779-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 12:53:33 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/174916 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'])