Closed
Bug 601676
Opened 14 years ago
Closed 13 years ago
Configure should reject python3
Categories
(Firefox Build System :: General, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: fredbezies, Assigned: jorendorff)
References
Details
(Whiteboard: [fixed-in-tracemonkey])
Attachments
(1 file, 1 obsolete file)
2.44 KB,
patch
|
ted
:
review+
Callek
:
feedback+
|
Details | Diff | Splinter Review |
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.
Updated•14 years ago
|
Component: General → Build Config
QA Contact: general → build-config
Comment 1•14 years ago
|
||
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
Reporter | ||
Comment 2•14 years ago
|
||
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 ?
Yes, see http://mxr.mozilla.org/mozilla-central/source/configure.in#994. I'd image PYTHON=python so we grab python3.
Reporter | ||
Comment 4•14 years ago
|
||
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 ;)
Comment 5•14 years ago
|
||
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.)
Reporter | ||
Comment 6•14 years ago
|
||
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 ?
That works too
Reporter | ||
Comment 8•14 years ago
|
||
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 ;)
Comment 9•14 years ago
|
||
(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?
Comment 10•14 years ago
|
||
(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.
Reporter | ||
Comment 12•14 years ago
|
||
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 !
Reporter | ||
Comment 13•14 years ago
|
||
Well, as python3 is rejected in shredder client.py file, could it be possible to add python2.7 in supported versions ? Thanks !
Reporter | ||
Comment 14•14 years ago
|
||
As a workaround, I added this line in my .mozconfig : export PYTHON=python2.7
Assignee | ||
Comment 15•14 years ago
|
||
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)
Updated•14 years ago
|
Attachment #496512 -
Attachment is patch: true
Attachment #496512 -
Attachment mime type: application/octet-stream → text/plain
Comment 16•14 years ago
|
||
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-
Comment 17•14 years ago
|
||
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.
Assignee | ||
Comment 18•14 years ago
|
||
Attachment #496512 -
Attachment is obsolete: true
Attachment #496594 -
Flags: review?(ted.mielczarek)
Comment 19•14 years ago
|
||
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 20•14 years ago
|
||
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-
Comment 21•14 years ago
|
||
No, $PYTHON_VERSION is 2.5, so 3.6 would still fail this condition (because of the new check).
Comment 22•14 years ago
|
||
(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.
Updated•14 years ago
|
Attachment #496594 -
Flags: feedback- → feedback+
Assignee | ||
Comment 23•14 years ago
|
||
(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).
Reporter | ||
Comment 24•14 years ago
|
||
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
Assignee | ||
Comment 25•14 years ago
|
||
Frederic, you almost certainly won't need that workaround once this change lands. https://hg.mozilla.org/tracemonkey/rev/7a224fae3c55
Whiteboard: [fixed-in-tracemonkey]
Comment 26•13 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/7a224fae3c55
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Updated•6 years ago
|
Product: Core → Firefox Build System
You need to log in
before you can comment on or make changes to this bug.
Description
•