Closed Bug 601676 Opened 15 years ago Closed 15 years ago

Configure should reject python3

Categories

(Firefox Build System :: General, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: fredbezies, Assigned: jorendorff)

References

Details

(Whiteboard: [fixed-in-tracemonkey])

Attachments

(1 file, 1 obsolete file)

User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:2.0b7pre) Gecko/20100101 Firefox/4.0b7pre Build Identifier: I cannot get Minefield to be built with python3 I typed make -f client.mk depend and get this : creating memory/Makefile creating other-licenses/bsdiff/Makefile creating parser/Makefile File "/home/fred/logs/fox/src/config/make-stl-wrappers.py", line 55 raise NotImplementedError, compiler ^ SyntaxError: invalid syntax make[2]: *** [../dist/stl_wrappers/sentinel] Erreur 1 make[2]: *** Attente des tâches non terminées.... File "/home/fred/logs/fox/src/toolkit/xre/make-platformini.py", line 17 print datetime.now().strftime('%Y%m%d%H%M%S') ^ SyntaxError: invalid syntax make[2]: *** [export] Erreur 1 make[1]: *** [export] Erreur 2 make: *** [depend] Erreur 2 Reproducible: Always Steps to Reproduce: 1.Upgrade python to python 3 2.Launch "make -f client.mk depend" 3.wait Actual Results: See log Expected Results: build process going on ? python : [fred@fredo-arch src]$ python Python 3.1.2 (r312:79147, Oct 4 2010, 12:45:09) [GCC 4.5.1] on linux2 Type "help", "copyright", "credits" or "license" for more information.
Component: General → Build Config
QA Contact: general → build-config
Indeed, our configure script should check to make sure you are using python 2.x, since we don't support python 3, and probably won't any time soon. Patches accepted.
Summary: Build process is broken with python3 → Configure should reject python3
Well, under Archlinux, there is access to old python (aka python 2) using /usr/bin/python2. See http://allanmcrae.com/2010/10/big-python-transition-in-arch-linux/ I'm not really a coder, but is there an option to search for python2 as an option to be real python 2 interpreter ?
I was trying to modify the end of this line by replacing python by python2. Good idea or the worse one you can imagine ? I'm not a coder, just a user :) At least, make -f client.mk depend worked ;)
For a patch, we wouldn't want to replace python with python2, but you could insert python2 before python in that list. (We want to support distros where `python` is python 2.)
Or add python2.7 in the beginning of the list ? I have on my computer this when I do a little ls /usr/bin/python??? [fred@fredo-arch ~]$ ls /usr/bin/python??? /usr/bin/python2.7 /usr/bin/python3.1 So, what about python 2.7 in top of the list ?
Indeed. Here is the configure.in line for comm-central source : http://mxr.mozilla.org/comm-central/source/configure.in#899 MOZ_PATH_PROGS(PYTHON, $PYTHON python2.7 python2.6 python2.5 python) Strange it is not the same for firefox ;)
(In reply to comment #8) > Indeed. Here is the configure.in line for comm-central source : > > http://mxr.mozilla.org/comm-central/source/configure.in#899 > > MOZ_PATH_PROGS(PYTHON, $PYTHON python2.7 python2.6 python2.5 python) > > Strange it is not the same for firefox ;) Serge I vaguely recall you having done this part for m-c, and I know I like to keep this stuff in sync. Which bug was that and if reviewed, is there a major reason it has not landed yet?
(In reply to comment #9) > Which bug was that and if reviewed, is there a major > reason it has not landed yet? Bug 599737. m-c has been 'APPROVAL REQUIRED' for "ages"...
Depends on: 599737
Version: unspecified → Trunk
fwiw, the patch in that bug doesn't add python 2.7. Even after we fix that, we should still error explicitly if the python version we end up with is python 3. Lets move the 2.7 stuff to the other bug.
Don't know if it is related, but freshly homemade - both minefield or shredder - builds are stuck on start. They eat 100% CPU, and don't show anything. I modified configure.in to make it use python 2.7 instead of python3... I'm kinda fed up with python3 !
Well, as python3 is rejected in shredder client.py file, could it be possible to add python2.7 in supported versions ? Thanks !
As a workaround, I added this line in my .mozconfig : export PYTHON=python2.7
Attached patch v1 (obsolete) — Splinter Review
This makes configure test for and reject Python 3. It also adds python2 to the list. This is what ted suggested on IRC. But thinking about it more, adding python2 isn't necessary to fix any issue I'm aware of. The problem in bug 617596 is due to python2.7 not being on the list in js/src/configure.in. So maybe we shouldn't do that. And instead of testing for Python 3, maybe we should just remove bare 'python' from the list. Python executables have been installed under minor-version-specific names since forever. (On Windows, configure ordinarily finds python2.6.exe, which comes with MozillaBuild.)
Assignee: nobody → jorendorff
Attachment #496512 - Flags: review?(ted.mielczarek)
Attachment #496512 - Attachment is patch: true
Attachment #496512 - Attachment mime type: application/octet-stream → text/plain
Comment on attachment 496512 [details] [diff] [review] v1 Just change the existing version test to reject Python 3: http://mxr.mozilla.org/mozilla-central/source/configure.in#1917
Attachment #496512 - Flags: review?(ted.mielczarek) → review-
I don't really care what you want to do with the "list of things we look for as Python", but I feel like keeping 'python' in that list is still the right thing to do, since it's much more likely to be Python 2.x than 3.x at this point.
Attached patch v2Splinter Review
Attachment #496512 - Attachment is obsolete: true
Attachment #496594 - Flags: review?(ted.mielczarek)
Comment on attachment 496594 [details] [diff] [review] v2 Didn't you want to change the root configure.in to look for python2.7 as well?
Attachment #496594 - Flags: review?(ted.mielczarek) → review+
Comment on attachment 496594 [details] [diff] [review] v2 >-$PYTHON -c "import sys; sys.exit(sys.version[:3] < sys.argv[1])" $PYTHON_VERSION >+$PYTHON -c "import sys; sys.exit(sys.version[:3] < sys.argv[1] or sys.version[:2] != '2.')" $PYTHON_VERSION Umm shouldn't the conditions with the or be switched, what if Python 3.6 || 3.7 is released in the near future, then we'll pass this [incorrectly] right?
Attachment #496594 - Flags: feedback-
No, $PYTHON_VERSION is 2.5, so 3.6 would still fail this condition (because of the new check).
(In reply to comment #21) > No, $PYTHON_VERSION is 2.5, so 3.6 would still fail this condition (because of > the new check). O right... I was thinking sys.version as an array slice not a string slice. nevermind.
Attachment #496594 - Flags: feedback- → feedback+
(In reply to comment #19) > Didn't you want to change the root configure.in to look for python2.7 as well? It already does. The two configure.in files had gotten out of sync; that's why Arch folks are having trouble with js/src (only).
As an arch folk (as you say) I use this workaround in my .mozconfig : export PYTHON=python2.7 and build process goes on. And for python, on arch (at least) : [fred@fredo-arch bin]$ ls -al python lrwxrwxrwx 1 root root 7 1 déc. 13:27 python -> python3
Frederic, you almost certainly won't need that workaround once this change lands. https://hg.mozilla.org/tracemonkey/rev/7a224fae3c55
Whiteboard: [fixed-in-tracemonkey]
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: