From patchwork Mon Nov 30 00:52:26 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Scott Murray X-Patchwork-Id: 106323 Received: from mail-qv1-f53.google.com (mail-qv1-f53.google.com [209.85.219.53]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.23420.1795999968572981791 for ; Sun, 29 Nov 2026 16:52:48 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@konsulko.com header.s=google header.b=YiRoodF1; spf=pass (domain: konsulko.com, ip: 209.85.219.53, mailfrom: scott.murray@konsulko.com) Received: by mail-qv1-f53.google.com with SMTP id 6a1803df08f44-9210f2622ccso108532546d6.3 for ; Sun, 29 Nov 2026 16:52:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; t=1795999967; x=1796604767; darn=lists.yoctoproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=nvnzUQuQMN08BSpRGdQANn8Kzym9QYuHj6Hg2Nr9cT0=; b=YiRoodF1gpQIaknrE8F/K7UWSJz4nJ3A+Tw28UObTPgQR5nQIHcK5zPVlTzU7aRuZ/ SeB0W0uFCk6qR2v1od5Ytpz4sVJEB0+98duZXQA3vqTg6JPxRrZes4vlun1bDoM4qOyd 2xRpy9R3L6DXdF9WFgtT9mAYF9t6+NqrnbfGM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795999967; x=1796604767; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=nvnzUQuQMN08BSpRGdQANn8Kzym9QYuHj6Hg2Nr9cT0=; b=M5Pz4hE4M1Mz9hwVJKgJT2th0xo0uMHeb/lmTEPVZlRxpDVbzpnNW5TnvoNKrvwvOp I6JVOPJEB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QcYuE1MF14rEypket 40+tCx8oBfb9UOEIGQUvpbZDqM0kAlodtvEPQohlHOHX49th8JFIxIuG8Kb+7fr44IQ== X-Received: by 2002:a05:6214:4599:b0:921:fc6:bd94 with SMTP id 6a1803df08f44-9213477151bmr584774406d6.0.1795999967367; Sun, 29 Nov 2026 16:52:47 -0800 (PST) Return-Path: Received: from ghidorah.spiteful.org (107-179-213-3.cpe.teksavvy.com. [107.179.213.3]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-921787fd72asm141946796d6.12.2026.11.29.16.52.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Nov 2026 16:52:47 -0800 (PST) From: Scott Murray To: yocto-patches@lists.yoctoproject.org Subject: [meta-lts-mixins][wrynose/rust][PATCH 08/10] ptest-cargo.bbclass: run do_install_ptest_cargo as a postfunc Date: Sun, 29 Nov 2026 19:52:26 -0500 Message-ID: X-Mailer: git-send-email 2.56.1 In-Reply-To: References: MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Mon, 30 Nov 2026 00:52:51 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/5595 From: Trevor Gamblin do_install_ptest_cargo appends to run-ptest, but run-ptest is only reset by do_install_ptest_base's cleandirs. This means that changes to its signature (e.g. by setting 'RUST_TEST_ARGS:pn-hyperfine = "--test-threads=1"' in local.conf) just append another block to run-ptest with an 'exit $rc' in between, so changed test arguments aren't actually used. Run do_install_ptest_cargo as a postfunc for do_install_ptest_base instead so that changes are always reflected. do_install_ptest_cargo is removed as a task. Tested by setting RUST_TEST_ARGS in local.conf as described above. Here is a snippet of what the double-appended run-ptest script would look like without this fix: |if ! /usr/lib/hyperfine/ptest/hyperfine-e8776e44d98845b7 |then | rc=1 | echo "FAIL: /usr/lib/hyperfine/ptest/hyperfine-e8776e44d98845b7" |else | echo "PASS: /usr/lib/hyperfine/ptest/hyperfine-e8776e44d98845b7" |fi |exit $rc | |echo "" |echo "## starting to run rust tests ##" |if [ -z "$rc" ]; then rc=0; fi |if ! /usr/lib/hyperfine/ptest/execution_order_tests-0fccc0f22d97e11e --test-threads=1 |then | rc=1 | echo "FAIL: /usr/lib/hyperfine/ptest/execution_order_tests-0fccc0f22d97e11e" |else AI-Generated: Uses Claude Opus 5.5 Signed-off-by: Trevor Gamblin Signed-off-by: Mathieu Dubois-Briand (adapted from oe-core commit 24a1b261834bbbe1b131dd31e5e2454f130250b3) Signed-off-by: Scott Murray --- classes-recipe/ptest-cargo.bbclass | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/classes-recipe/ptest-cargo.bbclass b/classes-recipe/ptest-cargo.bbclass index 5cdd1c4..0173a2e 100644 --- a/classes-recipe/ptest-cargo.bbclass +++ b/classes-recipe/ptest-cargo.bbclass @@ -123,21 +123,19 @@ python do_install_ptest_cargo() { shutil.chown(os.path.join(root, f), "root", "root") } -do_install_ptest_cargo[dirs] = "${B}" -do_install_ptest_cargo[doc] = "Create or update the run-ptest script with rust test binaries generated" do_compile_ptest_cargo[dirs] = "${B}" do_compile_ptest_cargo[doc] = "Generate rust test binaries through cargo" addtask compile_ptest_cargo after do_compile before do_compile_ptest_base -addtask install_ptest_cargo after do_install_ptest_base before do_package -python () { - if not bb.data.inherits_class('native', d) and not bb.data.inherits_class('cross', d): - d.setVarFlag('do_install_ptest_cargo', 'fakeroot', '1') - d.setVarFlag('do_install_ptest_cargo', 'umask', '022') +# Run as part of do_install_ptest_base so its cleandirs always provides a fresh +# run-ptest to append to. As a separate task, a signature change (e.g. +# RUST_TEST_ARGS) re-ran only this step, appending a second block after the +# first "exit $rc". +do_install_ptest_base[postfuncs] += "do_install_ptest_cargo" +python () { # Remove all '*ptest_cargo' tasks when ptest is not enabled if not(d.getVar('PTEST_ENABLED') == "1"): - for i in ['do_compile_ptest_cargo', 'do_install_ptest_cargo']: - bb.build.deltask(i, d) + bb.build.deltask('do_compile_ptest_cargo', d) }