[SERVER-41424] scons should fail early if invoked with wrong Python interpreter Created: 31/May/19 Updated: 29/Oct/23 Resolved: 12/Jun/19 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Build |
| Affects Version/s: | None |
| Fix Version/s: | 3.4.22, 3.6.14, 4.0.11 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Geert Bosch | Assignee: | Mathew Robinson (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Backport Requested: |
v3.6, v3.4
|
||||||||
| Sprint: | Dev Tools 2019-06-17 | ||||||||
| Participants: | |||||||||
| Linked BF Score: | 0 | ||||||||
| Description |
|
When on a 4.0 branch and running scons with Python3, it fails with a cryptic error message, causing lots of developer time to be wasted in trying to figure out what went wrong. A simple early check for the correct Python version would help a lot |
| Comments |
| Comment by Githook User [ 12/Jun/19 ] | ||||||||
|
Author: {'name': 'Mathew Robinson', 'email': 'chasinglogic@gmail.com', 'username': 'chasinglogic'}Message: (cherry picked from commit c517556ca985f60b52b983049410cb278c919434) | ||||||||
| Comment by Githook User [ 12/Jun/19 ] | ||||||||
|
Author: {'name': 'Mathew Robinson', 'email': 'chasinglogic@gmail.com', 'username': 'chasinglogic'}Message: (cherry picked from commit c517556ca985f60b52b983049410cb278c919434) | ||||||||
| Comment by Githook User [ 12/Jun/19 ] | ||||||||
|
Author: {'name': 'Mathew Robinson', 'email': 'chasinglogic@gmail.com', 'username': 'chasinglogic'}Message: | ||||||||
| Comment by Githook User [ 12/Jun/19 ] | ||||||||
|
Author: {'name': 'Mathew Robinson', 'email': 'chasinglogic@gmail.com', 'username': 'chasinglogic'}Message: (cherry picked from commit 6a8f5d33543088dbf39b26275fb2a90cbd466cf5) | ||||||||
| Comment by Githook User [ 12/Jun/19 ] | ||||||||
|
Author: {'name': 'Mathew Robinson', 'email': 'chasinglogic@gmail.com', 'username': 'chasinglogic'}Message: (cherry picked from commit 6a8f5d33543088dbf39b26275fb2a90cbd466cf5) | ||||||||
| Comment by Githook User [ 12/Jun/19 ] | ||||||||
|
Author: {'name': 'Mathew Robinson', 'email': 'chasinglogic@gmail.com', 'username': 'chasinglogic'}Message: | ||||||||
| Comment by Mathew Robinson (Inactive) [ 11/Jun/19 ] | ||||||||
|
So it appears the actual error is not that the buildscripts/scons.py file is not compatible with Py2+3 but that SCons is not compatible with Python 3. This means that our EnsurePythonVersion never gets run and instead you get the following stack trace (from scons itself):
I've added a a version check to buildscripts/scons.py before it imports SCons. While it's unfortunate that we need to basically duplicate EnsurePythonVersion but even if we backported the SCons upgrade to 3.0.4 it would still fail because EnsurePythonVersion allows any version equal to or greater. Meaning Python 3 would still pass that check and then fail on our SConscripts since they're only Python 2 compatible. | ||||||||
| Comment by Andrew Morrow (Inactive) [ 07/Jun/19 ] | ||||||||
|
The issue here is that buildscripts/scons.py on some older branches isn't py3 compatible. We should ensure that buildscripts/scons.py is py2 and py3 compatible on all branches. It appears that this is already the case for master and v4.2, however, we should update the file to contain documentation at the top stating that it must remain that way. So we should do that on master and backport to v4.2. For the older branches (v4.0, v3.6, and v3.4), we should update the file to be also compatible with py3, and add the same documentation to the file stating that it must remain that way. mathew.robinson, I'm handing this ticket over to you to make the necessary changes. It isn't our most pressing issue, so I'm going to kick it to the next sprint too. |