Bug 13842

Summary: python3-native (3.7.7-r0) task do_configure failed (Yocto version ZEUS, target qemux86-64)
Product: [Build System, Metadata & Runtime] Other YP Layers Reporter: khoja <khoja.medhi>
Component: layersAssignee: Matthias Schöpfer <matthias.schoepfer>
Status: RESOLVED FIXED QA Contact: Matthias Schöpfer <matthias.schoepfer>
Severity: critical    
Priority: Medium CC: poky.bs.watcher, poky.watcher, randy.macleod
Version: 3.2   
Target Milestone: 3.0.3   
Hardware: Other   
OS: x86   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know
Attachments:
Description Flags
cooker.log
none
Updated patch none

Description khoja 2020-03-23 20:35:27 UTC
Created attachment 4651 [details]
cooker.log

python3-native (3.7.7-r0) task do_configure systematic failed for build command "bitbake core-image-minimal" with yocto 3.2 zeus.

Build Configuration:
BB_VERSION           = "1.44.0"
BUILD_SYS            = "i686-linux"
NATIVELSBSTRING      = "universal"
TARGET_SYS           = "x86_64-poky-linux"
MACHINE              = "qemux86-64"
DISTRO               = "poky"
DISTRO_VERSION       = "3.0.2"
TUNE_FEATURES        = "m64 core2"
TARGET_FPU           = ""
meta                 
meta-poky            
meta-yocto-bsp       = "zeus:f9ef210967ab34168d4a24930987dc0731baf56f"


See attached log file for host system 18.04.1-Ubuntu

Same bug description reproduce with host system Ubuntu16.04LTS:
https://stackoverflow.com/questions/58703657/yocto-bitbake-core-image-sato#
Comment 1 khoja 2020-03-24 11:54:22 UTC
Issue comes from python ./configure and operating system Ubuntu User/Admin configuration.
Standalone python3 compilation does same issue:

"configure: error: cannot run C compiled programs."

full compilation log :
./configure
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for python3.7... no
checking for python3... python3
checking for --enable-universalsdk... no
checking for --with-universal-archs... no
checking MACHDEP... checking for --without-gcc... no
checking for --with-icc... no
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... configure: error: in `/tmp/Python-3.7.6':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
Comment 2 khoja 2020-03-24 11:55:25 UTC
Issue comes from python ./configure and operating system Ubuntu User/Admin configuration.
Standalone python3 compilation does same issue:

"configure: error: cannot run C compiled programs."

full compilation log :
./configure
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for python3.7... no
checking for python3... python3
checking for --enable-universalsdk... no
checking for --with-universal-archs... no
checking MACHDEP... checking for --without-gcc... no
checking for --with-icc... no
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... configure: error: in `/tmp/Python-3.7.6':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
Comment 3 khoja 2020-03-24 12:53:26 UTC
not a bug
Comment 4 khoja 2020-03-24 15:57:18 UTC
bug reopen (do not take into account for my comments 1 and 2)

regression from mips platform dectection patch AC_CANONICAL_TARGET:
https://github.com/kraj/poky/blob/master/meta/recipes-devtools/python/python3/0001-bpo-36852-proper-detection-of-mips-architecture-for-.patch
Patch Subject: [PATCH] bpo-36852: proper detection of mips architecture for soft
 float
From: Matthias Schoepfer <matthias.schoepfer@ithinx.io>


To make script ./configure and compilation works with i686-pc-linux-gnu platform, bypass mips patch by removing entry patch from ../meta/recipes-devtools/python/python3_3.7.6.bb
Comment 5 Matthias Schöpfer 2020-03-24 20:29:23 UTC
(In reply to comment #4)
> bug reopen (do not take into account for my comments 1 and 2)
> 
> regression from mips platform dectection patch AC_CANONICAL_TARGET:
> https://github.com/kraj/poky/blob/master/meta/recipes-devtools/python/
> python3/0001-bpo-36852-proper-detection-of-mips-architecture-for-.patch
> Patch Subject: [PATCH] bpo-36852: proper detection of mips architecture for
> soft
>  float
> From: Matthias Schoepfer <matthias.schoepfer@ithinx.io>
> 
> 
> To make script ./configure and compilation works with i686-pc-linux-gnu
> platform, bypass mips patch by removing entry patch from
> ../meta/recipes-devtools/python/python3_3.7.6.bb

Hi Khoja,

Thanks for reporting. I just built it on my PC with no issues, now I will rerun on Ubuntu 18.04 to see if I can reproduce. 

Regards, 

  Matthias
Comment 6 Matthias Schöpfer 2020-03-24 22:28:38 UTC
Hi Khoja,

so I ran it on Ubuntu:

jenkins@sl-hw-u101:~/qemu-test$  lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.3 LTS
Release:	18.04
Codename:	bionic


jenkins@sl-hw-u101:~/qemu-test$ bitbake core-image-minimal
Parsing recipes: 100% |#############################################################################################################################################################################| Time: 0:00:07
Parsing of 772 .bb files complete (0 cached, 772 parsed). 1300 targets, 41 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION           = "1.44.0"
BUILD_SYS            = "x86_64-linux"
NATIVELSBSTRING      = "ubuntu-18.04"
TARGET_SYS           = "x86_64-poky-linux"
MACHINE              = "qemux86-64"
DISTRO               = "poky"
DISTRO_VERSION       = "3.0.2"
TUNE_FEATURES        = "m64 core2"
TARGET_FPU           = ""
meta                 
meta-poky            
meta-yocto-bsp       = "zeus:f9ef210967ab34168d4a24930987dc0731baf56f"

NOTE: Fetching uninative binary shim from http://downloads.yoctoproject.org/releases/uninative/2.8/x86_64-nativesdk-libc.tar.xz;sha256sum=a09922172c3a439105e0ae6b943daad2d83505b17da0aba97961ff433b8c21ab
Initialising tasks: 100% |##########################################################################################################################################################################| Time: 0:00:00
Sstate summary: Wanted 820 Found 0 Missed 820 Current 0 (0% match, 0% complete)
NOTE: Executing Tasks
NOTE: Setscene tasks completed
NOTE: Tasks Summary: Attempted 2664 tasks of which 1 didn't need to be rerun and all succeeded.


I am sorry, but it worked for me. From looking at it, you run a 32-bit OS and build for 64 bit, is that correct? Maybe, that is the problem... I will look into it tomorrow if I find the time...
Comment 7 khoja 2020-03-25 09:03:30 UTC
Yes, It is correct. I run a 32-bit OS and build for 64 bit.
Comment 8 Randy MacLeod 2020-03-26 14:38:52 UTC
Matthias, are you able to work on this?
Comment 9 Matthias Schöpfer 2020-03-26 14:44:27 UTC
Yes, but I first have to install a 32bit ubuntu in a VM... And work on the things that pay the rent at the end of the month. But yes, I will try to investigate...
Comment 10 khoja 2020-03-26 22:23:02 UTC
Take your time Matthias and I thank you to investigate.

Today, by removing mips patch 0001-bpo-36852..., I succeeded to work with poky distro with core-image-minimal and core-image-sato rootfs images on qemux86_64 simulator. 

Another information to take into account, I tried previous warrior branch and same do_configure bug is detected too.
Comment 11 Matthias Schöpfer 2020-03-27 15:24:34 UTC
Created attachment 4654 [details]
Updated patch

Updated Patch
Comment 12 Matthias Schöpfer 2020-03-27 15:26:49 UTC
Hi!

I think I fixed it. See updated patch. The Problem was, that AC_CANONOCAL_TARGET returns i686, while gcc returns i386, which is considered a mismatch. 

I have no idea where and how I should submit this. A patch of a patch... mailing list? 

Regards,

  Matthias
Comment 13 Randy MacLeod 2020-03-27 15:47:27 UTC
Matthias, That's great. Please send the commit on the master branch to openembedded-core@lists.openembedded.org as described in:
https://www.openembedded.org/wiki/How_to_submit_a_patch_to_OpenEmbedded

Let us know if you have any other questions ask here or if you use IRC, I'm 'vmeson' on IRC on Freenode.
Comment 14 Matthias Schöpfer 2020-03-27 18:42:42 UTC
Thanks, I managed to get a patch on the list. I hope I did not forget anything.
Comment 15 Matthias Schöpfer 2020-04-07 11:04:59 UTC
Patch is here: 
https://lists.openembedded.org/g/openembedded-core/message/136849?p=,,,20,0,0,0::Created,,python3%3A+fixing,20,2,0,72648525

I think this can be closed?!
Comment 16 Randy MacLeod 2020-04-07 18:47:12 UTC
Fixed by:
https://git.openembedded.org/openembedded-core/commit/?h=dunfell&id=6beab388e73b3ac6157650855a6c1fb1d71e8015

Which is included in:
$ git branch -a --contains 6beab388e73b3ac6157650855a6c1fb1d71e8015
* master
  master-next
  remotes/origin/HEAD -> origin/master
  remotes/origin/dunfell
  remotes/origin/master
  remotes/origin/master-next

Thanks Matthias.

Khoja, Is having the fix in 3.1 and later sufficient for you? If not someone will have to backport it to 3.0.x. and send the patch to the list and CC Armin Kuster.