Bug 1518023 - scons uses Python 3 on SConstruct, contrary to the documentation
Summary: scons uses Python 3 on SConstruct, contrary to the documentation
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: scons
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Mosaab Alzoubi
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-11-27 22:51 UTC by Pavel Roskin
Modified: 2018-01-16 16:05 UTC (History)
7 users (show)

Fixed In Version: scons-3.0.1-5.fc26 scons-3.0.1-5.fc27 scons-3.0.1-5.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-01-09 16:49:25 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Pavel Roskin 2017-11-27 22:51:05 UTC
Description of problem:

I cannot compile gpsd 3.17 because scons runs SConstruct in python 3 and complains about incompatible syntax that is perfectly fine in python 2.

Version-Release number of selected component (if applicable):

scons-3.0.0-1.fc27.noarch

How reproducible:

Always

Steps to Reproduce:
1. git clone git://git.savannah.gnu.org/gpsd.git
2. cd gpsd
3. git checkout release-3.17
4. scons

Actual results:

scons: Reading SConscript files ...
  File "/home/roskinp/src/gpsd/SConstruct", line 378

    print msg

            ^

SyntaxError: Missing parentheses in call to 'print'. Did you mean print(print msg)?


Expected results:

gpsd compiles

Additional info:

From "man scons", the page packaged with scons-3.0.0-1.fc27.noarch

"scons requires Python version 2.7 or later. There should be no other dependencies or requirements to run scons."

Not only does the scons package for Fedora violate that promise, but it also forces python 3 syntax onto its users.

Comment 1 Antonio T. (sagitter) 2017-11-28 11:49:41 UTC
I'm not a Python expert, but even by compiling 'scons' with Python2 those "syntax errors" are still there.

I have modified the 'SConstruct file' in this way:

>>>>>>>>>>>>
--- SConstruct.orig	2017-11-28 12:20:01.236855000 +0100
+++ SConstruct	2017-11-28 12:41:10.749829476 +0100
@@ -375,7 +375,7 @@
 
 def announce(msg):
     if not env.GetOption("silent"):
-        print msg
+        print(msg)
 
 # DESTDIR environment variable means user prefix the installation root.
 DESTDIR = os.environ.get('DESTDIR', '')
@@ -2190,7 +2190,7 @@
         if '-head' not in page:
             fp = open(page)
             if "Valid HTML" in fp.read():
-                print os.path.join(website, os.path.basename(page))
+                print(os.path.join(website, os.path.basename(page)))
             fp.close()
 Utility("validation-list", [www], validation_list)
 
<<<<<<<<<<<<<<

and rebuilt 'scons' without forcing the Python3 interpreter:
https://koji.fedoraproject.org/koji/taskinfo?taskID=23435507

'gspd' is correctly built with:

$ export CFLAGS="fedora optimization flags"
$ python2 /usr/bin/scons

Comment 2 Antonio T. (sagitter) 2017-11-29 22:04:51 UTC
Latest scons-3.0.1 looks compile correctly the 'gpsd' code with:

$ python2 /usr/bin/scons

Comment 3 Martin 2017-12-25 08:56:31 UTC
problem with using python2 manually in command line is that it doesn't work for pre-packaged rpmbuild spec file that already invokes scons without python2. I'm having issue with building from a src.rpm.

It doesn't seem to make sense to run against the stated requirement of scons 3.0.1: only python 2 is supported. This is not leading edge at all, this is clearly running against what the creators of the software intended. Why not distribute scons-for-python3 package or something separately, like we do with python2 and python3?

Comment 4 Antonio T. (sagitter) 2017-12-25 14:50:14 UTC
(In reply to Martin from comment #3)
> It doesn't seem to make sense to run against the stated requirement of scons
> 3.0.1: only python 2 is supported. This is not leading edge at all, this is
> clearly running against what the creators of the software intended. Why not
> distribute scons-for-python3 package or something separately, like we do
> with python2 and python3?

Please, test this new rebuild:
http://copr-fe.cloud.fedoraproject.org/coprs/sagitter/ForTesting/build/691292/

Python2 and Python3 Scons are separated in their own sub-packages:

scons (or python2-scons) and scon-python3 (or python3-scons).

Obviously, they can't share same 'scons' script that it's called 'scons-3' in the scons-python3 package.

Comment 5 Mosaab Alzoubi 2017-12-25 18:31:59 UTC
I'll work around it in next weekend.

Comment 6 Fedora Update System 2017-12-29 22:29:45 UTC
scons-3.0.1-5.el7 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2017-9a4c8472e7

Comment 7 Fedora Update System 2017-12-29 22:30:00 UTC
scons-3.0.1-5.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2017-d2a3899207

Comment 8 Fedora Update System 2017-12-29 22:30:11 UTC
scons-3.0.1-5.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-c335e11d7c

Comment 9 Fedora Update System 2017-12-30 19:17:56 UTC
scons-3.0.1-5.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2017-9a4c8472e7

Comment 10 Fedora Update System 2017-12-30 19:52:27 UTC
scons-3.0.1-5.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-d2a3899207

Comment 11 Fedora Update System 2017-12-30 20:38:20 UTC
scons-3.0.1-5.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-c335e11d7c

Comment 12 Fedora Update System 2018-01-09 16:49:25 UTC
scons-3.0.1-5.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.

Comment 13 Fedora Update System 2018-01-10 02:03:42 UTC
scons-3.0.1-5.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.

Comment 14 Fedora Update System 2018-01-16 16:05:58 UTC
scons-3.0.1-5.el7 has been pushed to the Fedora EPEL 7 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.