From patchwork Wed Dec 28 15:23:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Kiernan X-Patchwork-Id: 17302 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 73BC7C4708D for ; Wed, 28 Dec 2022 15:23:45 +0000 (UTC) Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) by mx.groups.io with SMTP id smtpd.web11.183662.1672241023868494311 for ; Wed, 28 Dec 2022 07:23:44 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=BtUJwyna; spf=pass (domain: gmail.com, ip: 209.85.221.45, mailfrom: alex.kiernan@gmail.com) Received: by mail-wr1-f45.google.com with SMTP id bk16so2004163wrb.11 for ; Wed, 28 Dec 2022 07:23:43 -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=BtUJwynaHf0RSX15QB8kwFU/DrbVet0A9HOTRoii/M9AWe3R0YUSuvz92bukzQ0Z6+ hVtMp+Fl5I0jl2PqzOLd9zQGMvI5NTeHQjYQSDkRJdCdq3OpuvonGGYV+dUGp4KXU5kN f8ZlOlK1yMVg/A5AptK8mQzismOKkgW6YlCvv2+GdgxEPrEQa6iYbQ4Kwk/YgyhQVY/d KuLS0c/+ywDsmQD48NbX/B2fVd7RtS5X/p6j4gQqYUJH5zWab1g1M+M9zr05XEcbfnuT T26zYv6wk9eK3HNbGvSyeXUC5QYrWQvT6vlWGoUUf0d6/5aqbKDDL6X72vaOHIr1GF7l OjfA== 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=zKLgwJI8h5u6OGpOkC4krc+wYxs4a0OUoQDAIYsg5QycX700DlpUQwlGPF3oI96Cb1 +UFw5y1PyDrZhhxTNu5Kv1QO9090kgUvxwMSNyaZLhmvHD7/3252/JpPjhmMG6Jh+zsy P0UHnS7lUsmSdrdR/qPsCtZ1JE8CVYKgcPomwJydInnklveVlQlEjdk11hrv8Rzre6fH gLb/mjsbmwJVlpiJl5JgEqmIoRm5dsdmWW1QtGmELA2W6rQ7FAh3SclIYUowAu8hhl2L IP6cQrn+j0X3pB3wanxkGr/XaODk+gHpHqCVAFvjmT5l1uq4aW+io1938uacp4lGttZu o0+w== X-Gm-Message-State: AFqh2koKiwIWoi/bstZ6UAfarVFj8ZLqoB6EQ8pT45ZNyrLdwdhB/qL+ edNTDjVN+b2Uo95wFrCIdWV27s72o2Y= X-Google-Smtp-Source: AMrXdXvdlRdIunSkUnwtBdnmhwz5GndvweJtENu9sexdGl47EFE19R41jG1dpHLBJcgaHw9LNhFsxg== X-Received: by 2002:a5d:4d0c:0:b0:280:4a9:c8e3 with SMTP id z12-20020a5d4d0c000000b0028004a9c8e3mr4925468wrt.20.1672241021954; Wed, 28 Dec 2022 07:23:41 -0800 (PST) Received: from localhost.localdomain (cust246-dsl91-135-6.idnet.net. [91.135.6.246]) by smtp.gmail.com with ESMTPSA id r17-20020adfdc91000000b0027973315213sm10884893wrj.89.2022.12.28.07.23.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Dec 2022 07:23:41 -0800 (PST) From: Alex Kiernan To: openembedded-core@lists.openembedded.org Cc: Alex Kiernan Subject: [OE-Core][PATCH v5 01/12] rust-llvm: Merge .inc into .bb Date: Wed, 28 Dec 2022 15:23:23 +0000 Message-Id: <20221228152334.25449-2-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221228152334.25449-1-alex.kiernan@gmail.com> References: <20221228152334.25449-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, 28 Dec 2022 15:23:45 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/175071 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 Wed Dec 28 15:23:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Kiernan X-Patchwork-Id: 17301 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 72B12C46467 for ; Wed, 28 Dec 2022 15:23:45 +0000 (UTC) Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) by mx.groups.io with SMTP id smtpd.web11.183664.1672241024884122970 for ; Wed, 28 Dec 2022 07:23:45 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=R0SMYReg; spf=pass (domain: gmail.com, ip: 209.85.221.45, mailfrom: alex.kiernan@gmail.com) Received: by mail-wr1-f45.google.com with SMTP id y16so15225046wrm.2 for ; Wed, 28 Dec 2022 07:23:44 -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=R0SMYRegxJ9qCFhlWUgJr7+nSURUNUSPvAEuirTKvU4U7b2IqC5/Q7QgFliOcfbmVL 078B5EuI5gPrz9ZmnctYDO6UXAJiC9NITTYHzT7IGM1jgVYBnbQpt256CNfl7tT0k1J8 bGkcnHBdfYmBq5Q9agqlK10RPgTva042+zxCKfrxEz8jokfa3388TvgZ1xzL6njB52Hz b3aPMi1/UmGzETnKikQYbrThsdR9g96VxiE9DlwJ88/+N38G6EfwnaKvoIzL55CwfFA3 D0F8qw591EBkO7QFc5/5tecZh1nb/2nYX9/LE717/3mHRH7jI2nRjd+EY5w4UIG5qI5E yOXA== 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=VNMttTHd90DxLtlX9SH9ytaxdvHSZHgT/Tgql5sBG4yYRT/JG+pAa/hzZ2ZSfLNCbU 3NuKNi0JzsWbPoQCttzo2/o6RdXJWffsFui2j3jy58aZiYnqYdbLw6DJ2rbS9X8D9eXN SqqueJofNPLDFfVu589HxK6Glx8EyzMx5Qz4SJ5uooEpUyUdyzkMoXNkJUg/UHOtNOxx yR3BiIY4EpymaS00XW1ypZVhweJ/IOh/afMVxnlE2D//PgBNw1eHaVFAY6hXS4bTmVug SMsXBi0SJp1mt7afgBHdCjuN45FHdlwhb1NVnBtOJptmzxMMC2D8NKKcuK/pfOv+FRbk qlSQ== X-Gm-Message-State: AFqh2kpPL0Z1NY3SZSH0e/hXLJDlAegDIwqyl2Q4nZ+eCW6ixNxuTyft mIaJfZ0vSW3CciO7rlx3LLqoaaKdEqQ= X-Google-Smtp-Source: AMrXdXt2rIw7Hi7KWXtUfJnM4tvDkokEiOAsYzxuXOdMeT0tF1Zk8w8HFswko8axBOljqJo8iSVlRQ== X-Received: by 2002:a5d:5587:0:b0:288:c07a:bac5 with SMTP id i7-20020a5d5587000000b00288c07abac5mr1324295wrv.49.1672241023221; Wed, 28 Dec 2022 07:23:43 -0800 (PST) Received: from localhost.localdomain (cust246-dsl91-135-6.idnet.net. [91.135.6.246]) by smtp.gmail.com with ESMTPSA id r17-20020adfdc91000000b0027973315213sm10884893wrj.89.2022.12.28.07.23.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Dec 2022 07:23:42 -0800 (PST) From: Alex Kiernan To: openembedded-core@lists.openembedded.org Cc: Alex Kiernan Subject: [OE-Core][PATCH v5 02/12] rust-llvm: Update LLVM_VERSION to match embedded version Date: Wed, 28 Dec 2022 15:23:24 +0000 Message-Id: <20221228152334.25449-3-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221228152334.25449-1-alex.kiernan@gmail.com> References: <20221228152334.25449-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, 28 Dec 2022 15:23:45 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/175072 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 28 15:23:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Kiernan X-Patchwork-Id: 17310 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 80DC8C54EBC for ; Wed, 28 Dec 2022 15:23:55 +0000 (UTC) Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) by mx.groups.io with SMTP id smtpd.web10.182564.1672241025954530333 for ; Wed, 28 Dec 2022 07:23:46 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=p+H62wbK; spf=pass (domain: gmail.com, ip: 209.85.128.51, mailfrom: alex.kiernan@gmail.com) Received: by mail-wm1-f51.google.com with SMTP id k26-20020a05600c1c9a00b003d972646a7dso8269968wms.5 for ; Wed, 28 Dec 2022 07:23:45 -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=p+H62wbKls5m9DcXuBghWTppVZd1+B4PV6yagl24gy2xcWAvt2aep6mdrV47b/i3Qo JaspEcuRAt6wqSqOhyp8Ewkjgv5SlqJ9iKa8qmeQOtDiFHiYoWxeSXKsgMr9j5Cv1RyY xOHkV33dJY5RxIOukMztSqiUjgIWy8PIvLe9Tp+Z4uFHLEF4GFDfUD9Zi1Vc5nWJhCX9 mYf9HkwIHTWiLGadU322sqTUZhVUU1qf0vIsaBWTd9/FyJrBENj493/bWETQQRdXS4tC tFHaVXPnD88c6ww8RnPA+gglJJX1b3ocySKlga4TdivmcJ2LqPX02NsCpbT1NEG9PHDD dYgg== 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=HpElt+xdJfjpV73Jctk4j3eDsWfs5aSZW0i/Tso+dd5vKi+qAirPkL65go3CZQroef DYSLcFDKyu68qrEwceP4av9nnMDQ04S0MfPoDz8/X2gQhDD4GUOpT/j3lHuBuQEkfvTH yKek0cydC31A18wu/egQcPRgYsnEAimzxn4hCpbmxwymS5ZqHLCn5ZSAJPcg7125HLum 2Vk+BCW+d0wqPsTUn081H5gbfRCdaMd2LJw9qC0uwbYA8kZjmIFl3Q3XFJ01Pe3EJIY8 +IV3gcxPa3ke5wNY0zVSjnFZuwDJ6VHFhfT8XS4MrBCDYVlJa7GNwfH10yh12ciYBmG8 hSRA== X-Gm-Message-State: AFqh2krY/An1rnzNBfK2RYu8oIjafBQfbBm3jI5O2m32TuZYu07qIvyR H3HoMKcblzePceN1efFlyIqRH2Of3Gw= X-Google-Smtp-Source: AMrXdXuDYTeCbH2Hw6zgQqmN/LT8s3NtZH0e/RTBfUdcUAXEqieJ6AbmqYwqDr0WNzO1zEButV3+fg== X-Received: by 2002:a05:600c:3ac3:b0:3d1:cfcb:7d19 with SMTP id d3-20020a05600c3ac300b003d1cfcb7d19mr22864495wms.32.1672241024173; Wed, 28 Dec 2022 07:23:44 -0800 (PST) Received: from localhost.localdomain (cust246-dsl91-135-6.idnet.net. [91.135.6.246]) by smtp.gmail.com with ESMTPSA id r17-20020adfdc91000000b0027973315213sm10884893wrj.89.2022.12.28.07.23.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Dec 2022 07:23:43 -0800 (PST) From: Alex Kiernan To: openembedded-core@lists.openembedded.org Cc: Alex Kiernan Subject: [OE-Core][PATCH v5 03/12] packagegroup-rust-sdk-target: Add Rust SDK target packagegroup Date: Wed, 28 Dec 2022 15:23:25 +0000 Message-Id: <20221228152334.25449-4-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221228152334.25449-1-alex.kiernan@gmail.com> References: <20221228152334.25449-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, 28 Dec 2022 15:23:55 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/175074 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 Wed Dec 28 15:23:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Kiernan X-Patchwork-Id: 17304 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 58A12C4708D for ; Wed, 28 Dec 2022 15:23:55 +0000 (UTC) Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) by mx.groups.io with SMTP id smtpd.web10.182560.1672241022601839846 for ; Wed, 28 Dec 2022 07:23:46 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ai4VzGUI; spf=pass (domain: gmail.com, ip: 209.85.221.44, mailfrom: alex.kiernan@gmail.com) Received: by mail-wr1-f44.google.com with SMTP id h16so15188577wrz.12 for ; Wed, 28 Dec 2022 07:23:45 -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=ai4VzGUI7mHfJmQbEiYyO4Wftj91Pd8CyzZcTy66ZyukX6UpTGVoTTWgkwgOQSuOyl QNWZMjbEf02h3wRumDtZukJJhooaBXUXXK0lYOaQMySg1b3FGJadIVl5qD8b4haLLHz8 icAk3N3LF8XeDEDthfy3bLD7XdCrG8O4wkyyjkvgX4hUVH0OrY8tUKEd2tGwXFqlk0c7 wpzKXO4+HbtmIYoo4vKuwdS05IYLMpwK5+vyMc9qnHSO9WX1Anel1eZQgukkYY0Idxu3 8aSjrqrbesVSWrnALx9D2qEbIueoEEjviK+9xw34zqhBhdhn54eNyA0dXdS2Ft24jhFT Qf1w== 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=rL6Edw7jPFKabYyljNF449nvjNKmF3E8CaRlWCnAZdn+1A46P730HOeEClBr1hVSPp Lr81CjVO4ljbysMOvPUiyjDvjQQK8uSkjdSIkPlkKNVu1PXXe+ahmjTSGXdI8hL0jOSj 0dqJRGIRVhXAp/6KEJie+yJkYr364OLpkZznbSwkamcGfwzZ0BPv75vDNnWkDZnN3AzW wGErkhkfvtv65jSgL/4A+Rel/ooe1LrdvHeXPuPoNOIG1rYYgBIxalOiiEmClhLnmc4h OLRVY+Mkq7UqcmhyiXLWTqiE/GETyFbEpFAuFGOQDHqGr2iJKvWGyWWbX68ViJrYuOx0 6KMA== X-Gm-Message-State: AFqh2krUGbQyr4JioAwutxBLnCVHYBMLr1coDk84XBVH23cdfksdDoKj FBJMTZMpUoHzWvjynNh/hNVy/rc0kM8= X-Google-Smtp-Source: AMrXdXuWD6xkFwsL6YEXNtvaA4i1kbNknWQQWaf1RnoXdo4SER37sKgfley00MsBOAz+6oiRICITPA== X-Received: by 2002:a05:6000:614:b0:242:17a6:8bad with SMTP id bn20-20020a056000061400b0024217a68badmr21197875wrb.60.1672241025212; Wed, 28 Dec 2022 07:23:45 -0800 (PST) Received: from localhost.localdomain (cust246-dsl91-135-6.idnet.net. [91.135.6.246]) by smtp.gmail.com with ESMTPSA id r17-20020adfdc91000000b0027973315213sm10884893wrj.89.2022.12.28.07.23.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Dec 2022 07:23:44 -0800 (PST) From: Alex Kiernan To: openembedded-core@lists.openembedded.org Cc: Alex Kiernan Subject: [OE-Core][PATCH v5 04/12] packagegroup-core-sdk: Add SDK toolchain language selection support Date: Wed, 28 Dec 2022 15:23:26 +0000 Message-Id: <20221228152334.25449-5-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221228152334.25449-1-alex.kiernan@gmail.com> References: <20221228152334.25449-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, 28 Dec 2022 15:23:55 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/175073 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 Wed Dec 28 15:23:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Kiernan X-Patchwork-Id: 17311 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 7CD83C54E76 for ; Wed, 28 Dec 2022 15:23:55 +0000 (UTC) Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) by mx.groups.io with SMTP id smtpd.web11.183665.1672241028396654704 for ; Wed, 28 Dec 2022 07:23:48 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=kelwfZe2; spf=pass (domain: gmail.com, ip: 209.85.221.42, mailfrom: alex.kiernan@gmail.com) Received: by mail-wr1-f42.google.com with SMTP id t15so6379351wro.9 for ; Wed, 28 Dec 2022 07:23:48 -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=kelwfZe2lHpwyQm/o7EShn8JDc0WKlwB9PEz6FWwi71vRajm2MrUPZ9cjO4EuOkd4H MCJaaCbQ8kYCF64yfSnZlHU6QLcN1C+sV39QzJ3g9QYPoJKfZMjDrBvFo58iw0sqarQz C9IO0fRmojWDG9kuabvxaQjG9jTuz38AjwBLf20cHdNhldtjK9qV+xu8TCmNbLtjDrMe nMc8P4umsiuG1mWL50kwluGg2nDk1ffvaosbSI1L/WLrC9BLCKON81LybUp/1aenWM3V 6N7T4qSaRHghQgKel+6EMuCLBH/Kit9ClK7DTc1RmNYfM0A27usBibCexyakboBkQyI5 w0cw== 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=XMpbxLiO+YJdwy8g+qHjicojB/n4CvJrrMAt+oPqXJe96yvmiAr2lHf709LtT//3VB 57S/+aB9svzwcrlHJLmbpl8jGMc/vnkQIqbSxbjC75mkbANlpQm71J6cNzVHT+6sE0il gfv6XYerOgIzQ7loxRCpr+c/QOTO5X/+9ulMKHfVQFthkHu86S4IBQuqF6cSKvbyYWQD nXMBBLSCD5+Qkl96REUaEjc7ZU11FsXCm1ZLoQqUjgWKVAGHOdYZLwH095jJnO+wDW96 tA3XIfZSfJryRr+eE3Q/Dgz4d1ytAe2DC6hN0g8ZRJhHaQaDNAhjFRkJGSCb7ICAOn0N VNpA== X-Gm-Message-State: AFqh2ko6pErwjdN2R+bCPRm0GEHh/RnXhnYOe6pyGUp7jxCR29aPbMTk 2f8DZypKn9TKYDzHfX3ncZi7sgxLF8E= X-Google-Smtp-Source: AMrXdXsrSTEGXRYKR0NAXUEz+FyJ/BujjK7EDsva7oJ8BBVoxZ635jsEnI3hupnfEjrWpruL6fyHBw== X-Received: by 2002:a05:6000:1a47:b0:242:78e5:6c13 with SMTP id t7-20020a0560001a4700b0024278e56c13mr15864009wry.44.1672241026281; Wed, 28 Dec 2022 07:23:46 -0800 (PST) Received: from localhost.localdomain (cust246-dsl91-135-6.idnet.net. [91.135.6.246]) by smtp.gmail.com with ESMTPSA id r17-20020adfdc91000000b0027973315213sm10884893wrj.89.2022.12.28.07.23.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Dec 2022 07:23:45 -0800 (PST) From: Alex Kiernan To: openembedded-core@lists.openembedded.org Cc: Alex Kiernan Subject: [OE-Core][PATCH v5 05/12] rust: Merge .inc into .bb Date: Wed, 28 Dec 2022 15:23:27 +0000 Message-Id: <20221228152334.25449-6-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221228152334.25449-1-alex.kiernan@gmail.com> References: <20221228152334.25449-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, 28 Dec 2022 15:23:55 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/175075 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 Wed Dec 28 15:23:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Kiernan X-Patchwork-Id: 17309 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 798DEC46467 for ; Wed, 28 Dec 2022 15:23:55 +0000 (UTC) Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) by mx.groups.io with SMTP id smtpd.web10.182565.1672241029706140040 for ; Wed, 28 Dec 2022 07:23:50 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=jvett054; spf=pass (domain: gmail.com, ip: 209.85.221.46, mailfrom: alex.kiernan@gmail.com) Received: by mail-wr1-f46.google.com with SMTP id bx10so15245859wrb.0 for ; Wed, 28 Dec 2022 07:23:49 -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=hLrreCI8uETlO0TspB7vF7bRZZ8qnLMqJpMgy4myUzo=; b=jvett054/beOF5BsYT4fdADGbyT1Yn2M2e12IpCxRVxpLAIhQH1Uqrga8bcT9g+uon T9xTLnMiwhlJdl3oXp2NjzVzx80pDhgAQN5Olezkg8TBYvMWA+Y2ozfPY1ofjhUEpyr2 Ck9JBnRfZQO8x6O1soE+oxbiNxcf5Y+g7sUTRUbsPbTqhfqHk/o9FemINYeLiFQhvVif PYje8qodFX3S6ZSjvJkuVYBVw3qwV9DSiqa4rL+YYYaDAg+KEZ/QCle1r9yxgsG1ZAkD agUciKY/q5eddKom2EsHLU5Ma/K1m1/luc9271XI8eHWwHEYm5iDzsR7vIlFcwVRHOqR PcPg== 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=hLrreCI8uETlO0TspB7vF7bRZZ8qnLMqJpMgy4myUzo=; b=yWZv6g9Tvaex+NlbmpwEVtsXciooqLLggCVvOG8DM27Wl4cSnkgEemCBMQVu3kmXMX LRqUJ2MUEQASjRQVl6RZg4a1skLeguXU2rT2xwsiusp53SWf5u/pieaCG+nPWv2aKdzw TyOUCQnyxUlQFh8+NS9ih0nNJQYCnHah3g6YLxkrqOA5+cAe7Oh0LTUUPTf7GVfHvpCX HPTTFtxOUnXeS/xOoUpwT58BekyoRMt5BqamoKTj+7vWMRXiisU5BUyaSQ5wcwtQY3XO kh2jGkQXOG9DERZbn3cJIc7ASvhdALdJDhq3IfShShC/8T4VjQdfuFtsQn0abvmlZ6tm K6PA== X-Gm-Message-State: AFqh2kqoY7xtyvPr5Iho/mJBMfq2k6ITZB6pmaNrvtgUgdctqaqHxfAe 1I4uU8S5DtduI14lG/uo8pKom2f3tto= X-Google-Smtp-Source: AMrXdXstSYOT9ojfP4fu6xuUuA8L/I4OuRaBRD0SfT1qhFDQCAW2Mmg5NgT4vur190CIgZqKS0K8Sg== X-Received: by 2002:a05:6000:1812:b0:238:3d56:f061 with SMTP id m18-20020a056000181200b002383d56f061mr14352563wrh.63.1672241027986; Wed, 28 Dec 2022 07:23:47 -0800 (PST) Received: from localhost.localdomain (cust246-dsl91-135-6.idnet.net. [91.135.6.246]) by smtp.gmail.com with ESMTPSA id r17-20020adfdc91000000b0027973315213sm10884893wrj.89.2022.12.28.07.23.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Dec 2022 07:23:47 -0800 (PST) From: Alex Kiernan To: openembedded-core@lists.openembedded.org Cc: Alex Kiernan Subject: [OE-Core][PATCH v5 06/12] rust: Move musl-x86 fix for `__stack_chk_fail_local` to rust-source Date: Wed, 28 Dec 2022 15:23:28 +0000 Message-Id: <20221228152334.25449-7-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221228152334.25449-1-alex.kiernan@gmail.com> References: <20221228152334.25449-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, 28 Dec 2022 15:23:55 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/175076 Any consumer of rust-source (potentially) needs this, so move to rust-source.inc Signed-off-by: Alex Kiernan --- (no changes since v4) 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 Wed Dec 28 15:23:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Kiernan X-Patchwork-Id: 17305 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 66B89C53210 for ; Wed, 28 Dec 2022 15:23:55 +0000 (UTC) Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) by mx.groups.io with SMTP id smtpd.web10.182566.1672241030905317998 for ; Wed, 28 Dec 2022 07:23:51 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=mnnaz3tj; spf=pass (domain: gmail.com, ip: 209.85.221.43, mailfrom: alex.kiernan@gmail.com) Received: by mail-wr1-f43.google.com with SMTP id bx10so15245900wrb.0 for ; Wed, 28 Dec 2022 07:23:50 -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=mnnaz3tjJ7BeIpECrle7+7o8R0qXHl7fkecDOKp2afmgQOVpBBYgNxRwLrdp9Q73S5 WwKIe443hIS35RF1F2oRWYdNC7J7/oHz4P+4CIXfj9+0kPtgvb8MoXCc8dkZJarUPNU6 mNloF4K/Q9tKPaeVJ5J3SMSnZK8fsM6kbRFkdPsz4++TXNicnJWRMsOnWqPoSEfj5ktX zs/gjoggDLCc17umMOe1gz4x0pNEXVTn6M2HoMrxUwilQXM/levclmCzTxefqIzCopjA y8auAInphP+gbEmBpBFMb8VVyVFM435WYbzPkLuBTTcwXdhM2dpq0zsGpeD02eDCZvFX jHRw== 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=gIbeSjfO7+9HGGDZhoPIfOoriAN9ImUig5oJpW4/8MX7EBDiEl9dvzNBtj2p2FvVVV FD2I3Q6kl2Ne5Sk3GrLlLEk1TVdPTiHAN0N2rCIGCOFekL0f6vSYjdzuGC7w/X8oeu/9 BdeDzJLbHbjWXfjSWBZnJsN/cR6th6EWDWwWuHyPzO3QFW0vVf2NsbzTIxpMGMAybemE YydYG1ZjKPurSO1x9JJ1H/5B6dfNZwQ3SuoTUkTfXl9zfIzE0BXTDkVEs22fVWd/RkBQ cZCKNtp6/iGlYf137+TEL+RXzv9jYolZkbSEhR0sV+s/jfLgyRqCE+GpARhAmPk8bRzc xZtA== X-Gm-Message-State: AFqh2kqCcNy6eDJKFrDHNXPqQbvcykWDDCO/UYwMkfmimSTonr9uJRxK 1sANLcKAj8xO4kw/22+VE3v0xy4Xn0o= X-Google-Smtp-Source: AMrXdXuVney7FKjwLOyWI0S1m10P6oPoBs6mFxMYDgx2cB0xvFmPzjblkzr8N01z5VMXltEYG/s2Yg== X-Received: by 2002:a5d:44cf:0:b0:236:c62f:eb70 with SMTP id z15-20020a5d44cf000000b00236c62feb70mr13836397wrr.13.1672241029168; Wed, 28 Dec 2022 07:23:49 -0800 (PST) Received: from localhost.localdomain (cust246-dsl91-135-6.idnet.net. [91.135.6.246]) by smtp.gmail.com with ESMTPSA id r17-20020adfdc91000000b0027973315213sm10884893wrj.89.2022.12.28.07.23.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Dec 2022 07:23:48 -0800 (PST) From: Alex Kiernan To: openembedded-core@lists.openembedded.org Cc: Alex Kiernan Subject: [OE-Core][PATCH v5 07/12] cargo: Merge .inc into .bb Date: Wed, 28 Dec 2022 15:23:29 +0000 Message-Id: <20221228152334.25449-8-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221228152334.25449-1-alex.kiernan@gmail.com> References: <20221228152334.25449-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, 28 Dec 2022 15:23:55 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/175077 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 28 15:23:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Kiernan X-Patchwork-Id: 17307 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 68D09C5479D for ; Wed, 28 Dec 2022 15:23:55 +0000 (UTC) Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) by mx.groups.io with SMTP id smtpd.web10.182567.1672241031884907521 for ; Wed, 28 Dec 2022 07:23:52 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=RmOmFbtJ; spf=pass (domain: gmail.com, ip: 209.85.221.50, mailfrom: alex.kiernan@gmail.com) Received: by mail-wr1-f50.google.com with SMTP id o5so15231332wrm.1 for ; Wed, 28 Dec 2022 07:23:51 -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=RmOmFbtJYhnJdDV5vHzzTgbCIA6c1nWoIk8wVZaul6ERGniSy+WaM00pDaDo0aleZJ MCJcoY+E57aBnRObtYJgW5cqadNWseTyn6xxZUJ3OW6Liz1UgFbjyV1l/LbAWEFMRT3M EYv41uM5AVpECzRsfsd47K0JqKSHxk5fCWhsb7Qg5ROc6PBGjBmrYvJciAwBEjW5i1V8 SSTaMB2N7UBnotkwEgS7FN1SwvOp3qCWxLA4KgOmscad/SYbkZmxvRcjHo4efwJu2zK5 tMPwjAFhU9Oot+mpppFnxYQ0u4ni9pevchufN8LnF9PWS442iZ/gfdEM1qUKknWe4236 gFOA== 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=nCsNdn5W4CELSDnA01mo9+Meo/XR3+Y2YbZ3E1Z9tXIAE/8RhrBcts0vMbDRWSEfV0 anFbqySW1zhel+sHcyJc8SRrATIzUmrmdxvzW7Gr4r8muklImG30LyWDQY2mSqzq6vO7 6fq2mJJGUGLemL7ktjNjpRbA2fC3ECxvqRUr/mRsZgLt+2wD0wce+rH78/8FjRYiB934 r31m/OsWG/X33F0lTmjsa6iC4QGFnky5MHhfktppGGRhDNCNU77GoOQ3uUQvzAZ1w2HZ eB2fziHOBvgCuUR9PHNnEHclis9vYFIH97Erv1IRWcxq3vh/CMKS/UHUCMKq3CMYdGl4 z7Iw== X-Gm-Message-State: AFqh2kpxKB2hsAjT6rWq52Ec3cLj0nqtsSjChBvmM0JSucbs6Jky2fFl KuZ/Zdi33TP8IkmBowMPkFKkjp4QS9Y= X-Google-Smtp-Source: AMrXdXsCYybCYBs7F1IsJr1N5v73XjsfNB4GbKEpfIj6MdFmXK5cm2zex+BelRv6IaH6LiLvTf4cUg== X-Received: by 2002:a5d:6a43:0:b0:242:13bf:29de with SMTP id t3-20020a5d6a43000000b0024213bf29demr15074722wrw.52.1672241030263; Wed, 28 Dec 2022 07:23:50 -0800 (PST) Received: from localhost.localdomain (cust246-dsl91-135-6.idnet.net. [91.135.6.246]) by smtp.gmail.com with ESMTPSA id r17-20020adfdc91000000b0027973315213sm10884893wrj.89.2022.12.28.07.23.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Dec 2022 07:23:49 -0800 (PST) From: Alex Kiernan To: openembedded-core@lists.openembedded.org Cc: Alex Kiernan Subject: [OE-Core][PATCH v5 08/12] cargo: Extend DEBUG_PREFIX_MAP to cover vendor Date: Wed, 28 Dec 2022 15:23:30 +0000 Message-Id: <20221228152334.25449-9-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221228152334.25449-1-alex.kiernan@gmail.com> References: <20221228152334.25449-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, 28 Dec 2022 15:23:55 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/175078 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 28 15:23:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Kiernan X-Patchwork-Id: 17306 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 668B5C3DA7D for ; Wed, 28 Dec 2022 15:23:55 +0000 (UTC) Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) by mx.groups.io with SMTP id smtpd.web10.182569.1672241033199044101 for ; Wed, 28 Dec 2022 07:23:53 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=DNB8bNJg; spf=pass (domain: gmail.com, ip: 209.85.221.46, mailfrom: alex.kiernan@gmail.com) Received: by mail-wr1-f46.google.com with SMTP id co23so15223539wrb.4 for ; Wed, 28 Dec 2022 07:23:52 -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=gkpzqQN9G/12Pfdyi6/oZup6uewsyCJTfSNd5kS3RJQ=; b=DNB8bNJgg5IpC846+6CPVOiKc2VYQIF3wYgshoct8gaUnriVl6Yf+AR3RvpI2ArO9T r86vuAIJbak4Tcp6FZNuDCxndazc3zzCwSsnbHMAd61dhRrKecrhtybjmnwEw7QhDgNY osQkuG5u5PkFhjrEXdTFD0HM97YiaA+BVKmqn97ylJ1Bi0JGXa6JTy749PG4m0TTr58Z UAEQviM8DmNN1mQbZDtuAO/vtCRLQkXqYq8DXL7eva+PWqQLVcW9LecLgzYf4eX4S4Tk 7tB3m7Fu1AwsMqDId6JR3VgDRuTBqmxBdBhlGptER6timH9CRne0xH9rZkVhfXS8fLj+ 4Ojw== 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=gkpzqQN9G/12Pfdyi6/oZup6uewsyCJTfSNd5kS3RJQ=; b=JuLcByqKC4/XMT0JvHV0HpquZCB0oO3Dh+/dmwndwe9znF+zyon7VSH3b17h92lvuu jLm+N9RIFMP10LzvAL8i8S+2AEjlsLclyv0un6cjT/fOpVVOYcmsCYQl/eK6xPtnjbXJ K6R18jJaLds15kUWShRI1NJk+AFHBTRYTLFRwtSQE2NHAhsZeifChAOyORvkeVFfM5pE CoPsY/MJMVMtcjtZqtMbx0ZsPPjTnaynBqpI6iSoZ/VaxIBRuF4XwcV771wufPPt9wBJ v2+RT9VCbGM5xCDSJFuBsc68GtTfEbosAkH/PK3Z1gCS9mc2cthLvimj5mg0p6X0tNar yZnw== X-Gm-Message-State: AFqh2krWtX9rvprZaJmkBOyLxNtHaUw2PW4mAeC7OlL57GmEex2goKTC iIgquMuA6t+XE6iWyMDNcxbkZe8Cldw= X-Google-Smtp-Source: AMrXdXtWi/Cf1eGSBGyPxLCAI4JDC2cdZ6jBIQZoekM0AgYAwkZS4ooaJqGKsGBijsUFSLeBDod3vg== X-Received: by 2002:a5d:5508:0:b0:242:865b:903a with SMTP id b8-20020a5d5508000000b00242865b903amr15932633wrv.17.1672241031409; Wed, 28 Dec 2022 07:23:51 -0800 (PST) Received: from localhost.localdomain (cust246-dsl91-135-6.idnet.net. [91.135.6.246]) by smtp.gmail.com with ESMTPSA id r17-20020adfdc91000000b0027973315213sm10884893wrj.89.2022.12.28.07.23.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Dec 2022 07:23:50 -0800 (PST) From: Alex Kiernan To: openembedded-core@lists.openembedded.org Cc: Alex Kiernan Subject: [OE-Core][PATCH v5 09/12] cargo: Include crossbeam-utils patch Date: Wed, 28 Dec 2022 15:23:31 +0000 Message-Id: <20221228152334.25449-10-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221228152334.25449-1-alex.kiernan@gmail.com> References: <20221228152334.25449-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, 28 Dec 2022 15:23:55 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/175079 We need patched crossbeam-utils in cargo as well as rust, move cargo alongside rust so they can both use the same patch. Signed-off-by: Alex Kiernan --- Changes in v5: - Switch from cargo patching to bitbake patching (https://github.com/rust-lang/rust/issues/98185) Changes in v4: - Add crossbeam atomics fixes for ppc/mips meta/recipes-devtools/{cargo => rust}/cargo_1.66.0.bb | 9 +++++++-- .../rust/{rust => files}/crossbeam_atomic.patch | 0 2 files changed, 7 insertions(+), 2 deletions(-) rename meta/recipes-devtools/{cargo => rust}/cargo_1.66.0.bb (93%) rename meta/recipes-devtools/rust/{rust => files}/crossbeam_atomic.patch (100%) diff --git a/meta/recipes-devtools/cargo/cargo_1.66.0.bb b/meta/recipes-devtools/rust/cargo_1.66.0.bb similarity index 93% rename from meta/recipes-devtools/cargo/cargo_1.66.0.bb rename to meta/recipes-devtools/rust/cargo_1.66.0.bb index fe8049b68c9b..f00c67bef5e5 100644 --- a/meta/recipes-devtools/cargo/cargo_1.66.0.bb +++ b/meta/recipes-devtools/rust/cargo_1.66.0.bb @@ -11,8 +11,13 @@ LIC_FILES_CHKSUM = " \ file://LICENSE-THIRD-PARTY;md5=f257ad009884cb88a3a87d6920e7180a \ " -require recipes-devtools/rust/rust-source.inc -require recipes-devtools/rust/rust-snapshot.inc +require rust-source.inc +require rust-snapshot.inc + +SRC_URI:append:class-target = " file://crossbeam_atomic.patch;patchdir=${RUSTSRC}" + +# Used by crossbeam_atomic.patch +export TARGET_VENDOR S = "${RUSTSRC}/src/tools/cargo" CARGO_VENDORING_DIRECTORY = "${RUSTSRC}/vendor" diff --git a/meta/recipes-devtools/rust/rust/crossbeam_atomic.patch b/meta/recipes-devtools/rust/files/crossbeam_atomic.patch similarity index 100% rename from meta/recipes-devtools/rust/rust/crossbeam_atomic.patch rename to meta/recipes-devtools/rust/files/crossbeam_atomic.patch From patchwork Wed Dec 28 15:23:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Kiernan X-Patchwork-Id: 17303 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 52A87C4167B for ; Wed, 28 Dec 2022 15:23:55 +0000 (UTC) Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) by mx.groups.io with SMTP id smtpd.web10.182567.1672241031884907521 for ; Wed, 28 Dec 2022 07:23:53 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=TNPfiCNz; spf=pass (domain: gmail.com, ip: 209.85.221.50, mailfrom: alex.kiernan@gmail.com) Received: by mail-wr1-f50.google.com with SMTP id o5so15231432wrm.1 for ; Wed, 28 Dec 2022 07:23:53 -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=oJq4XgxNyLcpxuGPxnxi9FqL+2Qk34NvP5k5mKawE3E=; b=TNPfiCNzz2ml+e/2r+GV7kMFl2SXRcXCzX8bpGaVHUAQ7Xd84jjfS2zy4et1Ske3dX aS1bqAgfg7ugqL53bE9/hKDtdWBN6k/tZiTakiVrsC6nODcYrYbtV199tk8ctJU4sXBS vqaE34HdQ0toR7Am/EjU21d2Za869YyqeE4g2j8zLD4w1PwVSq14zkqRgPKLO0ji6+Kd EqvFm1eh/DRxZ9ZIjB412ccHKmDXH139GgnwCCbh/M5aa032t2bgr/YWOZE0ECdJKjz8 EXRjmiQPRBZL19RhxzjbGP5JmK5vLMYbjpWrQyZIuVfr3IEE57U5DZtIloDQplog+Ch0 v5ng== 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=oJq4XgxNyLcpxuGPxnxi9FqL+2Qk34NvP5k5mKawE3E=; b=VsQPIzVj+0Pwp4eVJk3oo+ieExviS9xaaU0Zzy96+cXWdc72VMdgij7diplGEectMW lN3xAclGYfTQFm50at8NmvqEdf7c03qx6kAZcYIMZSVq2p7L0H57eSxEwMTRJf+nmGA2 /7kdGVWStPCLOZccsNpRhcjNTEHENv3uTqaM2ROLqdwWDS+o0BXX6e3CWz8CsaWfhr46 JhdnqGJjVGVoaLunQXzG6TLqberbCfSMALt2AqDS8Dcqrd3Tg34E5a9s8EANTyEvqVao Tu21JQEUrgaj4R5s7EwUt4GfN6YZtheHul6SWr/n2OkKH/x/1R/vbqez/YDXKpSyuWlS C6Jg== X-Gm-Message-State: AFqh2kpvqdTt23EQyUtAAoSdBQ+Vi9HqJGf3hM6Z9g10R809KLiVAsMq QjBMLEPAIlWDZ8EBix4sJE4c0uY+1vs= X-Google-Smtp-Source: AMrXdXtVgz9N427ebigk0/Ohqhv6Et4YT7cLktZzz8ZZU4aAh+VrPgx29VpZ8qtq8sQTyOutB19hgw== X-Received: by 2002:adf:f781:0:b0:242:1ba0:208b with SMTP id q1-20020adff781000000b002421ba0208bmr20519350wrp.64.1672241032756; Wed, 28 Dec 2022 07:23:52 -0800 (PST) Received: from localhost.localdomain (cust246-dsl91-135-6.idnet.net. [91.135.6.246]) by smtp.gmail.com with ESMTPSA id r17-20020adfdc91000000b0027973315213sm10884893wrj.89.2022.12.28.07.23.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Dec 2022 07:23:52 -0800 (PST) From: Alex Kiernan To: openembedded-core@lists.openembedded.org Cc: Alex Kiernan Subject: [OE-Core][PATCH v5 10/12] cargo: Drop exclude from world Date: Wed, 28 Dec 2022 15:23:32 +0000 Message-Id: <20221228152334.25449-11-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221228152334.25449-1-alex.kiernan@gmail.com> References: <20221228152334.25449-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, 28 Dec 2022 15:23:55 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/175080 On-target cargo now builds/runs. Signed-off-by: Alex Kiernan --- (no changes since v1) meta/recipes-devtools/rust/cargo_1.66.0.bb | 1 - 1 file changed, 1 deletion(-) diff --git a/meta/recipes-devtools/rust/cargo_1.66.0.bb b/meta/recipes-devtools/rust/cargo_1.66.0.bb index f00c67bef5e5..37e0123ee3d0 100644 --- a/meta/recipes-devtools/rust/cargo_1.66.0.bb +++ b/meta/recipes-devtools/rust/cargo_1.66.0.bb @@ -21,7 +21,6 @@ export TARGET_VENDOR S = "${RUSTSRC}/src/tools/cargo" CARGO_VENDORING_DIRECTORY = "${RUSTSRC}/vendor" -EXCLUDE_FROM_WORLD = "1" inherit cargo pkgconfig From patchwork Wed Dec 28 15:23:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Kiernan X-Patchwork-Id: 17308 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 59B8DC3DA7A for ; Wed, 28 Dec 2022 15:23:55 +0000 (UTC) Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) by mx.groups.io with SMTP id smtpd.web10.182565.1672241029706140040 for ; Wed, 28 Dec 2022 07:23:54 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=lGIX+RX+; spf=pass (domain: gmail.com, ip: 209.85.221.46, mailfrom: alex.kiernan@gmail.com) Received: by mail-wr1-f46.google.com with SMTP id bx10so15246066wrb.0 for ; Wed, 28 Dec 2022 07:23:54 -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=lGIX+RX+5VvNzCTdUn1MUiJh3MBPkGW3CbBofDrBhjEVcZSlU2fR/p9sJra/Dvqu2h Vs7Ams4bYPM7uENKEm5x1m4OAVDOx+Hn/uVG7FUgEbTMl9fLmi2eR1pBJFskJzlm7u5h 0YST7CG2mtFDnk49XYpFK+FFBmBVt1uSXIJaeLi+WRDrJD2hbL6ZniaW3dgrOYKiWoPQ rNyudYiM7F8kE7PjIBq7kB5z5MrnoObzwJl1nUO8zD982lm4Mt9Zbx1FwfPXyU1lGIaD Mhb9ykbKfqYlCcdI1R4mE5FtTLyiUzoN9aoSB/MuFpFJ+slMIxMq5rwnPcT22MlO+OhD tkrg== 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=H0NlAiGhhn9JHMd17gpWH0sVyB5ILiNwe3j+Azc4OtEvsHr8vV20OGDUQMf2cfkwLp hMVAf8ConGZ3gALds7Ckc/A1JyI88HtlBUwCB/2q2JxhzrN3/1dYYxrF7Y2W/yNKs7sl rLaQwLaSxBobNVs9Mm+LQtdDO1oTlZIEdhq/RrFoyiYNgrDfXHM01hdILluP4qOvdez7 txVZ+f1a7Sr72HX2rjxGClQVH7gF6JEK98VD44TVRHJoHUwVwhnfSlMG8hgfbhgPqa1U mrZFyn97+Wz5gEk6W9gG5sDGE3Tz5qg8UfT483K3RnpAYrNdn5OQ/ZEjIsys4Y8KyxBK /UUg== X-Gm-Message-State: AFqh2koyNe2J//KOaXnApLdSFUvsa+sIb/25FRrYx6SZvTjIgBWqxU8s Q250XtMEkKUg+CcVuZWRVwjBl3UZjwA= X-Google-Smtp-Source: AMrXdXvbPWw2GKQ1aFWL4OrX+miNbMjSaQrynlCnTGz4JTfnuMaQmR3Gv9sQJ+AnbUY3gm6i6TVQdw== X-Received: by 2002:adf:ee06:0:b0:281:aec4:71b7 with SMTP id y6-20020adfee06000000b00281aec471b7mr5091770wrn.64.1672241033712; Wed, 28 Dec 2022 07:23:53 -0800 (PST) Received: from localhost.localdomain (cust246-dsl91-135-6.idnet.net. [91.135.6.246]) by smtp.gmail.com with ESMTPSA id r17-20020adfdc91000000b0027973315213sm10884893wrj.89.2022.12.28.07.23.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Dec 2022 07:23:53 -0800 (PST) From: Alex Kiernan To: openembedded-core@lists.openembedded.org Cc: Alex Kiernan Subject: [OE-Core][PATCH v5 11/12] packagegroup-rust-sdk-target: Add cargo Date: Wed, 28 Dec 2022 15:23:33 +0000 Message-Id: <20221228152334.25449-12-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221228152334.25449-1-alex.kiernan@gmail.com> References: <20221228152334.25449-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, 28 Dec 2022 15:23:55 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/175081 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 Wed Dec 28 15:23:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Kiernan X-Patchwork-Id: 17312 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 69443C3DA7A for ; Wed, 28 Dec 2022 15:24:05 +0000 (UTC) Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) by mx.groups.io with SMTP id smtpd.web10.182573.1672241036553355207 for ; Wed, 28 Dec 2022 07:23:56 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=XHsnGgHv; spf=pass (domain: gmail.com, ip: 209.85.221.53, mailfrom: alex.kiernan@gmail.com) Received: by mail-wr1-f53.google.com with SMTP id bs20so13114703wrb.3 for ; Wed, 28 Dec 2022 07:23:56 -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=XHsnGgHvzSFYn9PdTGcLXhVSPD2OP00KG5AivhdWG785pfcjwzwci9uHpkAIAeXKPO crI9H1fsjy4ZkGNf+KAkgu4GBGG5HS2jWvQ46aaoQbmS5+uxOAoMZ/S6rsZ+stfvcC4y +ujEY45TGJHIHj344K3TOiouC7oI/ZDnZvLC3CSGMN+o722VxLRaeX9UzjVNXNVn7lbL EwJXH9dayN130Vwv7xJGJxDgJzpLYb3pGOabjFkaF/9/2cgceNSBl1fnuKrJo+fSsUZ0 8lmVLHfquLTXgiV8GdBT+clZwTXTUoAkLfbwLqXNAd89lw3jUzUxlevCij0Olbhwlq0V /XhQ== 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=hAMaQ+tr9utDHWswpxuu8gvlNP+qC7qDDS4DY3KpQMcXU93vXftBreAxB+P5TZovrD gkETIxFtH+Eq6DLD0Sn8CasS9xVEbMziz5BJWzw+4B55BL+EQ69pbqNYHARr7KDbgnf7 DI5zqhxw/4JwhQ7DXzgzjWl/S9N1xkA7DjwTXqXaLO9lwcMVylTNjwy4TjIsVJFYQkCT 1pwkE64HWYLzsXrRzdUSIyfR78rgnq+ATkJ+LGuXYSqloADqLo4WIVeI0v1ilJd9sL1z g7iffHF0jpJ4B3sT8Lc7mEWMuMFWQrxQroZEqEo1Wmjorj7JKs/5Sr2xNUfq6L5EeF63 vrfA== X-Gm-Message-State: AFqh2kqUWIqx9ARvfaDWxENTg694gbpHKx4sxa3ZjRTWZF/tF1rmKJmc E7GxYlVMBnNY26ZYA0t/b7sWY8Uh49Q= X-Google-Smtp-Source: AMrXdXtRnhEQm5rAX9NgsXm1//gI/4lAz+C8LGAzDcOm2I4igt4d5hY5/ZGOv6iFC0Imq0Y1MkCNZw== X-Received: by 2002:adf:d084:0:b0:278:29ac:f894 with SMTP id y4-20020adfd084000000b0027829acf894mr8396124wrh.64.1672241034819; Wed, 28 Dec 2022 07:23:54 -0800 (PST) Received: from localhost.localdomain (cust246-dsl91-135-6.idnet.net. [91.135.6.246]) by smtp.gmail.com with ESMTPSA id r17-20020adfdc91000000b0027973315213sm10884893wrj.89.2022.12.28.07.23.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Dec 2022 07:23:54 -0800 (PST) From: Alex Kiernan To: openembedded-core@lists.openembedded.org Cc: Alex Kiernan Subject: [OE-Core][PATCH v5 12/12] oeqa/runtime/rust: Add cargo test Date: Wed, 28 Dec 2022 15:23:34 +0000 Message-Id: <20221228152334.25449-13-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221228152334.25449-1-alex.kiernan@gmail.com> References: <20221228152334.25449-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, 28 Dec 2022 15:24:05 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/175082 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'])