Discussion:
[Scons-users] scons 3 print syntax change breaks serf build
Ryan Schmidt
2017-09-27 19:26:44 UTC
Permalink
Hello, I'm a developer with the MacPorts package management system.

We've noticed [1] that serf 1.3.8 cannot be built with scons 3.0.0. The error is:



File "/path/to/SConstruct", line 181
print 'Unknown variables:', ', '.join(unknown.keys())
^
SyntaxError: invalid syntax



There is no problem building serf 1.3.8 with scons 2.5.1, so this is a regression.

It's as if scons 3 is requiring print to be a function as in python 3, instead of a statement as in python 2, although our scons should still be running with python 2.7. (Perhaps our scons is using python 3 inadvertently -- how would we check for that, and correct it?)

Even your own scons 3 documentation [2] shows a sample SConstruct file with print being used as a statement, and this same error occurring as a result!

I'm assuming this change in the way scons expects print to be used is an unintentional bug...


[1] https://trac.macports.org/ticket/54915

[2] http://scons.org/doc/3.0.0/HTML/scons-user/ch08s02.html
Tim Jenness
2017-09-27 19:39:16 UTC
Permalink
This was fixed last week on master. I don’t know the timeline for a 3.0.1 release.

See https://github.com/SConsProject/scons/pull/1
Post by Ryan Schmidt
Hello, I'm a developer with the MacPorts package management system.
File "/path/to/SConstruct", line 181
print 'Unknown variables:', ', '.join(unknown.keys())
^
SyntaxError: invalid syntax
There is no problem building serf 1.3.8 with scons 2.5.1, so this is a regression.
It's as if scons 3 is requiring print to be a function as in python 3, instead of a statement as in python 2, although our scons should still be running with python 2.7. (Perhaps our scons is using python 3 inadvertently -- how would we check for that, and correct it?)
Even your own scons 3 documentation [2] shows a sample SConstruct file with print being used as a statement, and this same error occurring as a result!
I'm assuming this change in the way scons expects print to be used is an unintentional bug...
[1] https://trac.macports.org/ticket/54915
[2] http://scons.org/doc/3.0.0/HTML/scons-user/ch08s02.html
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
Mats Wichmann
2017-09-27 19:45:09 UTC
Permalink
Post by Tim Jenness
This was fixed last week on master. I don’t know the timeline for a 3.0.1 release.
See https://github.com/SConsProject/scons/pull/1
well, it's quite explicitly stated that print has to look like in Py3.
In the release notes:

There are some important changes:

- Any print statements must now use python 3 syntax of "print()"

the bugfix was more obscure and related to an automatic import of
print_function, which wasn't necessarily a good idea.
Post by Tim Jenness
Post by Ryan Schmidt
Hello, I'm a developer with the MacPorts package management system.
File "/path/to/SConstruct", line 181
print 'Unknown variables:', ', '.join(unknown.keys())
^
SyntaxError: invalid syntax
There is no problem building serf 1.3.8 with scons 2.5.1, so this is a regression.
It's as if scons 3 is requiring print to be a function as in python 3, instead of a statement as in python 2,
Ryan Schmidt
2017-09-27 19:40:30 UTC
Permalink
My apologies; I found it after I sent my message. (I had searched your issue tracker and mailing list, but not commits or pull requests.) Glad it's an easy fix!
Post by Tim Jenness
This was fixed last week on master. I don’t know the timeline for a 3.0.1 release.
See https://github.com/SConsProject/scons/pull/1
Post by Ryan Schmidt
Hello, I'm a developer with the MacPorts package management system.
File "/path/to/SConstruct", line 181
print 'Unknown variables:', ', '.join(unknown.keys())
^
SyntaxError: invalid syntax
There is no problem building serf 1.3.8 with scons 2.5.1, so this is a regression.
It's as if scons 3 is requiring print to be a function as in python 3, instead of a statement as in python 2, although our scons should still be running with python 2.7. (Perhaps our scons is using python 3 inadvertently -- how would we check for that, and correct it?)
Even your own scons 3 documentation [2] shows a sample SConstruct file with print being used as a statement, and this same error occurring as a result!
I'm assuming this change in the way scons expects print to be used is an unintentional bug...
[1] https://trac.macports.org/ticket/54915
[2] http://scons.org/doc/3.0.0/HTML/scons-user/ch08s02.html
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
Tim Jenness
2017-09-27 19:52:07 UTC
Permalink
Post by Ryan Schmidt
My apologies; I found it after I sent my message. (I had searched your issue tracker and mailing list, but not commits or pull requests.) Glad it's an easy fix!
Not a problem. SCons just moved to GitHub so things are a bit confused (and that PR link I sent you is not the really simple fix because the PR got deleted when the git repo was remade).


Tim Jenness
Thomas Berg
2017-09-27 20:10:15 UTC
Permalink
Here's the actual fix:

https://github.com/SConsProject/scons/commit/2e0de3c55f22b3eaa7767b69740b898f3d2f46bf

Since it was this easy to be backwards compatible, I hope it's not a
controversial change. I would guess I'm not the only one who would like to
be able to bisect and build old revisions of our code without having to
install old scons versions in the future :)

- Thomas
Tim Jenness
2017-09-27 20:12:59 UTC
Permalink
I don’t think it’s controversial. I thought we had agreed a long time ago that the print_function changes should not contaminate user SConstruct files.
https://github.com/SConsProject/scons/commit/2e0de3c55f22b3eaa7767b69740b898f3d2f46bf <https://github.com/SConsProject/scons/commit/2e0de3c55f22b3eaa7767b69740b898f3d2f46bf>
Since it was this easy to be backwards compatible, I hope it's not a controversial change. I would guess I'm not the only one who would like to be able to bisect and build old revisions of our code without having to install old scons versions in the future :)
- Thomas
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
Loading...