Cant get legato source

$ leaf getsrc legato
Run sync steps for fx30-cat1-legato-src_19.11.5

Ready to sync in /home/suneel/myWorkspace/legato-src directory:
repo init -u ssh://git@github.com/legatoproject/manifest -m legato/releases/19.11.5/legato.xml -g default,proprietary ; repo sync

Proceed? (Y/n)
Y
Checking credentials…

  • File “/home/suneel/myWorkspace/legato-src/.repo/repo/main.py”, line 79*
  • file=sys.stderr)*

SyntaxError: invalid syntax
ERROR:

  • Something went wrong with repo command*
    HINTS:
  • Please check connection and credentials*
  • Then try again leaf getsrc legato*

I found that the python2.7 is the problem when I changed to python3 I got the following error :
$ leaf getsrc legato
Run sync steps for fx30-cat1-legato-src_19.11.5

Ready to sync in /home/suneel/myWorkspace/legato-src directory:
repo init -u ssh://git@github.com/legatoproject/manifest -m legato/releases/19.11.5/legato.xml -g default,proprietary ; repo sync

Proceed? (Y/n)
Y
Checking credentials…
warning: Python 3 support is currently experimental. YMMV.
Please use Python 2.6 - 2.7 instead.
Traceback (most recent call last):

  • File “/home/suneel/myWorkspace/legato-src/.repo/repo/main.py”, line 38, in *
  • from color import SetDefaultColoring*
  • File “/home/suneel/myWorkspace/legato-src/.repo/repo/color.py”, line 18, in *
  • import pager*
  • File “/home/suneel/myWorkspace/legato-src/.repo/repo/pager.py”, line 63*
  • sys.exit(f’fatal: cannot start pager “{pager}”')*

SyntaxError: invalid syntax
ERROR:

  • Something went wrong with repo command*
    HINTS:
  • Please check connection and credentials*
  • Then try again leaf getsrc legato*

you can see here on how to use repo with python3:

You can see here for an example on downloading WP76 yocto source from Github: (it also uses repo with python3)

The solution is to use python3 with repo. Which means I will have to change a lot of scripts in legeto framework which I dont want to do as it demands maintenance.

What is the official statement on this issue ? I see with leaf it should just work. Is this a known issue and is someone working on it ?

Repo is for downloading code, not in legato framework

Btw, a lot of user can download

You can also try in Ubuntu16 or Ubuntu18 in VMwware

By Legato framework I mean the legato development environment which is basically leaf. Leaf internally uses repo. It creates a dir .repo in legaro-src dir when you enter leaf getsrc legato and the solution above is to change this .repo to point to python3. This is a hack which I want to avoid . As there is no where in the documentation it is mentioned that python3 is needed. Infact leaf has dependencies on python2 not python3.

Don’t know why you cannot use python2 then…
You can also try in Ubuntu16 or Ubuntu18 in VMwware

Anyways I tried the above solution as well. But I am getting other errors:

Run sync steps for fx30-cat1-legato-src_19.11.5

Ready to sync in /home/suneel/myWorkspace/legato-src directory:
repo init -u ssh://git@github.com/legatoproject/manifest -m legato/releases/19.11.5/legato.xml -g default,proprietary ; repo sync

Proceed? (Y/n)
Y
Checking credentials…
Traceback (most recent call last):
File “/home/suneel/myWorkspace/legato-src/.repo/repo/main.py”, line 38, in
from color import SetDefaultColoring
File “/home/suneel/myWorkspace/legato-src/.repo/repo/color.py”, line 18, in
import pager
File “/home/suneel/myWorkspace/legato-src/.repo/repo/pager.py”, line 63
sys.exit(f’fatal: cannot start pager “{pager}”')
^
SyntaxError: invalid syntax
ERROR:
Something went wrong with repo command
HINTS:
Please check connection and credentials
Then try again leaf getsrc legato

Did you install pager?
pip install pager

It is installed. The problem is why it is reporting syntax error ?

no idea, i don’t have much experience in python…
did you see problem on Ubuntu 16 or Ubuntu 18?

16
Distributor ID: Ubuntu
Description: Ubuntu 16.04.7 LTS
Release: 16.04
Codename: xenial

Here is my environment in ubuntu 16 with VSCode to download leaf package :

owner@CNHKG-EX-001367:~/QMI/MBPL/R23/USB$ leaf --version
leaf version 2.1
owner@CNHKG-EX-001367:~/QMI/MBPL/R23/USB$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.7 LTS
Release:	16.04
Codename:	xenial
owner@CNHKG-EX-001367:~/QMI/MBPL/R23/USB$ python --version
Python 2.7.9
owner@CNHKG-EX-001367:~/QMI/MBPL/R23/USB$ python3 --version
Python 3.5.3

Other user also makes it work on Ubuntu18 VM machine: