ARMmbed / mbed-cli

Arm Mbed Command Line Interface
https://os.mbed.com
Apache License 2.0
333 stars 176 forks source link

mbed-cli doesn't work with python3 on Ubuntu 18.04 #836

Closed yogpan01 closed 5 years ago

yogpan01 commented 5 years ago

Ubuntu 18.04 now comes by default with python3 support and pip support is also through python3. Using mbed-cli is now giving warning and sometimes weird failures failing to link the application because of some incompatible python code.

For example, I am trying to compile an application which requires to be built for ARMC6 but it fails in linking for me, even though I am using newer than 5.8 version of MbedOS.

 xxxx@ubuntu:~/example(master)$ mbed compile -t ARMC6 -m NUMAKER_PFM_M2351 --app-config configs/wifi_esp8266_v4.json
[mbed] WARNING: If you're using Python 3 with Mbed OS 5.8 and earlier versions, Python errors will occur when compiling, testing and exporting
---
[mbed] Working path "/home/yogpan01/example/mbed-client-example" (library)
[mbed] Program path "/home/yogpan01/example/mbed-client-example"
Building project mbed-client-example (NUMAKER_PFM_M2351, ARMC6)
Scan: mbed-client-lite-example-restricted
Link: mbed-client-lite-example-restricted
b"Warning: L3912W: Option 'legacyalign' is deprecated."
[ERROR] can't concat str to bytes
[mbed] ERROR: "/usr/bin/python3" returned error.
       Code: 1
       Path: "/home/xxxx/example/mbed-client-example"
       Command: "/usr/bin/python3 -u /home/yogpan01/example/mbed-client-example/mbed-os/tools/make.py -t ARMC6 -m NUMAKER_PFM_M2351 --source . --build ./BUILD/NUMAKER_PFM_M2351/ARMC6 --app-config configs/wifi_esp8266_v4.json"
       Tip: You could retry the last command with "-v" flag for verbose output
---
[mbed] WARNING: Using Python 3 with Mbed OS 5.8 and earlier can cause errors with compiling, testing and exporting
---
screamerbg commented 5 years ago

@yogpan01 Thanks for the bug report

ciarmcom commented 5 years ago

Internal Jira reference: https://jira.arm.com/browse/MBOCUSTRIA-826

cmonr commented 5 years ago

@yogpan01 Cna you provide which version of Mbed OS you're using, as well the output of pip list?

cmonr commented 5 years ago

Also, as a rule of thumb, using verbose output when debugging is generally really helpful.

Would appreciate seeing the more verbose log.

cmonr commented 5 years ago

@yogpan01 @screamerbg Please retest this with a fresh Mbed OS master branch pull.

https://github.com/ARMmbed/mbed-os/pull/9673 came in today which fixed a parsing error when using Py3 that looks like it was also affecting this PR.

If not, please provide more verbose output by also using the -v flag.

yogpan01 commented 5 years ago

It works fine on MbedOS master, when we can have this fix for any mbed-os official release?

vmedcy commented 5 years ago

@yogpan01: ARMmbed/mbed-os#9673 targets 5.11.5 which is planned for the next week I guess.

cmonr commented 5 years ago

@yogpan01 @vmedcy is correct. The fix will be released with 5.11.5.

Additionally, looking at adding compile capabilities against all supported Python versions to make sure regressions aren't encountered, but not sure if this update will make it in time for 5.11.5.

Closing since issue is confirmed fixed and in master.

cmonr commented 5 years ago

@yogpan01 My mistake. Also saw the internal comment. Will keep open until 5.11.5 RC PR is created and merged.

cmonr commented 5 years ago

Closing since 5.11.5 is now released.