FreeOrion

Forums for the FreeOrion project
It is currently Tue Nov 21, 2017 3:50 pm

All times are UTC




Post new topic Reply to topic  [ 41 posts ]  Go to page 1, 2, 3  Next
Author Message
PostPosted: Sun May 24, 2015 9:41 pm 
Offline
Dyson Forest

Joined: Sun May 11, 2008 10:50 am
Posts: 231
Quote:
[chris@desk build]$ make -j1 -k
File "/home/chris/freeorion-workspace/freeorion.git/cmake/make_versioncpp.py", line 41
print "WARNING: Can't determine git commit, %s not updated!" % self.outfile
^
SyntaxError: Missing parentheses in call to 'print'
CMakeFiles/freeorionversion.dir/build.make:49: die Regel für Ziel „CMakeFiles/freeorionversion“ scheiterte
make[2]: *** [CMakeFiles/freeorionversion] Fehler 1
make[2]: Das Ziel „CMakeFiles/freeorionversion.dir/build“ wurde wegen Fehlern nicht aktualisiert.
CMakeFiles/Makefile2:95: die Regel für Ziel „CMakeFiles/freeorionversion.dir/all“ scheiterte
make[1]: *** [CMakeFiles/freeorionversion.dir/all] Fehler 2


If I change freeorion.git/cmake/make_versioncpp.py so that it calls python2 instead of python (symlinked to python3 on arch linux) that error is gone.

_________________
Attached patches are released under GPL 2.0 or later.


Top
 Profile  
 
PostPosted: Mon May 25, 2015 9:00 am 
Offline
AI Contributor
User avatar

Joined: Tue Jun 24, 2014 9:55 pm
Posts: 444
Chriss wrote:
Quote:
[chris@desk build]$ make -j1 -k
File "/home/chris/freeorion-workspace/freeorion.git/cmake/make_versioncpp.py", line 41
print "WARNING: Can't determine git commit, %s not updated!" % self.outfile
^
SyntaxError: Missing parentheses in call to 'print'
CMakeFiles/freeorionversion.dir/build.make:49: die Regel für Ziel „CMakeFiles/freeorionversion“ scheiterte
make[2]: *** [CMakeFiles/freeorionversion] Fehler 1
make[2]: Das Ziel „CMakeFiles/freeorionversion.dir/build“ wurde wegen Fehlern nicht aktualisiert.
CMakeFiles/Makefile2:95: die Regel für Ziel „CMakeFiles/freeorionversion.dir/all“ scheiterte
make[1]: *** [CMakeFiles/freeorionversion.dir/all] Fehler 2


If I change freeorion.git/cmake/make_versioncpp.py so that it calls python2 instead of python (symlinked to python3 on arch linux) that error is gone.


Will add compatibility if no one fix it in next 8 hours.

_________________
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0


Top
 Profile  
 
PostPosted: Mon May 25, 2015 10:09 am 
Offline
Dyson Forest

Joined: Sun May 11, 2008 10:50 am
Posts: 231
Just for reference: According to this PEP: https://www.python.org/dev/peps/pep-0394/
A script should only have a #/bin/python shebang line if it is source compatible with python2 and python3, otherwise it should explicitly call python2 or python3. So I'd suggest to modify the shebangs accordingly. I think most python code in FO is for python2?

_________________
Attached patches are released under GPL 2.0 or later.


Top
 Profile  
 
PostPosted: Mon May 25, 2015 10:51 am 
Offline
Release Manager, Design
User avatar

Joined: Wed Nov 16, 2011 12:56 pm
Posts: 4243
Location: Sol III
Chriss wrote:
I think most python code in FO is for python2?
All Python code in FO is Python 2.


Top
 Profile  
 
PostPosted: Mon May 25, 2015 11:31 am 
Offline
AI Lead, Programmer
User avatar

Joined: Sat Sep 22, 2012 6:25 pm
Posts: 4374
Chriss wrote:
Just for reference: According to this PEP: https://www.python.org/dev/peps/pep-0394/
A script should only have a #/bin/python shebang line if it is source compatible with python2 and python3, otherwise it should explicitly call python2 or python3. So I'd suggest to modify the shebangs accordingly. I think most python code in FO is for python2?
I've now changed the shebang in this file to refer specifically to python2. The game scripts aren't meant to be run from the command line and don't have a shebang. There is still a make_dmg.py file in the XCode project that uses a plain shebang, but I'll let someone more familiar with it decide for sure what to do with it.

_________________
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0


Top
 Profile  
 
PostPosted: Mon May 25, 2015 11:46 am 
Offline
Dyson Forest

Joined: Sun May 11, 2008 10:50 am
Posts: 231
Thanks. It's working.

This may break compilation or a package on a distro which does not have a python2 symlink. But then, that's an issue with that distro and can be fixed in the package if needed. I don't know about Windows.

_________________
Attached patches are released under GPL 2.0 or later.


Top
 Profile  
 
PostPosted: Mon May 25, 2015 11:56 am 
Offline
Release Manager, Design
User avatar

Joined: Wed Nov 16, 2011 12:56 pm
Posts: 4243
Location: Sol III
Dilvish wrote:
There is still a make_dmg.py file in the XCode project that uses a plain shebang, but I'll let someone more familiar with it decide for sure what to do with it.
Which would be me :mrgreen:

Done.


Top
 Profile  
 
PostPosted: Mon May 25, 2015 11:58 am 
Offline
Release Manager, Design
User avatar

Joined: Wed Nov 16, 2011 12:56 pm
Posts: 4243
Location: Sol III
Chriss wrote:
I don't know about Windows.
I don't think the shebang lines have any relevance on Windows at all.


Top
 Profile  
 
PostPosted: Mon May 25, 2015 6:07 pm 
Offline
Release Manager, Design
User avatar

Joined: Wed Nov 16, 2011 12:56 pm
Posts: 4243
Location: Sol III
Dilvish wrote:
Chriss wrote:
Just for reference: According to this PEP: https://www.python.org/dev/peps/pep-0394/
A script should only have a #/bin/python shebang line if it is source compatible with python2 and python3, otherwise it should explicitly call python2 or python3. So I'd suggest to modify the shebangs accordingly. I think most python code in FO is for python2?
I've now changed the shebang in this file to refer specifically to python2.
Ok, Houston, we've got a problem. Apparently my initial test was sloppy, I just went to the console and typed 'python2' to see if that works on OSX, and it did. But when I tried to build FO right now, I got an error, Xcode complaining that there is no '/usr/bin/python2'. Turned out that 'python2' is in /usr/local/bin on OSX.

Well, crap. What now?


Top
 Profile  
 
PostPosted: Mon May 25, 2015 6:26 pm 
Offline
Programmer
User avatar

Joined: Fri Mar 01, 2013 9:52 am
Posts: 1040
Location: Germany
Vezzra wrote:
Well, crap. What now?


use

#!/usr/bin/env python2

_________________
Resident code gremlin
Attached patches are released under GPL 2.0 or later.
Git author: Marcel Metz


Top
 Profile  
 
PostPosted: Mon May 25, 2015 7:03 pm 
Offline
Release Manager, Design
User avatar

Joined: Wed Nov 16, 2011 12:56 pm
Posts: 4243
Location: Sol III
adrian_broher wrote:
use

#!/usr/bin/env python2
Didn't work either. When Xcode executes a shell script in a custom build phase, it apparently insists on using 'sh' instead of 'bash', without including '/usr/local/bin' into PATH. Consequently it does not find 'python2'. Not an issue anymore, found another solution. I modified the build scripts to call the python interpreter explicitely and passing the script and its arguments as parameters, instead of relying on the shebang line.

Problem solved.


Top
 Profile  
 
PostPosted: Mon May 25, 2015 7:07 pm 
Offline
AI Lead, Programmer
User avatar

Joined: Sat Sep 22, 2012 6:25 pm
Posts: 4374
adrian_broher wrote:
use
#!/usr/bin/env python2
Ok, that's in for make_versioncpp.py now

**edit looks like Vezzra and I crossed paths somewhat here, although I expect this should still be ok-- could you double check that Vezzra?

_________________
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0


Top
 Profile  
 
PostPosted: Mon May 25, 2015 7:19 pm 
Offline
Release Manager, Design
User avatar

Joined: Wed Nov 16, 2011 12:56 pm
Posts: 4243
Location: Sol III
Dilvish wrote:
looks like Vezzra and I crossed paths somewhat here, although I expect this should still be ok-- could you double check that Vezzra?
Yup, everything ok. Doesn't affect the Xcode build scripts.


Top
 Profile  
 
PostPosted: Mon May 25, 2015 9:11 pm 
Offline
AI Contributor
User avatar

Joined: Tue Jun 24, 2014 9:55 pm
Posts: 444
FO uses python2 for ingame scripts.
On windows python shipped with installer.
On linux is not (I think it is issue)

I don`t think that build script should have limitation on python version.

Here is version compatible with python3 (I test it only on windows without dll part, can someone help me with it?)
https://raw.githubusercontent.com/Cjkjv ... sioncpp.py

_________________
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0


Top
 Profile  
 
PostPosted: Mon May 25, 2015 9:49 pm 
Offline
AI Lead, Programmer
User avatar

Joined: Sat Sep 22, 2012 6:25 pm
Posts: 4374
Cjkjvfnby wrote:
On windows python shipped with installer.
On linux is not (I think it is issue)
Do you have any particular reasoning to offer? I don't at all get the impression that our downstream packagers would prefer we bundle a special version of python; that seems like more of a last resort sometimes used by complex proprietary apps, not commonly used by open source software like this.

Quote:
I don`t think that build script should have limitation on python version.
Why is that? If our main app requires python2.7, I don't see an issue with the build script also requiring it. I'll defer to Marcel on that though.

_________________
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 41 posts ]  Go to page 1, 2, 3  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group