All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Mathieu Dubois-Briand" <mathieu.dubois-briand@bootlin.com>
To: <skandigraun@gmail.com>, <openembedded-core@lists.openembedded.org>
Subject: Re: [OE-core] [PATCH 2/2] rust-common.bbclass: filter out incorrect compiler flags in wrapper
Date: Fri, 21 Nov 2025 10:17:43 +0100	[thread overview]
Message-ID: <DEE9DLQRPI5N.368W9VM5LPRIA@bootlin.com> (raw)
In-Reply-To: <20251120121947.3473848-3-skandigraun@gmail.com>

On Thu Nov 20, 2025 at 1:19 PM CET, Gyorgy Sarvari via lists.openembedded.org wrote:
> This patch is a workaround for https://bugzilla.yoctoproject.org/show_bug.cgi?id=15976
>
> cc-rs crate is used by a number of projects, including rust's bootstrap also
> to invoke the systems c/c++ compiler.
>
> A few updates ago it has changed the way CFLAGS/CXXFLAGS are handled: it now
> merges them with HOST_C*FLAGS and TARGET_C*FLAGS.
>
> This is a problem when a recipe is cross compiled, but it has a build dependency
> which uses this crate to be built. In this case the C*FLAGS variable contains
> target flags, while the HOST_C*FLAGS contains host-specific flags, and when the
> two are mixed, the output is not what one expects.
>
> This change tries to filter out the incorrect flags:
> - If the wrapper is invoked as a c or c++ compiler wrapper,
> - then determines if it compiles for host or for target
> - Depending on the on above, it considers the TARGET_*FLAGS or HOST*FLAGS
>   correct, and the C*FLAGS variable content incorrect.
> - It subtracts the correct set from the incorrect set, and drops the
>   remainder from the compiler flags. (Which might be often an empty list, so
>   the flags are frequently unchanged)
>
> Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
> ---

Hi Gyorgy,

Thanks for your patch.

I suspect one of the commit of this series is responsible of this rust
test failure:

2025-11-20 21:59:48,098 - oe-selftest - INFO - FAIL: rust.RustSelfTestSystemEmulated.test_rust (subunit.RemotedTestCase)
...
  File "/srv/pokybuild/yocto-worker/qemux86-64-tc/build/layers/openembedded-core/meta/lib/oeqa/core/decorator/__init__.py", line 35, in wrapped_f
    return func(*args, **kwargs)
  File "/srv/pokybuild/yocto-worker/qemux86-64-tc/build/layers/openembedded-core/meta/lib/oeqa/selftest/cases/rust.py", line 131, in test_rust
    retval = runCmd(cmd)
  File "/srv/pokybuild/yocto-worker/qemux86-64-tc/build/layers/openembedded-core/meta/lib/oeqa/utils/commands.py", line 214, in runCmd
    raise AssertionError("Command '%s' returned non-zero exit status %d:\n%s" % (command, result.status, exc_output))
AssertionError: Command 'export TARGET_VENDOR="-poky"; export PATH=/srv/pokybuild/yocto-worker/qemux86-64-tc/build/build-st-1700604/tmp/work/x86-64-v3-poky-linux/rust/1.90.0/recipe-sysroot-native/usr/bin/python3-native:/srv/pokybuild/yocto-worker/qemux86-64-tc/build/build-st-1700604/tmp/work/x86-64-v3-poky-linux/rust/1.90.0/recipe-sysroot-native/usr/bin:/srv/pokybuild/yocto-worker/qemux86-64-tc/build/build-st-1700604/tmp/work/x86-64-v3-poky-linux/rust/1.90.0/recipe-sysroot-native/usr/bin/x86_64-poky-linux:/srv/pokybuild/yocto-worker/qemux86-64-tc/build/build-st-1700604/tmp/hosttools:$PATH; export RUST_TARGET_PATH=/srv/pokybuild/yocto-worker/qemux86-64-tc/build/build-st-1700604/tmp/work/x86-64-v3-poky-linux/rust/1.90.0/rust-targets; export RUSTFLAGS='-C strip=debuginfo'; export TEST_DEVICE_ADDR="192.168.7.6:12345"; cd /srv/pokybuild/yocto-worker/qemux86-64-tc/build/build-st-1700604/tmp/work/x86-64-v3-poky-linux/rust/1.90.0/sources/rustc-1.90.0-src; python3 src/bootstrap/bootstrap.py test  --exclude src/bootstrap  --exclude src/doc/rustc  --exclude src/doc/rustdoc  --exclude src/doc/unstable-book  --exclude src/etc/test-float-parse  --exclude src/librustdoc  --exclude src/rustdoc-json-types  --exclude src/tools/coverage-dump  --exclude src/tools/jsondoclint  --exclude src/tools/lint-docs  --exclude src/tools/replace-version-placeholder  --exclude src/tools/rust-analyzer  --exclude src/tools/rustdoc-themes  --exclude src/tools/rust-installer  --exclude src/tools/test-float-parse  --exclude src/tools/suggest-tests  --exclude src/tools/tidy  --exclude tests/assembly-llvm/asm/aarch64-outline-atomics.rs  --exclude tests/codegen-llvm/issues/issue-122805.rs  --exclude tests/codegen-llvm/thread-local.rs  --exclude tests/mir-opt/  --exclude tests/run-make  --exclude tests/run-make-fulldeps  --exclude tests/rustdoc  --exclude tests/rustdoc-json  --exclude tests/rustdoc-js-std  --exclude tests/ui/abi/stack-probes-lto.rs  --exclude tests/ui/abi/stack-probes.rs  --exclude tests/ui/codegen/mismatched-data-layouts.rs  --exclude tests/codegen-llvm/rust-abi-arch-specific-adjustment.rs  --exclude tests/ui/debuginfo/debuginfo-emit-llvm-ir-and-split-debuginfo.rs  --exclude tests/ui/feature-gates/version_check.rs  --exclude tests/ui-fulldeps/  --exclude tests/ui/process/nofile-limit.rs  --exclude tidyselftest --no-doc --no-fail-fast --bless --target x86_64-poky-linux-gnu' returned non-zero exit status 1:
...

https://autobuilder.yoctoproject.org/valkyrie/#/builders/66/builds/2691

Can you have a look at this error?

Thanks,
Mathieu

-- 
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com



  reply	other threads:[~2025-11-21  9:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-20 12:19 [PATCH 0/2] -fcanon-file-prefix and cc-rs compiler flag mixing Gyorgy Sarvari
2025-11-20 12:19 ` [PATCH 1/2] bitbake.conf, gcc toolchain: add -fcanon-prefix-map to map-prefixes Gyorgy Sarvari
2025-11-20 20:28   ` [OE-core] " Khem Raj
2025-11-20 22:48   ` Richard Purdie
2025-11-20 22:58     ` Khem Raj
2025-11-21  8:30     ` Gyorgy Sarvari
2025-11-21  8:57       ` Martin Jansa
2025-11-20 12:19 ` [PATCH 2/2] rust-common.bbclass: filter out incorrect compiler flags in wrapper Gyorgy Sarvari
2025-11-21  9:17   ` Mathieu Dubois-Briand [this message]
2025-11-21 10:51     ` [OE-core] " Gyorgy Sarvari
2025-11-21 11:47       ` Richard Purdie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DEE9DLQRPI5N.368W9VM5LPRIA@bootlin.com \
    --to=mathieu.dubois-briand@bootlin.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=skandigraun@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.