Hi Richard,

  I’ve already unsuccessfully tried all these combinations with both “if” and 
oe.utils.conditional.

$ MACHINE=qemuarm bitbake rust-native -e |grep CRATE_CC_NO_DEFAULTS
# $CRATE_CC_NO_DEFAULTS [3 operations]
#     [export] "${@1 if d.getVar('CRATE_CC_NO_DEFAULTS') == 'true' else 0}"
export CRATE_CC_NO_DEFAULTS=""
# $CRATE_CC_NO_DEFAULTS:class-native
CRATE_CC_NO_DEFAULTS:class-native=""

$ MACHINE=qemuarm bitbake rust-native -e |grep CRATE_CC_NO_DEFAULTS
# $CRATE_CC_NO_DEFAULTS [3 operations]
#     [export] "${@'1' if d.getVar('CRATE_CC_NO_DEFAULTS') == 'true' else ''}"
export CRATE_CC_NO_DEFAULTS=""
# $CRATE_CC_NO_DEFAULTS:class-native
CRATE_CC_NO_DEFAULTS:class-native=""

Looking at this “0” should work
https://git.yoctoproject.org/poky/tree/meta/classes-recipe/go.bbclass#n30

But, even if I add
CRATE_CC_NO_DEFAULTS[export] = "0"
for testing, I still see:

$ MACHINE=qemuarm bitbake rust-native -e |grep CRATE_CC_NO_DEFAULTS
# $CRATE_CC_NO_DEFAULTS [3 operations]
export CRATE_CC_NO_DEFAULTS=""
# $CRATE_CC_NO_DEFAULTS:class-native
CRATE_CC_NO_DEFAULTS:class-native=""

Cheers,
Anton

From: Richard Purdie <[email protected]>
Date: Friday, 18 November 2022 at 16:35
To: Anton Antonov <[email protected]>, 
[email protected] 
<[email protected]>
Subject: Re: [OE-core] [langdale][master][PATCH] rust: Do not use default 
compiler flags defined in CC crate
On Fri, 2022-11-18 at 16:21 +0000, Anton Antonov wrote:
>   I’ve tested your approach. It doesn’t work for whatever reason.
> CRATE_CC_NO_DEFAULTS is empty exported for native recipes:
>
> $ MACHINE=qemuarm bitbake rust-native -e |grep CRATE_CC_NO_DEFAULTS
> # $CRATE_CC_NO_DEFAULTS [3 operations]
> #     [export] "${'1' if d.getVar('CRATE_CC_NO_DEFAULTS') == 'true'
> else '0'}"
> export CRATE_CC_NO_DEFAULTS=""
> # $CRATE_CC_NO_DEFAULTS:class-native
> CRATE_CC_NO_DEFAULTS:class-native=""
>
>
>   I also tried:
> CRATE_CC_NO_DEFAULTS[export] =
> "${@oe.utils.conditional('CRATE_CC_NO_DEFAULTS', '', '0', '1', d)}"
> with the same result – empty export.

I think it might need to be 0 or "" instead of '0'. It would be nice if
we could make False work too but I worry that might not.

Cheers,

Richard
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#173479): 
https://lists.openembedded.org/g/openembedded-core/message/173479
Mute This Topic: https://lists.openembedded.org/mt/95113030/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to