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.[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
Build procedure is not python3 compatible
Moderator: Oberlus
Build procedure is not python3 compatible
Attached patches are released under GPL 2.0 or later.
Re: Build procedure is not python3 compatible
Will add compatibility if no one fix it in next 8 hours.Chriss wrote: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.[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 provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0
Re: Build procedure is not python3 compatible
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?
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.
Re: Build procedure is not python3 compatible
All Python code in FO is Python 2.Chriss wrote:I think most python code in FO is for python2?
Re: Build procedure is not python3 compatible
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.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?
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0
Re: Build procedure is not python3 compatible
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.
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.
Re: Build procedure is not python3 compatible
Which would be meDilvish 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.
Done.
Re: Build procedure is not python3 compatible
I don't think the shebang lines have any relevance on Windows at all.Chriss wrote:I don't know about Windows.
Re: Build procedure is not python3 compatible
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.Dilvish wrote:I've now changed the shebang in this file to refer specifically to python2.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?
Well, crap. What now?
- adrian_broher
- Programmer
- Posts: 1156
- Joined: Fri Mar 01, 2013 9:52 am
- Location: Germany
Re: Build procedure is not python3 compatible
useVezzra wrote:Well, crap. What now?
#!/usr/bin/env python2
Resident code gremlin
Attached patches are released under GPL 2.0 or later.
Git author: Marcel Metz
Attached patches are released under GPL 2.0 or later.
Git author: Marcel Metz
Re: Build procedure is not python3 compatible
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.adrian_broher wrote:use
#!/usr/bin/env python2
Problem solved.
Re: Build procedure is not python3 compatible
Ok, that's in for make_versioncpp.py nowadrian_broher wrote:use
#!/usr/bin/env python2
**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
Re: Build procedure is not python3 compatible
Yup, everything ok. Doesn't affect the Xcode build scripts.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?
Re: Build procedure is not python3 compatible
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
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
Re: Build procedure is not python3 compatible
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.Cjkjvfnby wrote:On windows python shipped with installer.
On linux is not (I think it is issue)
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.I don`t think that build script should have limitation on python version.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0