Repo Error - Arch Linux x86_64

885 views
Skip to first unread message

Neil Perry

unread,
Jan 10, 2011, 4:12:38 AM1/10/11
to Android Building
When I run the repo init command I get an error.


File "/usr/bin/repo", line 175
except OSError, e:
^
SyntaxError: invalid syntax


Just moved from Ubuntu to Arch, hopefully I can still build in Arch.

Thanks

Neil

Al Sutton

unread,
Jan 10, 2011, 11:53:57 AM1/10/11
to android-...@googlegroups.com
Have you compared the python versions on each?

Al.

> --
> You received this message because you are subscribed to the "Android Building" mailing list.
> To post to this group, send email to android-...@googlegroups.com
> To unsubscribe from this group, send email to
> android-buildi...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-building?hl=en

Jean-Baptiste Queru

unread,
Jan 10, 2011, 11:54:28 AM1/10/11
to android-...@googlegroups.com
I have no direct expertise in that domain, but there's a good chance
that the people who do will want to know which version of python
you're using.

JBQ

> --
> You received this message because you are subscribed to the "Android Building" mailing list.
> To post to this group, send email to android-...@googlegroups.com
> To unsubscribe from this group, send email to
> android-buildi...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-building?hl=en
>

--
Jean-Baptiste M. "JBQ" Queru
Software Engineer, Android Open-Source Project, Google.

Questions sent directly to me that have no reason for being private
will likely get ignored or forwarded to a public forum with no further
warning.

Neil Perry

unread,
Jan 10, 2011, 1:11:40 PM1/10/11
to Android Building
Seems I'm using Python3. I take it this is the problem, lets install
python2 and make it run against that..

Fingers crossed,

Thanks

Neil

Neil Perry

unread,
Jan 10, 2011, 1:27:20 PM1/10/11
to Android Building
Right I've changed the file slightly to make sure it runs python2.7
rather then python3, but gives the follow error.

File "/usr/bin/repo", line 389
cmd = [GIT, 'tag', '-v', cur env = env)
^
Have I missed something out?

Al Sutton

unread,
Jan 10, 2011, 1:33:19 PM1/10/11
to android-...@googlegroups.com
Repo has an update mechanism, so, I may be going off at a bit of a tangent, but do you really want to start modifying it?

Is there any reason not to download Python 2.4, compile it into a directory in your home directory, and then put that on your environment path before everything else when you want to use it?

Al.

David Barrera

unread,
Jan 10, 2011, 1:31:44 PM1/10/11
to android-...@googlegroups.com
Arch has moved to python3 as the default, meaning there's a symlink
/usr/bin/python that points to /usr/bin/python3 . there's a few python
scripts that get run during the Android build process, and they all
use /usr/bin/python. Manually changing each #! statement in each
script to point to python2 seemed like too much work, so i just made
/usr/bin/python point to /usr/bin/python2 during the build, and then
reverted the change once the build was done (since arch expects it to
point to python3).

Hope that helps.

--
David

Neil Perry

unread,
Jan 10, 2011, 2:51:29 PM1/10/11
to Android Building
David,

Thanks for that. That seemed to work..

Thanks

Neil

Neil Perry

unread,
Jan 10, 2011, 3:10:08 PM1/10/11
to Android Building
David,

Wonder if you could help me (As I know I'm going to hit this brick
wall once repo sync is done)

What packages in arch is required to build?

Thanks

Neil

On Jan 10, 6:31 pm, David Barrera <davi...@gmail.com> wrote:

David Barrera

unread,
Jan 10, 2011, 4:56:24 PM1/10/11
to android-...@googlegroups.com
first you need jdk

then standard packages to build 32 bit binaries on 64 bit so :

gcc-multilib gcc-libs-multilib binutils-multilib libtool-multilib
lib32-glibc (from
https://wiki.archlinux.org/index.php/Arch64_FAQ#Can_I_build_32-bit_packages_for_i686_inside_Arch64.3F)

and then i think lib32-readline is required as well as a few other
lib32 libs but i can't remember specific ones off the top of my head.
if the build fails just look at the error and it will tell you what
library was being accessed. then you have to install the
lib32-(library) that matches.

Magnus Bäck

unread,
Dec 27, 2012, 3:33:10 PM12/27/12
to android-...@googlegroups.com, repo-d...@googlegroups.com
+repo-discuss

On Thursday, December 27, 2012 at 15:00 EST,
James Fallon <j.fall...@gmail.com> wrote:

> I know this is an old thread and all but...
>
> I'm new to arch, but have compiled android (and cm) before on ubuntu.
> Could you tell me what exactly you changed in the repo program (if
> that is correct) to change python only when the program is in use and
> to revert it afterwards. I don't want to put in bad code and break
> repo or break my arch's python install :S

This has been fixed in Repo (commit a5be53f) but the bootstrap script
that's available for download via HTTP is still an old version that
isn't compatible with Python 3. You can get the new Repo script and
replace your existing copy (in ~/bin or whereever you put it):

git clone https://android.googlesource.com/tools/repo -b stable
cp repo/repo `which repo`

Conley/Shawn, perhaps time to release 1.18 of the Repo bootstrapper
to dl-ssl.google.com?

--
Magnus Bäck
ba...@google.com

Magnus Bäck

unread,
Dec 28, 2012, 12:24:42 PM12/28/12
to repo-d...@googlegroups.com
Moved android-building to bcc. Let's continue the thread in
repo-discuss where it belongs.

On Friday, December 28, 2012 at 11:32 EST,
James Fallon <j.fall...@gmail.com> wrote:

> Thanks for the tip, but now I get this error:
>
> [CODE]
> [fallon@localhost bin]$ repo
> File "/home/fallon/bin/repo", line 311
> os.mkdir(gpg_dir, 0700)
> ^
> SyntaxError: invalid token
> [/CODE]

Python 3 requires octal integer literals to be prefixed by 0o or 0O
rather than just 0. So, replace 0700 with 0o700. A quick grep of the
source code indicated that there aren't any other octal literals in
the code. Hopefully this is the last Python 3 incompatibility. I can
upload a patch.

http://www.python.org/dev/peps/pep-3127/

--
Magnus Bäck
ba...@google.com

Magnus Bäck

unread,
Dec 28, 2012, 4:20:37 PM12/28/12
to repo-d...@googlegroups.com
Moving android-building to bcc, again.

On Friday, December 28, 2012 at 15:21 EST,
James Fallon <j.fall...@gmail.com> wrote:

> right, I tried again, with the edit but now i get this error:
> [CODE]
> [fallon@localhost android]$ repo init -u
> git://github.com/CyanogenMod/android.git -b cm-10.1
> Traceback (most recent call last):
> File "/home/fallon/bin/repo", line 125, in <module>
> import urllib2
> ImportError: No module named 'urllib2'
> [/CODE]
>
> I have tried searching around for the urlib2 package, but i could not
> find it. Any that I found were for python 2??
> Thanks for the help though :D

See my most recent response (14:23 EST) to get a bootstrap script that
works. I'd assume you also need to pass --repo-branch=master to "repo
init" so you get the most recent Python 3 compatibility corrections for
the rest of Repo since they aren't available in the stable branch that
Repo picks up by default.

--
Magnus Bäck
ba...@google.com
Reply all
Reply to author
Forward
0 new messages