From patchwork Fri Dec 8 12:00:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Kiernan X-Patchwork-Id: 35954 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 236D5C46CA3 for ; Fri, 8 Dec 2023 12:00:43 +0000 (UTC) Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) by mx.groups.io with SMTP id smtpd.web11.30490.1702036834346537450 for ; Fri, 08 Dec 2023 04:00:34 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=eWtZTSkU; spf=pass (domain: gmail.com, ip: 209.85.128.52, mailfrom: alex.kiernan@gmail.com) Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-40c09dfd82aso26820925e9.0 for ; Fri, 08 Dec 2023 04:00:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702036832; x=1702641632; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=wE2RITKaOOxLrBTDHUU4w/PDS87Fvsf1Gn0Ov1FmkIo=; b=eWtZTSkU1VW1Y/moKkVvb7s2s9usF1F5DyY3SOTTY3Ouht11uduABAEkYOFiDhBrjC zK8mZZj3G42VkX5NBbHdUgtbTD66zAH7HLN3InF4QAWKIin4lojKRajFZSQD0rFdWfH3 iw2/3OsWQuH2lEbSn19B18jrxFq4/SGu4ziZjr8hV7PwyRtoRTG8AjKlICyaJDwHTbai /EtEqmCMVVNyFMHGED4Mvau0Rf0kbKO9eTlKeIwfD5pPZ82Zb3XWWk6P4YvOxx1ICMkN Xv3ipzL35GyMJz/kiMLuct9P9IZ5f509QCwBGn2wm52YyXUhyqCpwRqDgdXFFbwiVZGs LAdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702036832; x=1702641632; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=wE2RITKaOOxLrBTDHUU4w/PDS87Fvsf1Gn0Ov1FmkIo=; b=EUC+Rx+TBl0SipgQQ6yoPywOeCUIm0/pTT1nGoPJ4oMAomj1+UWE3q5LjJcT6wkSA3 JIc5jJMn5a/TVX1XneQxNj7Ftswhhpy7RWLoR+kt3FGM8yYUz14nFlbWnoZJ4t7td4/l IbacxxgY3lNsI6CnDBs3izhZPZdy5tnVnVfMUQmU/VmERqENfXhCaAfZx8Y7wR3sac17 TAHPKxMv2Vvey6ZTWnZkKVbNjutR1OMlCQaTa2JyQjd2aZV2UPFY9uL/l97evI0cLCqL Ox/5EPiAkfmqK9nDmQ7/bAB3JdNWFSYg4ptYWx8FFxHznqxSOcDl4/kCM6grrv58azBZ U0HQ== X-Gm-Message-State: AOJu0Yx6/dA/YNfnx3Ea786wfsDZl/IXYRxiERSrwekTPaFfM1W4CQuZ aRhcyRlrwtn/ZRc8e8Bv++B+sn7P8Oo= X-Google-Smtp-Source: AGHT+IHcbdOJUzK/fNsRpyhOrp8paY94Vhh5TGElHkBbkYlnvxIPAesKn7RuLXL39mHMGGLhHsB65w== X-Received: by 2002:a05:600c:32a9:b0:40b:5e59:ccac with SMTP id t41-20020a05600c32a900b0040b5e59ccacmr2602067wmp.141.1702036831610; Fri, 08 Dec 2023 04:00:31 -0800 (PST) Received: from Zuma-000004PC.lan ([2a02:390:9c57:0:f8f3:2d97:de04:e800]) by smtp.gmail.com with ESMTPSA id bi11-20020a05600c3d8b00b0040c2963e5f3sm2636353wmb.38.2023.12.08.04.00.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 04:00:31 -0800 (PST) From: Alex Kiernan To: openembedded-core@lists.openembedded.org Cc: Alex Kiernan Subject: [OE-Core][PATCH v2 1/4] cargo: Rename MANIFEST_PATH -> CARGO_MANIFEST_PATH Date: Fri, 8 Dec 2023 12:00:25 +0000 Message-Id: <20231208120028.2953-1-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.39.0 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 ; Fri, 08 Dec 2023 12:00:43 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/192047 This variable is a piece of recipe configurable interface, scope it with the class name to make that clear. Signed-off-by: Alex Kiernan --- (no changes since v1) meta/classes-recipe/cargo.bbclass | 4 ++-- meta/classes-recipe/cargo_common.bbclass | 2 +- meta/classes-recipe/ptest-cargo.bbclass | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/meta/classes-recipe/cargo.bbclass b/meta/classes-recipe/cargo.bbclass index 8c0b92df8d33..96a74e2ef1ec 100644 --- a/meta/classes-recipe/cargo.bbclass +++ b/meta/classes-recipe/cargo.bbclass @@ -35,7 +35,7 @@ export RUST_BACKTRACE = "1" CARGO_SRC_DIR ??= "" # The actual path to the Cargo.toml -MANIFEST_PATH ??= "${S}/${CARGO_SRC_DIR}/Cargo.toml" +CARGO_MANIFEST_PATH ??= "${S}/${CARGO_SRC_DIR}/Cargo.toml" RUSTFLAGS ??= "" BUILD_MODE = "${@['--release', ''][d.getVar('DEBUG_BUILD') == '1']}" @@ -44,7 +44,7 @@ BUILD_MODE = "${@['--release', ''][d.getVar('DEBUG_BUILD') == '1']}" # and will require an up to date Cargo.lock file. # This force the package being built to already ship a Cargo.lock, in the end # this is what we want, at least, for reproducibility of the build. -CARGO_BUILD_FLAGS = "-v --frozen --target ${RUST_HOST_SYS} ${BUILD_MODE} --manifest-path=${MANIFEST_PATH}" +CARGO_BUILD_FLAGS = "-v --frozen --target ${RUST_HOST_SYS} ${BUILD_MODE} --manifest-path=${CARGO_MANIFEST_PATH}" # This is based on the content of CARGO_BUILD_FLAGS and generally will need to # change if CARGO_BUILD_FLAGS changes. diff --git a/meta/classes-recipe/cargo_common.bbclass b/meta/classes-recipe/cargo_common.bbclass index b732a1bd9538..bf298e96c745 100644 --- a/meta/classes-recipe/cargo_common.bbclass +++ b/meta/classes-recipe/cargo_common.bbclass @@ -161,7 +161,7 @@ python cargo_common_do_patch_paths() { # here is better than letting cargo tell (in case the file is missing) # "Cargo.lock should be modified but --frozen was given" - manifest_path = d.getVar("MANIFEST_PATH", True) + manifest_path = d.getVar("CARGO_MANIFEST_PATH", True) lockfile = os.path.join(os.path.dirname(manifest_path), "Cargo.lock") if not os.path.exists(lockfile): bb.fatal(f"{lockfile} file doesn't exist") diff --git a/meta/classes-recipe/ptest-cargo.bbclass b/meta/classes-recipe/ptest-cargo.bbclass index ff57be852508..c46df362bfee 100644 --- a/meta/classes-recipe/ptest-cargo.bbclass +++ b/meta/classes-recipe/ptest-cargo.bbclass @@ -15,7 +15,7 @@ python do_compile_ptest_cargo() { cargo = bb.utils.which(d.getVar("PATH"), d.getVar("CARGO", True)) cargo_build_flags = d.getVar("CARGO_BUILD_FLAGS", True) rust_flags = d.getVar("RUSTFLAGS", True) - manifest_path = d.getVar("MANIFEST_PATH", True) + manifest_path = d.getVar("CARGO_MANIFEST_PATH", True) project_manifest_path = os.path.normpath(manifest_path) manifest_dir = os.path.dirname(manifest_path) From patchwork Fri Dec 8 12:00:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Kiernan X-Patchwork-Id: 35955 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 228D3C4167B for ; Fri, 8 Dec 2023 12:00:43 +0000 (UTC) Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) by mx.groups.io with SMTP id smtpd.web11.30491.1702036835108760987 for ; Fri, 08 Dec 2023 04:00:35 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=HcT/caHn; spf=pass (domain: gmail.com, ip: 209.85.128.43, mailfrom: alex.kiernan@gmail.com) Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-40c0a11a914so20982605e9.2 for ; Fri, 08 Dec 2023 04:00:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702036832; x=1702641632; darn=lists.openembedded.org; 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=yTSnYI+LYPztWeeBuscpFF6rhaFKXWoKHHm8ZebThgA=; b=HcT/caHnS1CDqpamLYZynjpKlbjOWE8pqUsCSJ3UMQXsxX6UsZU3rFEMtK2cOegAMw VnHC3wtgD41r+vtX8uQcF5wbNwOBNGFAWZkb/hwq2M+qqfEeLSaBaJo+BP1egCmKavIy xzrg1+dlNuP/G7swLnriJ074g0NT9CB+6G2Q6dWxxSgT8Vx/cMFAKA8NWTz6BvLYt4Ml R3u6k/943jwHcYQRtA6hlLXQ3y7F0+DvkaziRSz1k+74jAPImqzccgToDdPlDv4bwgWN 0X/lsX8eYUc+hXpqqo/O8dyq+M8miNfEZ+BA0wsHD2WN8wjQV8M+Pj6qFE66lkviGJY4 Z5iA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702036832; x=1702641632; 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=yTSnYI+LYPztWeeBuscpFF6rhaFKXWoKHHm8ZebThgA=; b=cZI8uykfoHEaJifNdjZjMIJhDKdQhMHMZBGlUjoLzuIPNhVD4uc8KmsqSY6tu2ewoq uJdEDK0rOQUJS0tz8+LYcZ2DXu67EMhxoLLjOdHg1DkmR/L+4T3gcXDQuKiepi+Y2jRh si42M8BX6rE8yYoqOJYDlLMDOHCDSlb06O3CUmKFiB5uPRA6FaRmasXOBEAKyOZ0p6fA 5pdGfh+39YqE+BqGV5O/+446NZSEN6ZPRE8diQRK6+kkSTQ6f0IIQDGtwpVZ4wzRgMXT zRQxrAJrMafSdY+sbtSiE89TSwtGAGzeInvi9g1cKzOAwcTFl4AlZDVe91vsQUfp+Xhf 5CvQ== X-Gm-Message-State: AOJu0Yzxq6tOrQ/0Qb6NGB8/3tI0Cnj6YOOoTpGemBkk9zPU5Q+4ejm3 IwhcNfQ3rCeLYZaVCwXDkhaKYH8eM7k= X-Google-Smtp-Source: AGHT+IF+0bGiFdssiEc/jwdwoFpFbkhqpe5PoBkRRJ08otoNd0czasAMskVcl4Q7SdX40YPkONCYJQ== X-Received: by 2002:a05:600c:290b:b0:40b:5e59:b7b6 with SMTP id i11-20020a05600c290b00b0040b5e59b7b6mr2368308wmd.147.1702036832231; Fri, 08 Dec 2023 04:00:32 -0800 (PST) Received: from Zuma-000004PC.lan ([2a02:390:9c57:0:f8f3:2d97:de04:e800]) by smtp.gmail.com with ESMTPSA id bi11-20020a05600c3d8b00b0040c2963e5f3sm2636353wmb.38.2023.12.08.04.00.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 04:00:32 -0800 (PST) From: Alex Kiernan To: openembedded-core@lists.openembedded.org Cc: Alex Kiernan Subject: [OE-Core][PATCH v2 2/4] cargo: Move CARGO_MANIFEST_PATH/CARGO_SRC_DIR to cargo_common Date: Fri, 8 Dec 2023 12:00:26 +0000 Message-Id: <20231208120028.2953-2-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20231208120028.2953-1-alex.kiernan@gmail.com> References: <20231208120028.2953-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 ; Fri, 08 Dec 2023 12:00:43 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/192048 cargo_common_do_configure uses CARGO_MANIFEST_PATH (which depends on CARGO_SRC_DIR), but their definition was in cargo.bbclass. Signed-off-by: Alex Kiernan --- Changes in v2: - Drop change from default to weak-defaults meta/classes-recipe/cargo.bbclass | 7 ------- meta/classes-recipe/cargo_common.bbclass | 7 +++++++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/meta/classes-recipe/cargo.bbclass b/meta/classes-recipe/cargo.bbclass index 96a74e2ef1ec..0829a58dd90f 100644 --- a/meta/classes-recipe/cargo.bbclass +++ b/meta/classes-recipe/cargo.bbclass @@ -30,13 +30,6 @@ B = "${WORKDIR}/build" # where the issue occured export RUST_BACKTRACE = "1" -# The directory of the Cargo.toml relative to the root directory, per default -# assume there's a Cargo.toml directly in the root directory -CARGO_SRC_DIR ??= "" - -# The actual path to the Cargo.toml -CARGO_MANIFEST_PATH ??= "${S}/${CARGO_SRC_DIR}/Cargo.toml" - RUSTFLAGS ??= "" BUILD_MODE = "${@['--release', ''][d.getVar('DEBUG_BUILD') == '1']}" # --frozen flag will prevent network access (which is required since only diff --git a/meta/classes-recipe/cargo_common.bbclass b/meta/classes-recipe/cargo_common.bbclass index bf298e96c745..509aa195c5fa 100644 --- a/meta/classes-recipe/cargo_common.bbclass +++ b/meta/classes-recipe/cargo_common.bbclass @@ -33,6 +33,13 @@ CARGO_DISABLE_BITBAKE_VENDORING ?= "0" # Used by libstd-rs to point to the vendor dir included in rustc src CARGO_VENDORING_DIRECTORY ?= "${CARGO_HOME}/bitbake" +# The directory of the Cargo.toml relative to the root directory, per default +# assume there's a Cargo.toml directly in the root directory +CARGO_SRC_DIR ??= "" + +# The actual path to the Cargo.toml +CARGO_MANIFEST_PATH ??= "${S}/${CARGO_SRC_DIR}/Cargo.toml" + CARGO_RUST_TARGET_CCLD ?= "${RUST_TARGET_CCLD}" cargo_common_do_configure () { mkdir -p ${CARGO_HOME}/bitbake From patchwork Fri Dec 8 12:00:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Kiernan X-Patchwork-Id: 35957 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 3E0D1C10DCE for ; Fri, 8 Dec 2023 12:00:43 +0000 (UTC) Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) by mx.groups.io with SMTP id smtpd.web11.30493.1702036836153794865 for ; Fri, 08 Dec 2023 04:00:36 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=NK8sil1s; spf=pass (domain: gmail.com, ip: 209.85.128.54, mailfrom: alex.kiernan@gmail.com) Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-40c09d0b045so23439505e9.0 for ; Fri, 08 Dec 2023 04:00:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702036834; x=1702641634; darn=lists.openembedded.org; 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=2XXAG26dwx1/20mJp7k/JnLqiC8dWklO5n09lSNJzKg=; b=NK8sil1sF9jxD6kAEAjH30jasv7hZ7nra8L/3Tyuz/UvK2V8oHaxS3WixAvu6C9ULK M4sIgJtR6uEQ1VyyMdyVwO8jm6NTyeSUmPmRohzr0uOmIrOBHyh1a4lYp0A71mV3EuNE oXMwgTQONdKh/kwCYy1CjDO/LyaeyZz/73BH3LpHgH4RBgeZAqUQGnhEueu96MvC/z1j yCpc2tdZkRa1kNckA5PWUvPc0uAkiWdYIHxDFFWI2eR9BXNNsGLpzdp4xVNeqgz3x3OO Zw50+bPn8UVGHRUk3jsHKKMMeL6BaR274f//Z6O6GUMs8KFIytlRIYCoP0jRTv2giorF sP3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702036834; x=1702641634; 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=2XXAG26dwx1/20mJp7k/JnLqiC8dWklO5n09lSNJzKg=; b=GmBn+5ShhuZen8ZCDlKtx70eoll4E0dW8kkbnfeRIBYy96O64YVeSmE/4G679n4eXT qYTyRjMYaWmraQOAl8/e7hP6ReP6Q5pxPvcpJPRaT+xhVDZbooykD2+tAhykbOc6YD7J IcWeEqC8Icoc2Z+ncILZHGEm15jeYXb/5CPlER0zWPSEh7owVIcKqDbGzwhM531qEQCv 1uW011larCNrOi2DsrCXV1a/Ss8xlv+wxfKbq/snr3/guDmyxHTD4xENAQqxsOpoW3XS EQEAzpeBZzArxpSopmVEnIwIm3HGiIghponVUIcf+Fj9Yi+vfIR7Bsdj3HXIuNC+Pp1D 0fUA== X-Gm-Message-State: AOJu0Yw4OESYweJWifzVFeQMj/AiODmzude8x655CfPsqmPUYatxFWwH QpRf0ajB+pJP20OdtqhB9Dpw4Lbb1k0= X-Google-Smtp-Source: AGHT+IHi/Uz7EE1vqT3uNF1XicXTLQrxmeVf43S4ssrsLXGK7iP68GJNbwBd/G+jafPgea/TPPagWA== X-Received: by 2002:a05:600c:4744:b0:40c:2734:13f3 with SMTP id w4-20020a05600c474400b0040c273413f3mr1058078wmo.24.1702036834162; Fri, 08 Dec 2023 04:00:34 -0800 (PST) Received: from Zuma-000004PC.lan ([2a02:390:9c57:0:f8f3:2d97:de04:e800]) by smtp.gmail.com with ESMTPSA id bi11-20020a05600c3d8b00b0040c2963e5f3sm2636353wmb.38.2023.12.08.04.00.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 04:00:32 -0800 (PST) From: Alex Kiernan To: openembedded-core@lists.openembedded.org Cc: Alex Kiernan Subject: [OE-Core][PATCH v2 3/4] rust: cargo: Convert single-valued variables to weak defaults Date: Fri, 8 Dec 2023 12:00:27 +0000 Message-Id: <20231208120028.2953-3-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20231208120028.2953-1-alex.kiernan@gmail.com> References: <20231208120028.2953-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 ; Fri, 08 Dec 2023 12:00:43 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/192049 All of these variables are single-valued, so we can use weak-defaults for them and only see the final assignment after parsing. Signed-off-by: Alex Kiernan --- Changes in v2: - New in v2 meta/classes-recipe/cargo_common.bbclass | 6 +++--- meta/classes-recipe/rust-common.bbclass | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/meta/classes-recipe/cargo_common.bbclass b/meta/classes-recipe/cargo_common.bbclass index 509aa195c5fa..48cdd69bca13 100644 --- a/meta/classes-recipe/cargo_common.bbclass +++ b/meta/classes-recipe/cargo_common.bbclass @@ -28,10 +28,10 @@ export PKG_CONFIG_ALLOW_CROSS = "1" # Don't instruct cargo to use crates downloaded by bitbake. Some rust packages, # for example the rust compiler itself, come with their own vendored sources. # Specifying two [source.crates-io] will not work. -CARGO_DISABLE_BITBAKE_VENDORING ?= "0" +CARGO_DISABLE_BITBAKE_VENDORING ??= "0" # Used by libstd-rs to point to the vendor dir included in rustc src -CARGO_VENDORING_DIRECTORY ?= "${CARGO_HOME}/bitbake" +CARGO_VENDORING_DIRECTORY ??= "${CARGO_HOME}/bitbake" # The directory of the Cargo.toml relative to the root directory, per default # assume there's a Cargo.toml directly in the root directory @@ -40,7 +40,7 @@ CARGO_SRC_DIR ??= "" # The actual path to the Cargo.toml CARGO_MANIFEST_PATH ??= "${S}/${CARGO_SRC_DIR}/Cargo.toml" -CARGO_RUST_TARGET_CCLD ?= "${RUST_TARGET_CCLD}" +CARGO_RUST_TARGET_CCLD ??= "${RUST_TARGET_CCLD}" cargo_common_do_configure () { mkdir -p ${CARGO_HOME}/bitbake diff --git a/meta/classes-recipe/rust-common.bbclass b/meta/classes-recipe/rust-common.bbclass index ae96d9c5b1ff..6940093e59bf 100644 --- a/meta/classes-recipe/rust-common.bbclass +++ b/meta/classes-recipe/rust-common.bbclass @@ -16,8 +16,8 @@ FILES:${PN}-dbg += "${rustlibdir}/.debug" RUSTLIB = "-L ${STAGING_DIR_HOST}${rustlibdir}" RUST_DEBUG_REMAP = "--remap-path-prefix=${WORKDIR}=${TARGET_DBGSRC_DIR}" RUSTFLAGS += "${RUSTLIB} ${RUST_DEBUG_REMAP}" -RUSTLIB_DEP ?= "libstd-rs" -RUST_PANIC_STRATEGY ?= "unwind" +RUSTLIB_DEP ??= "libstd-rs" +RUST_PANIC_STRATEGY ??= "unwind" def target_is_armv7(d): '''Determine if target is armv7''' From patchwork Fri Dec 8 12:00:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Kiernan X-Patchwork-Id: 35956 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 4A10AC10DC1 for ; Fri, 8 Dec 2023 12:00:43 +0000 (UTC) Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) by mx.groups.io with SMTP id smtpd.web10.30746.1702036837833936417 for ; Fri, 08 Dec 2023 04:00:38 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=h3N6RHaO; spf=pass (domain: gmail.com, ip: 209.85.221.52, mailfrom: alex.kiernan@gmail.com) Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-33338c47134so1816521f8f.1 for ; Fri, 08 Dec 2023 04:00:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702036835; x=1702641635; darn=lists.openembedded.org; 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=wnHcQI+h8e7pT+nOa9/r+G0iCDKIFqiNHwrXdqJd9DI=; b=h3N6RHaOSDuwzqISj61/7dexeBpFYuJAXxRbg6M46+T1pk+NRUcBj5RJ5+9lm7gVRu fTOdvnzkz87ANlBzbrSDhDKTAFtvldSumkbapVtel5nPymWeSEhUX2UAlozxB43P0ikt JpWEAa+FhCmjePnFUXxcPa5RiM9TJJPhoAe765hmmb19gVIklNlJxWMonzK6BzqzT5lE IaGN4v5ry9RLr6Ugyd3/LeyG7uv95DJ1RfniLQSktHDmeaSiHiD5SA+8x5jm5K7s2iXb EDY2Itm5NdULAg1IJiGF0qYj4fJSGz4UUcOuRfSK3CqHH4ZXoXjiyYjp2L2gv2Gvob+U /stw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702036835; x=1702641635; 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=wnHcQI+h8e7pT+nOa9/r+G0iCDKIFqiNHwrXdqJd9DI=; b=FyREvuvcFP1thuiw8FpWVIYW1CpqBR41UfZZnNAVYcV0D7FvDOitv1wi2HP0x1bdYd kk4xC5BnmRKet/GY8cVx8/robbcWWh56lqchlyu5vNDX3jwBU389+NJtyCYuDWhI7rxM SQR7UuT/FGkj8BjlCcSPTvQYnt4GB1R/HJXDWBHS+wPBYgvsnTMe1JWZVMofMhohMFc3 QxcDQ/XVZLFwk5fYWUsB1qa/zWO5Yo437xnxmDFcnhu/+uDPwISCEWz8hJh72ACQzaEY +Pes7T4UJqpcXqe2F0Qjc/J5g30XIxhFUkltGqK96wqsrvhIlYeVinBFkaeBGLZAK42Z 3Aaw== X-Gm-Message-State: AOJu0YxjdGfZdBvW3oHMY2slclObni3vXq8NqdHYLJcB7JFNmb7zfu6u usyFzdrQaeuDLGstX9P3SUW/+wx160I= X-Google-Smtp-Source: AGHT+IFGMvqbF1X/IBgOClhEQV+qFlWScK43FGMfGGbPnpM7eL9u5BvsWheBPEAkwmTDEtyyu9N2Iw== X-Received: by 2002:a05:600c:4753:b0:40b:5e1c:5c21 with SMTP id w19-20020a05600c475300b0040b5e1c5c21mr2409798wmo.54.1702036835191; Fri, 08 Dec 2023 04:00:35 -0800 (PST) Received: from Zuma-000004PC.lan ([2a02:390:9c57:0:f8f3:2d97:de04:e800]) by smtp.gmail.com with ESMTPSA id bi11-20020a05600c3d8b00b0040c2963e5f3sm2636353wmb.38.2023.12.08.04.00.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 04:00:34 -0800 (PST) From: Alex Kiernan To: openembedded-core@lists.openembedded.org Cc: Alex Kiernan Subject: [OE-Core][PATCH v2 4/4] cargo: Add CARGO_LOCK_PATH for path to Cargo.lock Date: Fri, 8 Dec 2023 12:00:28 +0000 Message-Id: <20231208120028.2953-4-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20231208120028.2953-1-alex.kiernan@gmail.com> References: <20231208120028.2953-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 ; Fri, 08 Dec 2023 12:00:43 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/192050 When building a workspace enabled project, the Cargo.lock is found at the root of the project, not alongside the Cargo.toml. Expose CARGO_LOCK_PATH so it can be explicitly configured. Signed-off-by: Alex Kiernan --- Changes in v2: - Change CARGO_LOCK_PATH to a weak-default meta/classes-recipe/cargo_common.bbclass | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/meta/classes-recipe/cargo_common.bbclass b/meta/classes-recipe/cargo_common.bbclass index 48cdd69bca13..0fb443edbdde 100644 --- a/meta/classes-recipe/cargo_common.bbclass +++ b/meta/classes-recipe/cargo_common.bbclass @@ -40,6 +40,9 @@ CARGO_SRC_DIR ??= "" # The actual path to the Cargo.toml CARGO_MANIFEST_PATH ??= "${S}/${CARGO_SRC_DIR}/Cargo.toml" +# Path to Cargo.lock +CARGO_LOCK_PATH ??= "${@ os.path.join(os.path.dirname(d.getVar('CARGO_MANIFEST_PATH', True)), 'Cargo.lock')}" + CARGO_RUST_TARGET_CCLD ??= "${RUST_TARGET_CCLD}" cargo_common_do_configure () { mkdir -p ${CARGO_HOME}/bitbake @@ -168,8 +171,7 @@ python cargo_common_do_patch_paths() { # here is better than letting cargo tell (in case the file is missing) # "Cargo.lock should be modified but --frozen was given" - manifest_path = d.getVar("CARGO_MANIFEST_PATH", True) - lockfile = os.path.join(os.path.dirname(manifest_path), "Cargo.lock") + lockfile = d.getVar("CARGO_LOCK_PATH", True) if not os.path.exists(lockfile): bb.fatal(f"{lockfile} file doesn't exist")