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 46A47C4167E for ; Mon, 4 Apr 2022 18:46:41 +0000 (UTC) Subject: Re: meta: rust: Bug fix for target definitions returning 'NoneType' To: openembedded-core@lists.openembedded.org From: "Sundeep KOKKONDA" X-Originating-Location: Belgaum, Karnataka, IN (103.197.112.115) X-Originating-Platform: Windows Chrome 100 User-Agent: GROUPS.IO Web Poster MIME-Version: 1.0 Date: Mon, 04 Apr 2022 09:06:42 -0700 References: In-Reply-To: Message-ID: <12323.1649088402646367791@lists.openembedded.org> Content-Type: multipart/alternative; boundary="iLd0xZahVBmGaFvC4nAs" 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 ; Mon, 04 Apr 2022 18:46:41 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/164003 --iLd0xZahVBmGaFvC4nAs Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hello Alex, Steps to reproduce: * Set MACHINE ?=3D "qemuarm" in local.conf * bitbake core-image-minimal -cpopulate_sdk * Complete Error:* >=20 > ERROR: rust-cross-canadian-arm-1.59.0-r0 do_rust_gen_targets: Error > executing a python function in exec_func_python() autogenerated: >=20 > The stack trace of python calls that resulted in this exception/failure > was: > File: 'exec_func_python() autogenerated', lineno: 2, function: > 0001: > *** 0002:do_rust_gen_targets(d) > 0003: > File: > '/ala-lpggp31/skokkonda/yocto/poky/meta/recipes-devtools/rust/rust-cross-= canadian-common.inc', > lineno: 31, function: do_rust_gen_targets > 0027: > 0028:LLVM_TARGET[x86_64] =3D "${RUST_HOST_SYS}" > 0029:python do_rust_gen_targets () { > 0030:=C2=A0 =C2=A0 wd =3D d.getVar('WORKDIR') + '/targets/' > *** 0031:=C2=A0 =C2=A0 rust_gen_target(d, 'TARGET', wd, > d.getVar('TARGET_LLVM_FEATURES') or "", d.getVar('TARGET_LLVM_CPU'), > d.getVar('TARGET_ARCH')) > 0032:=C2=A0 =C2=A0 rust_gen_target(d, 'HOST', wd, "", "generic", > d.getVar('HOST_ARCH')) > 0033:=C2=A0 =C2=A0 rust_gen_target(d, 'BUILD', wd, "", "generic", > d.getVar('BUILD_ARCH')) > 0034:} > 0035: > File: > '/ala-lpggp31/skokkonda/yocto/poky/meta/recipes-devtools/rust/rust-common= .inc', > lineno: 330, function: rust_gen_target > 0326:=C2=A0 =C2=A0 # build tspec > 0327:=C2=A0 =C2=A0 tspec =3D {} > 0328:=C2=A0 =C2=A0 tspec['llvm-target'] =3D d.getVarFlag('LLVM_TARGET', a= rch_abi) > 0329:=C2=A0 =C2=A0 tspec['data-layout'] =3D d.getVarFlag('DATA_LAYOUT', a= rch_abi) > *** 0330:=C2=A0 =C2=A0 tspec['max-atomic-width'] =3D > int(d.getVarFlag('MAX_ATOMIC_WIDTH', arch_abi)) > 0331:=C2=A0 =C2=A0 tspec['target-pointer-width'] =3D > d.getVarFlag('TARGET_POINTER_WIDTH', arch_abi) > 0332:=C2=A0 =C2=A0 tspec['target-c-int-width'] =3D d.getVarFlag('TARGET_C= _INT_WIDTH', > arch_abi) > 0333:=C2=A0 =C2=A0 tspec['target-endian'] =3D d.getVarFlag('TARGET_ENDIAN= ', arch_abi) > 0334:=C2=A0 =C2=A0 tspec['arch'] =3D arch_to_rust_target_arch(rust_arch) > Exception: TypeError: int() argument must be a string, a bytes-like objec= t > or a number, not 'NoneType' >=20 > ERROR: Logfile of failure stored in: > /ala-lpggp31/skokkonda/yocto/poky/build_arm/tmp/work/x86_64-nativesdk-pok= ysdk-linux/rust-cross-canadian-arm/1.59.0-r0/temp/log.do_rust_gen_targets.1= 68831 >=20 > ERROR: Task > (/ala-lpggp31/skokkonda/yocto/poky/meta/recipes-devtools/rust/rust-cross-= canadian_1.59.0.bb:do_rust_gen_targets) > failed with exit code '1' > . >=20 I took local variables from=C2=A0rust_gen_target function for arm and aarch= 64 targets. Refer below, the tspec varibles for 'arm' generated with NoneTy= pe. Locals at rust_gen_target for arm:: arch =3D=C2=A0 arm rust_arch =3D=C2=A0 arm arch_abi =3D=C2=A0 arm *tspec['data-layout'] =3D=C2=A0 None* *Type of tspec['data-layout'] =3D=C2=A0 * tspec['data-layout'] =3D=C2=A0 None Type of tspec['data-layout'] =3D=C2=A0 DEBUG: Python function do_rust_gen_targets finished Locals at rust_gen_target=C2=A0 for aarch64:: arch =3D=C2=A0 aarch64 rust_arch =3D=C2=A0 aarch64 arch_abi =3D=C2=A0 aarch64 *tspec['data-layout'] =3D=C2=A0 aarch64-unknown-linux-gnu* *Type of tspec['data-layout'] =3D=C2=A0 * tspec['data-layout'] =3D=C2=A0 e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:= 64-S128 Type of tspec['data-layout'] =3D=C2=A0 tspec['max-atomic-width'] =3D=C2=A0 128 Type of tspec['max-atomic-width'] =3D=C2=A0 tspec['target-pointer-width'] =3D=C2=A0 64 Type of tspec['target-pointer-width'] =3D=C2=A0 tspec['target-c-int-width'] =3D=C2=A0 32 Type of tspec['target-c-int-width'] =3D=C2=A0 tspec['target-endian'] =3D=C2=A0 little Type of tspec['target-endian'] =3D=C2=A0 tspec['arch'] =3D=C2=A0 aarch64 Type of tspec['arch'] =3D=C2=A0 Reason for changing arm-eabi to arm: I noticed that the previous change introduced this bug, so I reverted the a= rm-eabi to arm and the issue is fixed. -- Thanks, Sundeep K. --iLd0xZahVBmGaFvC4nAs Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hello Alex,

Steps to= reproduce:
  • Set MACHINE ?=3D "qemuarm" in local.conf
  • bitbake core-image-minimal -cpopulate_sdk

Complete Error:

ERROR: rust-cross-canadian-arm-1.59.0-r0 do_rust_gen_targets: Error ex= ecuting a python function in exec_func_python() autogenerated:
 
The stack trace of python calls that resulted in this exception/failur= e was:
File: 'exec_func_python() autogenerated', lineno: 2, function: <mod= ule>
     0001:
 *** 0002:do_rust_gen_targets(d)
     0003:
File: '/ala-lpggp31/skokkonda/yocto/poky/meta/recipes-devtools/rust/ru= st-cross-canadian-common.inc', lineno: 31, function: do_rust_gen_targets
     0027:
     0028:LLVM_TARGET[x86_64] =3D "${RUST_HOST_SYS}"
     0029:python do_rust_gen_targets () {
     0030:    wd =3D d.getVar('WORKDIR') + '/= targets/'
 *** 0031:    rust_gen_target(d, 'TARGET', wd, d.getVar= ('TARGET_LLVM_FEATURES') or "", d.getVar('TARGET_LLVM_CPU'), d.getVar('TARG= ET_ARCH'))
     0032:    rust_gen_target(d, 'HOST', wd, = "", "generic", d.getVar('HOST_ARCH'))
     0033:    rust_gen_target(d, 'BUILD', wd,= "", "generic", d.getVar('BUILD_ARCH'))
     0034:}
     0035:
File: '/ala-lpggp31/skokkonda/yocto/poky/meta/recipes-devtools/rust/ru= st-common.inc', lineno: 330, function: rust_gen_target
     0326:    # build tspec
     0327:    tspec =3D {}
     0328:    tspec['llvm-target'] =3D d.getV= arFlag('LLVM_TARGET', arch_abi)
     0329:    tspec['data-layout'] =3D d.getV= arFlag('DATA_LAYOUT', arch_abi)
 *** 0330:    tspec['max-atomic-width'] =3D int(d.getVa= rFlag('MAX_ATOMIC_WIDTH', arch_abi))
     0331:    tspec['target-pointer-width'] = =3D d.getVarFlag('TARGET_POINTER_WIDTH', arch_abi)
     0332:    tspec['target-c-int-width'] =3D= d.getVarFlag('TARGET_C_INT_WIDTH', arch_abi)
     0333:    tspec['target-endian'] =3D d.ge= tVarFlag('TARGET_ENDIAN', arch_abi)
     0334:    tspec['arch'] =3D arch_to_rust_= target_arch(rust_arch)
Exception: TypeError: int() argument must be a string, a bytes-like ob= ject or a number, not 'NoneType'
 
ERROR: Logfile of failure stored in: /ala-lpggp31/skokkonda/yocto/poky= /build_arm/tmp/work/x86_64-nativesdk-pokysdk-linux/rust-cross-canadian-arm/= 1.59.0-r0/temp/log.do_rust_gen_targets.168831
ERROR: Task (/ala-lpggp31/skokkonda/yocto/poky/meta/recipes-devtools/r= ust/rust-cross-canadian_1.59.0.bb:do_rust_gen_targets) failed with exit cod= e '1'
.
I took local variables from rust_gen_target function for arm = and aarch64 targets. Refer below, the tspec varibles for 'arm' generated wi= th NoneType.

Locals at rust_gen_t= arget for arm::
arch =3D  arm
rust_arch =3D  arm
arch_abi =3D  arm
tspec['data-layout'] =3D  None
Type of tspec['data-layout'] =3D  <class 'NoneType'>= ;
tspec['data-layout'] =3D  None
Type of tspec['data-layout'] =3D  <class 'NoneType'>
DEBUG: Python function do_rust_gen_targets finished

Locals at rust_gen_target&= nbsp; for aarch64::
arch =3D  aarch64
rust_arch =3D  aarch64
arch_abi =3D  aarch64
tspec['data-layout'] =3D  aarch64-unknown-linux-gnu
Type of tspec['data-layout'] =3D  <class 'str'>
tspec['data-layout'] =3D  e-m:e-i8:8:32-i16:16:32-i64:64-i128:128= -n32:64-S128
Type of tspec['data-layout'] =3D  <class 'str'>
tspec['max-atomic-width'] =3D  128
Type of tspec['max-atomic-width'] =3D  <class 'int'>
tspec['target-pointer-width'] =3D  64
Type of tspec['target-pointer-width'] =3D  <class 'str'>
tspec['target-c-int-width'] =3D  32
Type of tspec['target-c-int-width'] =3D  <class 'str'>
tspec['target-endian'] =3D  little
Type of tspec['target-endian'] =3D  <class 'str'>
tspec['arch'] =3D  aarch64
Type of tspec['arch'] =3D  <class 'str'>

Reason for changing = arm-eabi to arm:
I noticed that the previous ch= ange introduced this bug, so I reverted the arm-eabi to arm and the issue is fixed.


--
Thanks,
Sundeep K.

--iLd0xZahVBmGaFvC4nAs--