If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Building Sync Server with Python3 as the main interpreter

VERIFIED FIXED

Status

Cloud Services
Server: Sync
--
enhancement
VERIFIED FIXED
4 years ago
4 years ago

People

(Reporter: simon, Assigned: rfkelly)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [qa+])

Attachments

(1 attachment)

(Reporter)

Description

4 years ago
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"'
(Reporter)

Updated

4 years ago
Severity: normal → enhancement
OS: All → Linux
Hardware: All → x86_64
Component: Firefox Sync: Build → Server: Sync
Assignee: nobody → rfkelly
(Assignee)

Comment 1

4 years ago
Created attachment 755190 [details] [diff] [review]
Makefile patch to use python2 executable if available

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)
(Reporter)

Comment 2

4 years ago
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+]
(Assignee)

Comment 5

4 years ago
Committed in http://hg.mozilla.org/services/server-full/rev/ea29dd819ea7
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Verified the Makefile change in the latest pull of server-full.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.