From patchwork Sun Dec 25 21:59: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: 17193 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 22A0AC4708D for ; Sun, 25 Dec 2022 21:59:36 +0000 (UTC) Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45]) by mx.groups.io with SMTP id smtpd.web11.126056.1672005573088389717 for ; Sun, 25 Dec 2022 13:59:33 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=jzmcNUDa; spf=pass (domain: gmail.com, ip: 209.85.218.45, mailfrom: alex.kiernan@gmail.com) Received: by mail-ej1-f45.google.com with SMTP id ud5so23126459ejc.4 for ; Sun, 25 Dec 2022 13:59:32 -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=FVEzvAqn1upnavbNTfqGymSJOsGp+qz/Lv+uZdYdre8=; b=jzmcNUDa8FAS+sa47khUvwE1i6FBxmgm9U3jfx8oC+aXbs2/UwCAbyVO6TRLkQzpqB dhjLKTp2FOnFwJ+WxARSNMeaZuAe+e5zRgbCvMNkH3TpWSdfksc7X5IfGOxCufNxpuqR 1z7yg8bin1PRCTe8vaJiZh6j99GNJZ09zII8ngCv2jzCAYmAOMOONkkanpraPhas3h9b qtq9VI4FbxLt0r+tCGcO+hCUd452yZ4eHlgSV7AhfeZXE5js5lODS6D0rQADGlLIfUmi Jl3SnOr871W4Gq0YhUt7emw8h0M2dkeU5RtVhTU8Amc9M2tISA/JSjtEo2u8OL+4ezXi I4yw== 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=FVEzvAqn1upnavbNTfqGymSJOsGp+qz/Lv+uZdYdre8=; b=Ba1qbcDRyeKAoY8cKrBijFS+NxT38+DJDxWWR26mRiTgcb4F61AKgv0EncHSjXRaT0 kxkp+oVVXFNAjDQoqqw1IMk1e9kpXshtLGM7Ok4okJ7cOMWbjAmhzUetk2po84dC/flq CAuz4st1nPq2lD8BtMaswX7PvvL7NWFuOqXbCN2yJV02FG62JYBsJ9Aj4kMAWPiQNeiX /pEpUviyoOm/mwV5/E38nCF7dzg2a/fSMWFnsRYOj4ZCm16JY+eKKvZTSDB+OG6eNotj RyuStqHguQNU9+cLXd3/xrzRrZO4RHLIaYwzgX4+fJn0JLzB5PiTYRsL77XH045h/lY1 OYRQ== X-Gm-Message-State: AFqh2koekZk+XgSm0PY7N0Lcs8d/x6NtK+QIcltDs49YzAZmQ21AagQt zHJXvzmvV2r+KSLr5CV2JkT5z8TC2Vw= X-Google-Smtp-Source: AMrXdXsMWzu6e6AJ+4ut4nZqmEA2keAk+hCOxeZd2zFYlaYUlwe8AKfYwIYM0yUdaJtw4FG6z7J9gg== X-Received: by 2002:a17:907:c71b:b0:7c1:67ca:56f5 with SMTP id ty27-20020a170907c71b00b007c167ca56f5mr18989476ejc.15.1672005571266; Sun, 25 Dec 2022 13:59:31 -0800 (PST) Received: from localhost.localdomain (42.93.115.87.dyn.plus.net. [87.115.93.42]) by smtp.gmail.com with ESMTPSA id k8-20020a17090632c800b007c0f2c4cdffsm4066487ejk.44.2022.12.25.13.59.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Dec 2022 13:59:30 -0800 (PST) From: Alex Kiernan To: openembedded-core@lists.openembedded.org Cc: Alex Kiernan Subject: [OE-Core][PATCH v4 01/11] rust-llvm: Merge .inc into .bb Date: Sun, 25 Dec 2022 21:59:11 +0000 Message-Id: <20221225215921.12868-2-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221225215921.12868-1-alex.kiernan@gmail.com> References: <20221225215921.12868-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 ; Sun, 25 Dec 2022 21:59:36 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/174996 Signed-off-by: Alex Kiernan --- (no changes since v2) 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/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 Sun Dec 25 21:59: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: 17191 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 0D3E2C46467 for ; Sun, 25 Dec 2022 21:59:36 +0000 (UTC) Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.44]) by mx.groups.io with SMTP id smtpd.web10.125282.1672005573826840492 for ; Sun, 25 Dec 2022 13:59:34 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ENPIXjAu; spf=pass (domain: gmail.com, ip: 209.85.218.44, mailfrom: alex.kiernan@gmail.com) Received: by mail-ej1-f44.google.com with SMTP id bj12so23050285ejb.13 for ; Sun, 25 Dec 2022 13:59:33 -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=ENPIXjAuZ0uC1fwGA42O5hWnbSifDB9GCsBGPfwmvxBAo9dH13NNGGxiEeKA21MD3U /AhR7Q64qcE1lJ2EptcPyTSMKAYxrtkQRiiFp8dMQgMHouKOtUlpHcXa0J8pK1B6mdxG NDUR22Mm0vQMfm+F6xUcIT2ozMpDhrmAUQift/HfZsxVysZyExVrhE19WtJbPaTjdHjm 5nxzjdN7jEqqcwRSOMgJzlU10qHRJLdM101GIgc5gVYy+sIga7uST/iEdJh3Tkk8BCh/ KWboyBfZXbae54g47vsaL+SkaX9455WHnHT5lF2ObEFKMfLYEWrz3XnIPFJasMw8c0dh xM7A== 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=A/MpLy8yp+vrRXaXjrsz8TgAHnwlxOooxza/3ny+wuK4KRjrSTbAkdKGs6pIoaJ0wL 6l2vIc0Kx0gXhq6ddyrudFb3CISe+vYPQc9Yf68wUFP2QFsfHN2GTvo0gNWW9WI4WybY kmLpB/4VXsOzAlHVEeKBa97H8BEKA1HyMTVvVsF6lmQAr9k9nX/7CbRQFgCYr+O38mu4 JuNjryPu1n7d4Zd1ZdkZZblBnyNiT61b5UQAZUHTjmTitUD/IGHsVKXolYEwaAe3Ip1j 2jU1msOoKfFlLQYZ+FBy0RKeJWbqUlPvZIQtGtMkHq06H9awiev0iE0aJIdX4XB05oOV t89A== X-Gm-Message-State: AFqh2kp1ta6xO9c7WqpwGSQhPrFzCwdfwJGQh33Zw8ieenhg3WLlyudF JisJ9rzTLry2rNXe2nf2xYGeKwIB+rw= X-Google-Smtp-Source: AMrXdXtmlw3Y0XNuvx/2mA9cDvAMPkePBDBKE6nfrjGdJVtie0DVWOvTdDZD83WIIh9QbVBBA4o8AA== X-Received: by 2002:a17:907:8a20:b0:7c0:cfb2:40d2 with SMTP id sc32-20020a1709078a2000b007c0cfb240d2mr17545924ejc.64.1672005572138; Sun, 25 Dec 2022 13:59:32 -0800 (PST) Received: from localhost.localdomain (42.93.115.87.dyn.plus.net. [87.115.93.42]) by smtp.gmail.com with ESMTPSA id k8-20020a17090632c800b007c0f2c4cdffsm4066487ejk.44.2022.12.25.13.59.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Dec 2022 13:59:31 -0800 (PST) From: Alex Kiernan To: openembedded-core@lists.openembedded.org Cc: Alex Kiernan Subject: [OE-Core][PATCH v4 02/11] rust-llvm: Update LLVM_VERSION to match embedded version Date: Sun, 25 Dec 2022 21:59:12 +0000 Message-Id: <20221225215921.12868-3-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221225215921.12868-1-alex.kiernan@gmail.com> References: <20221225215921.12868-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 ; Sun, 25 Dec 2022 21:59:35 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/174997 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 Sun Dec 25 21:59:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Kiernan X-Patchwork-Id: 17192 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 0A8E8C4332F for ; Sun, 25 Dec 2022 21:59:35 +0000 (UTC) Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) by mx.groups.io with SMTP id smtpd.web10.125283.1672005574799387788 for ; Sun, 25 Dec 2022 13:59:35 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=hc/h4W9I; spf=pass (domain: gmail.com, ip: 209.85.218.47, mailfrom: alex.kiernan@gmail.com) Received: by mail-ej1-f47.google.com with SMTP id tz12so23086179ejc.9 for ; Sun, 25 Dec 2022 13:59:34 -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=1YlgVUmiYjg1J/GEX49qH/hsjBd0WI8g61dopNy/aw0=; b=hc/h4W9IvBm5UTyN4/o+BisrAB1JuroZrmDQ+ZTHGZ0ASxTP7xtshd1XiFSgWuB4/Y Mnt26jBGt9QAKqYsjKqoL+QfoOcdH5Stn341S5KrZMWxMnwVdMbto0MbreM4eF0Ud4y8 +eGR5J7LHjaqt1V+hW+qOvOx0XhjGYhaEtY0x/9UDW5CArTG2I1kQxP/MfhprVEp7bKX /Pbk+/QQp6d2kc0lh+jhncf6eXI5EXYxEcM6NMG0Pi5qP3SxuIN5No4RqeuJWk/I1uDF 5odNTtlcbPOsCp/lcGQTFZre/h8jrM6f6XJDsnIK4Y1nBUrgzkE8y3A7IkVw4krNDF0q FA4g== 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=1YlgVUmiYjg1J/GEX49qH/hsjBd0WI8g61dopNy/aw0=; b=GrozYzSKjsPhR7zVzZe+LzQgeAJEcY1Acdy6gZ0ZHZx7fyQxjUaMNYVg6ufIINj9Hv jPEeHp/f/pxhxeUNWy2amZXQHbkxXX2O495YlU0nFUoENYn0plJV5or4YhfJxuIl8xiG C/4akyaDcUxxliNaPxlbtT6I+S5iVISUTW8aZwIM0StyRdpETOO4pFYwDzfVRO9wkCcC 1lo8up8Ck5JEcib8OK8gMHHrpM/U5iRajFi+wwZDP6U8aVSkE7GtPuOOzS4GqwG4kp6D TTr/3X8nMfR23188cKaOGoIDcurAYumNv8IbQy10ZyyIGWOWAqNvUX30zWjQxtIgQg4A kEFQ== X-Gm-Message-State: AFqh2kqaVKAzutIEKM4thnn56vL0WuPrxijJYXrzGnIVA6+EAcoN1xf8 bwctKuP4R5ahwUTZXLOCm/1TcKxPT6I= X-Google-Smtp-Source: AMrXdXtndHUjTTC+04sAc/7A/i9AO7vNhTHueThGoMKMK2dt1WI+7eJn3gAo7x0zpVX0PIBlyY9MrA== X-Received: by 2002:a17:907:2587:b0:7c0:e7ad:fb0f with SMTP id ad7-20020a170907258700b007c0e7adfb0fmr11009651ejc.20.1672005573188; Sun, 25 Dec 2022 13:59:33 -0800 (PST) Received: from localhost.localdomain (42.93.115.87.dyn.plus.net. [87.115.93.42]) by smtp.gmail.com with ESMTPSA id k8-20020a17090632c800b007c0f2c4cdffsm4066487ejk.44.2022.12.25.13.59.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Dec 2022 13:59:32 -0800 (PST) From: Alex Kiernan To: openembedded-core@lists.openembedded.org Cc: Alex Kiernan Subject: [OE-Core][PATCH v4 03/11] packagegroup-rust-sdk-target: Add Rust SDK target packagegroup Date: Sun, 25 Dec 2022 21:59:13 +0000 Message-Id: <20221225215921.12868-4-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221225215921.12868-1-alex.kiernan@gmail.com> References: <20221225215921.12868-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 ; Sun, 25 Dec 2022 21:59:35 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/174998 Signed-off-by: Alex Kiernan --- (no changes since v1) .../packagegroups/packagegroup-rust-sdk-target.bb | 13 +++++++++++++ 1 file changed, 13 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..334b24900b4b --- /dev/null +++ b/meta/recipes-core/packagegroups/packagegroup-rust-sdk-target.bb @@ -0,0 +1,13 @@ +# +# Copyright OpenEmbedded Contributors +# +# SPDX-License-Identifier: MIT +# + +SUMMARY = "Target packages for the Rust SDK" + +inherit packagegroup + +RDEPENDS:${PN} = " \ + rust \ +" From patchwork Sun Dec 25 21:59:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Kiernan X-Patchwork-Id: 17194 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 C7137C4332F for ; Sun, 25 Dec 2022 21:59:45 +0000 (UTC) Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45]) by mx.groups.io with SMTP id smtpd.web10.125284.1672005575707192098 for ; Sun, 25 Dec 2022 13:59:36 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=fQ61XTTX; spf=pass (domain: gmail.com, ip: 209.85.218.45, mailfrom: alex.kiernan@gmail.com) Received: by mail-ej1-f45.google.com with SMTP id tz12so23086222ejc.9 for ; Sun, 25 Dec 2022 13:59:35 -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=2jYLIKmkvQJnIg3Sh9/k6yXV52jav2Ydx0BeCZo2skM=; b=fQ61XTTXyfPQ711iPlViS5Ha9hpiqIGe/XOIQicLj1JmcsPska67D0pXVZxRsgksR6 RcpVVIptcoucDWEz4iDEZHyTVT0AKQb4G2inudwlM/r1rF3Vq4C85+/lp+cWcAivoGnm Qka59OFDGNIaIoVTKUvAKCw5xAZSrCrBwbkFSmQw0Bu5bsBdrD7UF1iv4FqlmAnTnyWy pGX0o881J6RSZQnHfjgMVgBUe8BE6HZXIeeFi2gepxIS+JHrE1pa1C5xcebrEEb+T6qm NYCXjdwSs6zZD22LhFp1WNPV0r0aXSGAJ2z/dMZm1xyaGQYTDsLAIIzYEWV/dhMJNp7G 7U9w== 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=2jYLIKmkvQJnIg3Sh9/k6yXV52jav2Ydx0BeCZo2skM=; b=O+82olnQaZgLYOvAMsmIp5NYRSlqrocLFEhTKWY4E0fUgp4tvRiC8tQKOZ7RqNj/c/ Si8T0ZL30ycvFi8d6ZbWc5bFFOph3AMXqNiISbN52XUjvCbPBOHMHG1QN+6Hmz2Le4Eb EjAFZLTteceeymzgZ9sDQUvkAPpFmwTjZ41QtvI+TXETYvtAHz57KY45btlYg8HSvfkA UU/JCnrVBpwC9ztLpx4Gn720NW71MblfmjC8E63MYj5hQ8CxL5BF8OBRBkO19T37vC/d GtQ1VtsT7+3X3LeQxdgAAndlKQ775NrA9TaGhmLH7D31mFxc3gLRVN8Yiy6EylqIBY1H 53OQ== X-Gm-Message-State: AFqh2koTqpwEzdbgN1arlBp/uqnQY+FOXozUs1xsUyfwZof+whWu3zzM ejI+a+W3yHyu1/yZRh02ihPc75E8HyY= X-Google-Smtp-Source: AMrXdXt7NWf3wLv2HA1uZgurdNw+abppAZ7aAb0UvUaz/89HSVuW6XOcoKxpDdClp8mEWQN9tN7Ihw== X-Received: by 2002:a17:907:cb85:b0:7c0:f216:cc14 with SMTP id un5-20020a170907cb8500b007c0f216cc14mr14388798ejc.11.1672005573998; Sun, 25 Dec 2022 13:59:33 -0800 (PST) Received: from localhost.localdomain (42.93.115.87.dyn.plus.net. [87.115.93.42]) by smtp.gmail.com with ESMTPSA id k8-20020a17090632c800b007c0f2c4cdffsm4066487ejk.44.2022.12.25.13.59.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Dec 2022 13:59:33 -0800 (PST) From: Alex Kiernan To: openembedded-core@lists.openembedded.org Cc: Alex Kiernan Subject: [OE-Core][PATCH v4 04/11] packagegroup-core-sdk: Add SDK toolchain language selection support Date: Sun, 25 Dec 2022 21:59:14 +0000 Message-Id: <20221225215921.12868-5-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221225215921.12868-1-alex.kiernan@gmail.com> References: <20221225215921.12868-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 ; Sun, 25 Dec 2022 21:59:45 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/174999 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 v3) Changes in v3: - Switch to packagegroup-core-sdk driven from TARGET_TOOLCHAIN_LANGS (which defaults to SDK_TOOLCHAIN_LANGS) .../packagegroups/packagegroup-core-sdk.bb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb b/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb index d70aff22c725..104f3549d593 100644 --- a/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb +++ b/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb @@ -11,6 +11,11 @@ inherit packagegroup #PACKAGEFUNCS =+ 'generate_sdk_pkgs' +TARGET_TOOLCHAIN_LANGS ??= "${SDK_TOOLCHAIN_LANGS}" +TARGET_TOOLCHAIN_LANGS:remove:sdkmingw32 = "rust" +# libstd-rs doesn't build for mips n32 with compiler constraint errors +TARGET_TOOLCHAIN_LANGS:remove:mipsarchn32 = "rust" + RDEPENDS:packagegroup-core-sdk = "\ packagegroup-core-buildessential \ coreutils \ @@ -23,7 +28,10 @@ RDEPENDS:packagegroup-core-sdk = "\ less \ ldd \ file \ - tcl" + tcl \ + ${@bb.utils.contains('TARGET_TOOLCHAIN_LANGS', 'go', 'packagegroup-go-sdk-target', '', d)} \ + ${@bb.utils.contains('TARGET_TOOLCHAIN_LANGS', 'rust', 'packagegroup-rust-sdk-target', '', d)} \ +" SANITIZERS = "libasan-dev libubsan-dev" SANITIZERS:arc = "" From patchwork Sun Dec 25 21:59:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Kiernan X-Patchwork-Id: 17198 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 DF3A0C46467 for ; Sun, 25 Dec 2022 21:59:45 +0000 (UTC) Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) by mx.groups.io with SMTP id smtpd.web11.126055.1672005572286435701 for ; Sun, 25 Dec 2022 13:59:36 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=JEoWQhRU; spf=pass (domain: gmail.com, ip: 209.85.218.53, mailfrom: alex.kiernan@gmail.com) Received: by mail-ej1-f53.google.com with SMTP id u19so23077569ejm.8 for ; Sun, 25 Dec 2022 13:59:35 -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=JEoWQhRUZMVum7pYPxyf8dj5AW0o5Hry3IT1QDyOH+JOX9LagQc5pWGVg54B7yGT+5 zMS2JC7Vq7XYk00nrBAktjXMci8Sp1ANQ/OMV9ePRcyOaslw/gfXnRQg5eN9fQjubdyb K7WlMPJ35CHnxCAVq1SM/EQw8JVu7xxuPyedwqroX4pwU+7ZD9VEmE6HRkQvqsc6oAmZ hP3WiSAqpLTfjs323Z4PRR+JKFCNb09bsLYJTfyKYfbN+OBpU8ZdMVwUxhi38u9S5FlH FkJlAbZ2Lv0w4AKpvi7pYGLd1EKxnwlpfSZRBXpkMJ9URGTcxV/m6REmwPiQ4U30ps1n ZNbA== 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=2dmgtSzsmVptNtMTSwvRHZBpmjdaP5HIDOi9JuHTSEFHt1qQsJi6cbUF8YcL0XOFKY fh3OX4pSCLllD1HE5utFXWpu1hGGc7TjHHjmiKOtNp8TxRFCHjc8BP4ZnNv6NYrKYrxh mtlAYz718XFGlqj4iRxQN1yR2hGSXZeC7OpEV9BpoUFW5lx89VB/gE5NDPXnZFBT6aFl xPhmX3W8PVdesfJbJiq/y2/fkIdFphWvAbgdPkJS7qS9i/BX/imyCkaTmF2MlE/F3ihO NRz3eFyG9AoNx309gdJdJ2qifP2Uyx3p6foUs4WQKAx8/tP2XEVKQNLnfxlr8LHEVvkC ohIw== X-Gm-Message-State: AFqh2kqfKVF6hBrlNZ6q5aBDI1Fw+/CCqQHfM9qXvRHeGu7iSt8PycHp Lngj9P361RumcJ8n/xYoGwd9oR9Hp9A= X-Google-Smtp-Source: AMrXdXvKSTI/U773Le2L7fI1I5AdvNQDMepYEC+BORBO6H3tsthMiFpVjYTsUjAPDKNToadjYOgwTA== X-Received: by 2002:a17:907:8b89:b0:7c1:6f86:eeb with SMTP id tb9-20020a1709078b8900b007c16f860eebmr12587652ejc.7.1672005574867; Sun, 25 Dec 2022 13:59:34 -0800 (PST) Received: from localhost.localdomain (42.93.115.87.dyn.plus.net. [87.115.93.42]) by smtp.gmail.com with ESMTPSA id k8-20020a17090632c800b007c0f2c4cdffsm4066487ejk.44.2022.12.25.13.59.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Dec 2022 13:59:34 -0800 (PST) From: Alex Kiernan To: openembedded-core@lists.openembedded.org Cc: Alex Kiernan Subject: [OE-Core][PATCH v4 05/11] cargo: Merge .inc into .bb Date: Sun, 25 Dec 2022 21:59:15 +0000 Message-Id: <20221225215921.12868-6-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221225215921.12868-1-alex.kiernan@gmail.com> References: <20221225215921.12868-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 ; Sun, 25 Dec 2022 21:59:45 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/175000 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 Sun Dec 25 21:59:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Kiernan X-Patchwork-Id: 17200 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 E11E6C54EBC for ; Sun, 25 Dec 2022 21:59:45 +0000 (UTC) Received: from mail-ej1-f52.google.com (mail-ej1-f52.google.com [209.85.218.52]) by mx.groups.io with SMTP id smtpd.web11.126058.1672005577660685637 for ; Sun, 25 Dec 2022 13:59:37 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=KNlASZQn; spf=pass (domain: gmail.com, ip: 209.85.218.52, mailfrom: alex.kiernan@gmail.com) Received: by mail-ej1-f52.google.com with SMTP id vm8so16242759ejc.2 for ; Sun, 25 Dec 2022 13:59:37 -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=KNlASZQnzAiUqI0T+jEXJmjurw6dOwdUW4OABexoU8GDZgoDikETkG9bWSFkgtgkgJ WcNuYlyPYsSdGF+8NR0CCg+X9Tl2I31M+zt2UMhRrRjSvIM+pa9AmCjGmWQw2q8jN5O/ J6z+i9nsklTNK8mRSvIv2K5Oo7x+f2VNxBRFQ31eCP7z1Ot3K7WcDmybgI3yDCByaSqA e3pPKKp0SThwPTdO+7W4kmOJlRJjKBvgDMEw4/H2lesfm/lE3e9arc4XUHlvksYm0tsv 4Y+C/Lg8x0NQZm0BmVyYXk1Yr2NBRl81cRDx/ua2J6etKkMpuGaoMgZGQRpHZdG6Bf+O st5w== 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=1yI3BpN6mGD3pxJ06c+FffwGbZcTWguYBlSSxjTVeguOyoo6bNZe7AMcCuEMY4A6mB /any/Gh6rsLZD+wTvllfRlNFnfuDrhVXcGr6dwbZMQKqXdgoEnTmCRP7iQNWE/c6QSTj J+X4ur43JeKLumm/4+bkaoX/jQA/s/P8S5Jv1ZJZi0jevRSYYSEuxAjUJQ42evm7yFhb QqxlSTGJeySurwkiihBdB2lW+tPI9n759dAUtjyYex+RoDY0SOe+ZuKD3AnQNiEXoGfN XmgpKHtk7TIPqNFNWEnAWUlF57+sHgnGE9+6+8ayWDg/FYrFS1A7UG+f+yZZjj7biIW0 yUKg== X-Gm-Message-State: AFqh2kpzNC3OhFSFAK4Q+eMrOEvRWKDVNa2w0IKvw4kC+GJbt/4emCBz 0l3VlaJZnX26D3EMXF3Jp57HTuT9lCE= X-Google-Smtp-Source: AMrXdXuvQPD/uGicwjNg4pd40zlHISQOQwsiWMwKfTezTNoFQEGrKhTY7rgEkSJMaGAzWJD8dvwHOw== X-Received: by 2002:a17:906:30d3:b0:838:9b81:1c98 with SMTP id b19-20020a17090630d300b008389b811c98mr13029131ejb.1.1672005575804; Sun, 25 Dec 2022 13:59:35 -0800 (PST) Received: from localhost.localdomain (42.93.115.87.dyn.plus.net. [87.115.93.42]) by smtp.gmail.com with ESMTPSA id k8-20020a17090632c800b007c0f2c4cdffsm4066487ejk.44.2022.12.25.13.59.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Dec 2022 13:59:35 -0800 (PST) From: Alex Kiernan To: openembedded-core@lists.openembedded.org Cc: Alex Kiernan Subject: [OE-Core][PATCH v4 06/11] cargo: Extend DEBUG_PREFIX_MAP to cover vendor Date: Sun, 25 Dec 2022 21:59:16 +0000 Message-Id: <20221225215921.12868-7-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221225215921.12868-1-alex.kiernan@gmail.com> References: <20221225215921.12868-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 ; Sun, 25 Dec 2022 21:59:45 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/175001 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 Sun Dec 25 21:59:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Kiernan X-Patchwork-Id: 17199 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 D68DBC5479D for ; Sun, 25 Dec 2022 21:59:45 +0000 (UTC) Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) by mx.groups.io with SMTP id smtpd.web11.126060.1672005578985679525 for ; Sun, 25 Dec 2022 13:59:39 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=a9BB7Egf; spf=pass (domain: gmail.com, ip: 209.85.218.41, mailfrom: alex.kiernan@gmail.com) Received: by mail-ej1-f41.google.com with SMTP id vm8so16242811ejc.2 for ; Sun, 25 Dec 2022 13:59:38 -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=jicuNX8MyR2qm/bAJiW5ZbV2IE5vfTz2MWnU1FkKpc4=; b=a9BB7Egf6NBmMoYcihheq+Ns4HuitREXUFVTZwxve1y+tVejst7jp+kxyo3GB+zm5f CG7RKkU5RSVu2PiePgeDX+Xk2h+Fs6HmpXpPZTpy+uhRqnvLDYc8sy3b6oFUySNTBEED rseUj54jNimKcCiYgDRsfVP3tV1kXIQszPdFqOFXw7tI9MshGuszoi0cYTYVHepZ17mR PDcdMbjA2FWvLVV/WKEQMU+J3p85FbcGXPLTS/66mxlM6DEMaZjIAYsTef9iD70K1gnk kZn+9WfDTfVrdVROw8P20o11+lo7BornRwQcZaumiFF1h6YGOcXPbkkMSVQ6w+fu/qUy 0J1g== 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=jicuNX8MyR2qm/bAJiW5ZbV2IE5vfTz2MWnU1FkKpc4=; b=cDhsqJa/3WQmkJiCXUdj8m2gyOBu2J4+qJwhskl+FuTJjd2MkbZEFPhpvpwsBMwJoa QQvzVXJj6sy1xi7YLuXFXP+9nH+K/r8xrSZ/xq7L8pTDjhxMNMUQKRtJE5UtRtS1jPbY JBDenG4duOrU7DkzcpIc791+NcsrUUSOP1twWZp5QgAC5knJR2n6FXDt9IMZzj2Rafqe 3gMi9IxUNMu/HlhIwqaF9XlaCkvpaYKH6J1Fw0HYSSV0BRR8cTdxrCq1VaOVeIAZReGU 9TrDk85PLRTkHgNyOU5R5HDJrjI+o6cejN3oX2VdzNPr3Nx7tAXX2AtLUNQWHsutTXz/ iVmg== X-Gm-Message-State: AFqh2kpKTWcjm2settRMWH/hE+ipNplHIH/XinpcM1E0wc12idJp0ZvZ twCoV7jcBcA9RYsTUNOLks2Lx6tlIZ4= X-Google-Smtp-Source: AMrXdXujOEYyKd9M8BtyJ1RWfqz5O9G1MOwnRASUrYcmoXo6u7cAwEaNtwGCxwg/pQvIiy0XURBGxQ== X-Received: by 2002:a17:906:910:b0:7c0:f71b:8b3 with SMTP id i16-20020a170906091000b007c0f71b08b3mr13491532ejd.57.1672005576926; Sun, 25 Dec 2022 13:59:36 -0800 (PST) Received: from localhost.localdomain (42.93.115.87.dyn.plus.net. [87.115.93.42]) by smtp.gmail.com with ESMTPSA id k8-20020a17090632c800b007c0f2c4cdffsm4066487ejk.44.2022.12.25.13.59.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Dec 2022 13:59:36 -0800 (PST) From: Alex Kiernan To: openembedded-core@lists.openembedded.org Cc: Alex Kiernan Subject: [OE-Core][PATCH v4 07/11] rust: Merge .inc into .bb Date: Sun, 25 Dec 2022 21:59:17 +0000 Message-Id: <20221225215921.12868-8-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221225215921.12868-1-alex.kiernan@gmail.com> References: <20221225215921.12868-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 ; Sun, 25 Dec 2022 21:59:45 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/175002 Signed-off-by: Alex Kiernan --- (no changes since v1) meta/recipes-devtools/rust/rust-target.inc | 10 - meta/recipes-devtools/rust/rust.inc | 223 --------------------- meta/recipes-devtools/rust/rust_1.66.0.bb | 218 +++++++++++++++++++- 3 files changed, 217 insertions(+), 234 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 f58aa4644446..000000000000 --- a/meta/recipes-devtools/rust/rust.inc +++ /dev/null @@ -1,223 +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}" - -# Use at your own risk, accepted values are stable, beta and nightly -RUST_CHANNEL ?= "stable" -PV .= "${@bb.utils.contains('RUST_CHANNEL', 'stable', '', '-${RUST_CHANNEL}', d)}" - -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(d.expand("${RUST_CHANNEL}"))) - - # 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..5192ec2ee11a 100644 --- a/meta/recipes-devtools/rust/rust_1.66.0.bb +++ b/meta/recipes-devtools/rust/rust_1.66.0.bb @@ -1,4 +1,215 @@ -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" + +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" + +S = "${RUSTSRC}" + +# Use at your own risk, accepted values are stable, beta and nightly +RUST_CHANNEL ?= "stable" +PV .= "${@bb.utils.contains('RUST_CHANNEL', 'stable', '', '-${RUST_CHANNEL}', d)}" + +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(d.expand("${RUST_CHANNEL}"))) + + # 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" + require rust-source.inc require rust-snapshot.inc @@ -35,6 +246,10 @@ RDEPENDS:${PN}-tools-rustfmt = "${PN}" SUMMARY:${PN}-tools-clippy = "A collection of lints to catch common mistakes and improve your Rust code" SUMMARY:${PN}-tools-rustfmt = "A tool for formatting Rust code according to style guidelines" +do_install () { + rust_do_install +} + rust_do_install() { rust_runx install } @@ -87,3 +302,4 @@ RUSTLIB_DEP:class-nativesdk = "" # musl builds include libunwind.a INSANE_SKIP:${PN} = "staticdev" +BBCLASSEXTEND = "native nativesdk" From patchwork Sun Dec 25 21:59:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Kiernan X-Patchwork-Id: 17196 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 D1738C53210 for ; Sun, 25 Dec 2022 21:59:45 +0000 (UTC) Received: from mail-ed1-f51.google.com (mail-ed1-f51.google.com [209.85.208.51]) by mx.groups.io with SMTP id smtpd.web10.125286.1672005579800743319 for ; Sun, 25 Dec 2022 13:59:40 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ocRRTnVG; spf=pass (domain: gmail.com, ip: 209.85.208.51, mailfrom: alex.kiernan@gmail.com) Received: by mail-ed1-f51.google.com with SMTP id s5so13713756edc.12 for ; Sun, 25 Dec 2022 13:59:39 -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=X3GtQyc6Lh4Tw4j3SINGoIg2WE4+LTNpiZIRU9HoB0U=; b=ocRRTnVGPqKvaigzkpodgNeh52IRK3apGLRNyXr0d+KehWsBLw+ymXa0mPDnDRyzc/ 3XhZXlukpAs1MU07T8m3YQK8ibH/qvLEAZruxKbno1prV5Y5Hr8YPiTAeQJUzkqwWwcr M0cS0B8ybXKnrncmddKhH8Zv8rqoqc0r9FOVZSmT4FP33DWmG0/7ws8T+h1EPSwERXOp vxxsPzXvUmHRwZZ8DUARLDPa7vbADQJm9L0xfB2f3juytdiTN+Trkhi+9KuPs6+TM97L L6e0qjz5BBNcg+bQjJuPxYphYXQvb0pqBzEgjHIU8W1Pk97YZd0sv5nKIc3/cRKHjSYY yoxQ== 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=X3GtQyc6Lh4Tw4j3SINGoIg2WE4+LTNpiZIRU9HoB0U=; b=v3bfGCTwgt70OQ6qervjinBvrmft03I6O5YLyq9jgGbQrPwDsH9cr3GdTRUzYkwXTM 5IHo39A/8G/g81Y9nTJ0ZmuLuev8/rLy0KNfaDmwji/Gjr1iFCPcLYEScPc2Yoz31NpV AYOmCbELClvnYbAGA56V0MhrluqC7RsXscSV+jI0olzmguaHJPCyYYX5I8ZHgfotfc9T zR+IMyGZEY6namTxf+MQYlNFVyPuMmTRiv6U+cxdtu7fZagBj++QPUxEcbti1i5U4xfI W99O0cuiefVx5uRH9Y/gStloFzKS1NZfgBQ1aGBzzbuS1Kx48FTKUI8V7pDDO5a4E/zs wHaA== X-Gm-Message-State: AFqh2ko5baVOg+uJldCntp9NGp3pRw4il/EpTuz1QtqyAYpZ5IG1Mi5Y lPx/vATgsr5KrViPVOKwiTCdPxnAfPI= X-Google-Smtp-Source: AMrXdXvWx5DHSQ/mTDWaMfpoKzSr7cGWaX5IBFwl9lAQZWEaMnLxOQy6c1C/kkfrE3MjuEaoolSsqQ== X-Received: by 2002:aa7:da42:0:b0:46c:2034:f481 with SMTP id w2-20020aa7da42000000b0046c2034f481mr16917805eds.8.1672005578110; Sun, 25 Dec 2022 13:59:38 -0800 (PST) Received: from localhost.localdomain (42.93.115.87.dyn.plus.net. [87.115.93.42]) by smtp.gmail.com with ESMTPSA id k8-20020a17090632c800b007c0f2c4cdffsm4066487ejk.44.2022.12.25.13.59.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Dec 2022 13:59:37 -0800 (PST) From: Alex Kiernan To: openembedded-core@lists.openembedded.org Cc: Alex Kiernan Subject: [OE-Core][PATCH v4 08/11] rust: Move musl-x86 fix for `__stack_chk_fail_local` to rust-source Date: Sun, 25 Dec 2022 21:59:18 +0000 Message-Id: <20221225215921.12868-9-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221225215921.12868-1-alex.kiernan@gmail.com> References: <20221225215921.12868-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 ; Sun, 25 Dec 2022 21:59:45 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/175003 Any consumer of rust-source (potentially) needs this, so move to rust-source.inc Signed-off-by: Alex Kiernan --- Changes in v4: - Fixup `__stack_chk_fail_local` in musl-x86 meta/recipes-devtools/rust/rust-source.inc | 5 +++++ meta/recipes-devtools/rust/rust_1.66.0.bb | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/meta/recipes-devtools/rust/rust-source.inc b/meta/recipes-devtools/rust/rust-source.inc index 91a6c5a942ae..b63e18ac95d2 100644 --- a/meta/recipes-devtools/rust/rust-source.inc +++ b/meta/recipes-devtools/rust/rust-source.inc @@ -11,3 +11,8 @@ RUSTSRC = "${WORKDIR}/rustc-${RUST_VERSION}-src" UPSTREAM_CHECK_URI = "https://forge.rust-lang.org/infra/other-installation-methods.html" UPSTREAM_CHECK_REGEX = "rustc-(?P\d+(\.\d+)+)-src" + +# 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 +WRAPPER_TARGET_EXTRALD:libc-musl = "-lssp_nonshared" diff --git a/meta/recipes-devtools/rust/rust_1.66.0.bb b/meta/recipes-devtools/rust/rust_1.66.0.bb index 5192ec2ee11a..f1ec769aef48 100644 --- a/meta/recipes-devtools/rust/rust_1.66.0.bb +++ b/meta/recipes-devtools/rust/rust_1.66.0.bb @@ -292,11 +292,6 @@ rust_do_install:class-target() { rm ${D}${libdir}/rustlib/manifest* } -# 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 -WRAPPER_TARGET_EXTRALD:libc-musl = "-lssp_nonshared" - RUSTLIB_DEP:class-nativesdk = "" # musl builds include libunwind.a From patchwork Sun Dec 25 21:59:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Kiernan X-Patchwork-Id: 17201 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 CFBD7C4708E for ; Sun, 25 Dec 2022 21:59:45 +0000 (UTC) Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) by mx.groups.io with SMTP id smtpd.web10.125288.1672005580638220504 for ; Sun, 25 Dec 2022 13:59:40 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=fqb3A8Xb; spf=pass (domain: gmail.com, ip: 209.85.218.51, mailfrom: alex.kiernan@gmail.com) Received: by mail-ej1-f51.google.com with SMTP id gh17so23132434ejb.6 for ; Sun, 25 Dec 2022 13:59:40 -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=ydjd8apOladjbMCkBG6Vh0G00Xo1OoUMx8ZzeWdbVWI=; b=fqb3A8XbMfZKJ0oLE6tmbvK80JyUEVTwW4TZNKHdIqBHzr5vu/BAs+BHxK4VQE7kLJ 3X0TbXz17g+Yp81X540hO5k3bX8thELBeznAwCe6emUnyTzTTzuMkgdSlHFljuCUa/1Z yMWDBG136pBROyL4FmuY/QRr7T5rsvCJV9mU+N+hqBTmF4DY8n3NaIbIqH7jVdE7I9YJ RCufKskVXLhj6nQu6PGPfFbl/8BNwdeWwpqPl5i2lXODRLchWZhNwByruugPkrEtjivu f9Z7UdDLEoSFVgQprGbzHYqAFKD/QcMUqoJqfKGkZrOfT8l/3UClRtd+ldAaIe0IMKmn 3xPg== 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=ydjd8apOladjbMCkBG6Vh0G00Xo1OoUMx8ZzeWdbVWI=; b=3grhgWI21j6V52QQqKNvs/OzYP4PobomOtUoFTk4XUi41kwuUNVfjKqxxAW9XTfLuI 8DMOcyfclAeQQmdKfX2wVGjQGCzh3c6J6094NImF57OsbXaoFu00ktyETLKM/AlT55F0 ZEWKUywf7k79WsADWNJFyYXM/8SAdTW3igsN8Hr64WaDqZtcNgyoJPSOtbbR0cp6J4XW hybfyWPRRrbAdfbVI5yUZeUnXToiqivchenmfoN7RKCPfmShz94eVRsgbABzC+VC7SgX t53Y5e7saRkKuzT3nQ7SE54IMbgwriGM3eBK+YMVD9PR1PWsqngUXU8SXj+upLHxG5/r SwoQ== X-Gm-Message-State: AFqh2kooUTcI+dxnFZtdtveIeJB+nYZD2iHvGrHcHVbKGIgCp6gJn5lK fHvFUCYsUqPLfGC+27lihmL1QE1+DxY= X-Google-Smtp-Source: AMrXdXvbj94T8AS9pAZGwD9kkC2AX99Up3Z7q77rc0hTzF8miCQD2clwCNN0riYTFR5wlivyc8X2BQ== X-Received: by 2002:a17:907:a782:b0:7c1:6430:e5d0 with SMTP id vx2-20020a170907a78200b007c16430e5d0mr14233042ejc.4.1672005578993; Sun, 25 Dec 2022 13:59:38 -0800 (PST) Received: from localhost.localdomain (42.93.115.87.dyn.plus.net. [87.115.93.42]) by smtp.gmail.com with ESMTPSA id k8-20020a17090632c800b007c0f2c4cdffsm4066487ejk.44.2022.12.25.13.59.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Dec 2022 13:59:38 -0800 (PST) From: Alex Kiernan To: openembedded-core@lists.openembedded.org Cc: Alex Kiernan Subject: [OE-Core][PATCH v4 09/11] cargo: Override crossbeam-utils with 0.8.14 Date: Sun, 25 Dec 2022 21:59:19 +0000 Message-Id: <20221225215921.12868-10-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221225215921.12868-1-alex.kiernan@gmail.com> References: <20221225215921.12868-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 ; Sun, 25 Dec 2022 21:59:45 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/175004 Use cargo patching to replace crossbeam-utils with the semver compatible 0.8.14 rather than trying to patch our local changes. This corrects the ppc/mips builds. Signed-off-by: Alex Kiernan --- Changes in v4: - Add crossbeam atomics fixes for ppc/mips meta/recipes-devtools/cargo/cargo_1.66.0.bb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/meta/recipes-devtools/cargo/cargo_1.66.0.bb b/meta/recipes-devtools/cargo/cargo_1.66.0.bb index fe8049b68c9b..909651b9efdd 100644 --- a/meta/recipes-devtools/cargo/cargo_1.66.0.bb +++ b/meta/recipes-devtools/cargo/cargo_1.66.0.bb @@ -14,6 +14,13 @@ LIC_FILES_CHKSUM = " \ require recipes-devtools/rust/rust-source.inc require recipes-devtools/rust/rust-snapshot.inc +# Reuse the path override capability we have to patch in a later version +# of crossbeam-utils which has the vendor misdetection fixes +# (https://github.com/crossbeam-rs/crossbeam/pull/922). This should be +# removed once the upstream source merges the change to include it. +SRC_URI:append:class-target = " crate://crates.io/crossbeam-utils/0.8.14" +EXTRA_OECARGO_PATHS:class-target = "${CARGO_HOME}/bitbake/crossbeam-utils-0.8.14" + S = "${RUSTSRC}/src/tools/cargo" CARGO_VENDORING_DIRECTORY = "${RUSTSRC}/vendor" EXCLUDE_FROM_WORLD = "1" From patchwork Sun Dec 25 21:59:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Kiernan X-Patchwork-Id: 17195 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 C314AC3DA7A for ; Sun, 25 Dec 2022 21:59:45 +0000 (UTC) Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.44]) by mx.groups.io with SMTP id smtpd.web11.126061.1672005581919184740 for ; Sun, 25 Dec 2022 13:59:42 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=AOPrJ5B+; spf=pass (domain: gmail.com, ip: 209.85.218.44, mailfrom: alex.kiernan@gmail.com) Received: by mail-ej1-f44.google.com with SMTP id fc4so23037506ejc.12 for ; Sun, 25 Dec 2022 13:59:41 -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=GzPYvHH0H6FWllOARL90mGJTxxCwr18B2lHzq+Q9z88=; b=AOPrJ5B+xbSjJg+NShkeKGAh/6M8c7WCFJvfJ6kkBH7yrNXDLAe0qDK3yL9JfKZ0dV 5wHVGY+RtPnQT5999yctxHAo8lbk0iLSgXKfOd8cZ5DGfM/DsvbrkM6Vv73rcKpdatY+ bGOa4BF/UWprAPAQweG03BlNObbpPEqjqVFb0tMi9bMN/tlWvAWUmXPNuxged59Teym+ fm+svrOrpDiLmuaRZ7+EtAyJPy6l0HP4dApZjU9ucHVDEuPGrqUAjw/11tgJLJuuU8W9 LP5aqPwQ4JXQlzfGnWx2CVYKvuZxYql8jFWK+ByUnSi8tXnUDiZeJ+rxI5EgZg+X3teD 1e1w== 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=GzPYvHH0H6FWllOARL90mGJTxxCwr18B2lHzq+Q9z88=; b=xd++/sDUQIJpfrDAliKqcVy9VSTV6f0zk+QImxvpsSUT/ZaskZVrjcQ/cFYt5TbtiK xdVw40Lzro5MfATrBW/qKULfbPxbfdWHZiMXv9JIj2IIEMagvTl+8Pk7Mri+802dz6do fzzrjbGq5VPQVmk4CJ/Na0WhSA8dF5pGvO6gy3nCLKKrgGsqjQMQ73HCDcbbNSv455Kp UxAbxWm8Mj947RVeDFMNn5ZCMLgOFD6dCkPvePeHI5e+8O7mehWi7GOeH198KGsOzjJg YlKZLjMmQXWCGjxfi+5F7x9z/2Jl4OL8RrsOIJHlATLhuivaJsRTT3fGu1Udf+eSQeNK jWdQ== X-Gm-Message-State: AFqh2kqZh8JEKbAMdxA6jN8ZbaXXwfX1VPUy+OBErZIRrXGi1jOAK22S DCVzOFvCUR8bTWKJz3M/Hl8/GiFxSbg= X-Google-Smtp-Source: AMrXdXuu5VyD5cMb1OIJf8VFmCWzj480BNA9nmMd82MBqIEy16MuWZkFtOewL8QcPJ8wdWxSktHE6Q== X-Received: by 2002:a17:906:99d1:b0:7c1:12ef:bf52 with SMTP id s17-20020a17090699d100b007c112efbf52mr12642084ejn.3.1672005580184; Sun, 25 Dec 2022 13:59:40 -0800 (PST) Received: from localhost.localdomain (42.93.115.87.dyn.plus.net. [87.115.93.42]) by smtp.gmail.com with ESMTPSA id k8-20020a17090632c800b007c0f2c4cdffsm4066487ejk.44.2022.12.25.13.59.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Dec 2022 13:59:39 -0800 (PST) From: Alex Kiernan To: openembedded-core@lists.openembedded.org Cc: Alex Kiernan Subject: [OE-Core][PATCH v4 10/11] packagegroup-rust-sdk-target: Add cargo Date: Sun, 25 Dec 2022 21:59:20 +0000 Message-Id: <20221225215921.12868-11-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221225215921.12868-1-alex.kiernan@gmail.com> References: <20221225215921.12868-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 ; Sun, 25 Dec 2022 21:59:45 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/175005 Signed-off-by: Alex Kiernan --- (no changes since v1) meta/recipes-core/packagegroups/packagegroup-rust-sdk-target.bb | 1 + 1 file changed, 1 insertion(+) diff --git a/meta/recipes-core/packagegroups/packagegroup-rust-sdk-target.bb b/meta/recipes-core/packagegroups/packagegroup-rust-sdk-target.bb index 334b24900b4b..59874c4c2c81 100644 --- a/meta/recipes-core/packagegroups/packagegroup-rust-sdk-target.bb +++ b/meta/recipes-core/packagegroups/packagegroup-rust-sdk-target.bb @@ -10,4 +10,5 @@ inherit packagegroup RDEPENDS:${PN} = " \ rust \ + cargo \ " From patchwork Sun Dec 25 21:59:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Kiernan X-Patchwork-Id: 17197 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 C717AC4708D for ; Sun, 25 Dec 2022 21:59:45 +0000 (UTC) Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) by mx.groups.io with SMTP id smtpd.web11.126062.1672005582877211654 for ; Sun, 25 Dec 2022 13:59:43 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=V3SLDNGo; spf=pass (domain: gmail.com, ip: 209.85.218.42, mailfrom: alex.kiernan@gmail.com) Received: by mail-ej1-f42.google.com with SMTP id jo4so23096013ejb.7 for ; Sun, 25 Dec 2022 13:59:42 -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=i8NxucXV6rn0spdM+T2O1RQX0uQD3s/Ct+shKCIlKQ4=; b=V3SLDNGouhKUv7a25YpBYCgtzowm5KWVAFO6aV8jZQMoUWd6jaQzfmuDr3GfcF1uK/ +5eMDMNPf3l16+2h6hfv11jx+ZYdEEEv4BT7WgN/8GFnXoU8K9oJM2ByJvToPF7GReqx w5G7kJCduzxq+CRnDuuJBA/cZ0cEZCl0jNZ5SYgrtSR73ScbIxIzEy7Feq4mXCSIETdh nRJ8YBrMyjQxLKrCs2u8xljZbQeD3oOQ7EfutT4l+CcV8m12v5stl6496pIpGS4V3gWm Pr1EkaKR60a7B3z/OhcL04VEivpx//qgqFRSP+0/6tdVbTJ0T3FPZO8vABdkSQ13eYtQ k1vQ== 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=i8NxucXV6rn0spdM+T2O1RQX0uQD3s/Ct+shKCIlKQ4=; b=z9aPVcovnyq15WpCMDI52hf0265mOjxSAc0vi3vbv5+6D7jah2Z5x2TFN3AsAWMQ+v WInVuWYDuQFsaUm3ZiiaBOfrcZxM2fp3HlcBn+u28EOsBdQdUU4cop0CkKGDXspTfpRe e0MEldU58au7b7ViIsNhhfe3lWTqIGUztZxcNkRirPXN2DCAJlMrsOPF/BElM5HJi2sW xE8HolbLnQiUFMG6d9giL5suupju8ar5vtPK7ZROKXHBo26WMvyoYj3YpHIBYHQ+al3t 2dVXfontg2zXGVVwqxnMQ6LB+Nq49HhAqU8qa+817HP3ua+owEpfthjdkFuz7t9Jw7TV ag3A== X-Gm-Message-State: AFqh2kqkq3q0JL2JvyTCeEqJvWam8DdVC7XbWDVXFbyQfTmlJBmnxJ2R 4rLM6Y/+2A2Pedmoo0dB+Xidg1NjFIU= X-Google-Smtp-Source: AMrXdXv00l9Fi92CNSvm9hnx7KY/K1ec7WndHBYUgAluiR+4Go7T34e/a23BixtuPcazr/jBETk6JA== X-Received: by 2002:a17:907:3907:b0:840:db38:bf23 with SMTP id so7-20020a170907390700b00840db38bf23mr12173450ejc.26.1672005581189; Sun, 25 Dec 2022 13:59:41 -0800 (PST) Received: from localhost.localdomain (42.93.115.87.dyn.plus.net. [87.115.93.42]) by smtp.gmail.com with ESMTPSA id k8-20020a17090632c800b007c0f2c4cdffsm4066487ejk.44.2022.12.25.13.59.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Dec 2022 13:59:40 -0800 (PST) From: Alex Kiernan To: openembedded-core@lists.openembedded.org Cc: Alex Kiernan Subject: [OE-Core][PATCH v4 11/11] oeqa/runtime/rust: Add cargo test Date: Sun, 25 Dec 2022 21:59:21 +0000 Message-Id: <20221225215921.12868-12-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221225215921.12868-1-alex.kiernan@gmail.com> References: <20221225215921.12868-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 ; Sun, 25 Dec 2022 21:59:45 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/175006 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..c9c60e16fd2b 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('cargo run --manifest-path=/tmp/hello/Cargo.toml') + 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'])