Closed Bug 870033 Opened 11 years ago Closed 11 years ago

Building Sync Server with Python3 as the main interpreter

Categories

(Cloud Services Graveyard :: Server: Sync, enhancement)

x86_64
Linux
enhancement
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: simon, Assigned: rfkelly)

Details

(Whiteboard: [qa+])

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Ubuntu Chromium/25.0.1364.160 Chrome/25.0.1364.160 Safari/537.22

Steps to reproduce:

I tried to build and install the Firefox Sync Server on my Gentoo System, which uses python 3 as the main python interpreter, while python 2 is also installed, and on the PATH as /usr/bin/python2


Actual results:

Since the Server is meant to run with python 2, but python 3 was found on the PATH, the build did not succeed and aborted with python errors: http://pastie.org/7819188


Expected results:

If the python version found in the PATH is python 3, look for python2 on the path, which is widely used on different systems to supply an interpreter for python2 on systems with both installations.

My workaround is to explicitly specify that I want to use python 2 with virtualenv, so my build command looks like this: 'make build VIRTUALENV="virtualenv -p python2"'
Severity: normal → enhancement
OS: All → Linux
Hardware: All → x86_64
Component: Firefox Sync: Build → Server: Sync
Assignee: nobody → rfkelly
Here's a simple tweak to the Makefile that seems to work OK for me.  Rather than hard-coding "python" as the interpreter, it uses `which` to search for either "python2" or "python" in the path, and uses the first result found.

So it should explicitly use "python2" on systems that have it, and fall back to "python" on systems that don't.

Please try it out and let me know if it works correctly on your machine.
Attachment #755190 - Flags: review?(telliott)
Flags: needinfo?(simon)
Comment on attachment 755190 [details] [diff] [review]
Makefile patch to use python2 executable if available

Review of attachment 755190 [details] [diff] [review]:
-----------------------------------------------------------------

This works perfectly. Set up with `make build` ran through without issues, testing sync with default test data was successful.
Flags: needinfo?(simon)
Comment on attachment 755190 [details] [diff] [review]
Makefile patch to use python2 executable if available

No concerns from the build angle
Attachment #755190 - Flags: review?(telliott) → review+
:rfkelly
Do we want to commit this?
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Whiteboard: [qa+]
Committed in http://hg.mozilla.org/services/server-full/rev/ea29dd819ea7
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Verified the Makefile change in the latest pull of server-full.
Status: RESOLVED → VERIFIED
Product: Cloud Services → Cloud Services Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: