Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Mon Oct 15, 2018 10:27 pm

All times are UTC




Post new topic  Reply to topic  [ 33 posts ]  Go to page Previous 1 2
Author Message
PostPosted: Sun Jun 08, 2014 9:01 am 
Offline
Tycoon
Tycoon

Joined: Tue Feb 22, 2011 6:34 pm
Posts: 2652
planetmaker wrote:
there probably is somewhere a .bashrc or a bash.profile file.

Thanks, got it completely working now. Bash tripped over some some spaces in folders in the Windows PATH variable, but adding the needed paths through .bashrc did it.

Quote:
Maybe you want to write down your experiences, the way to get the compile environment on windows going? As a note for yourself and others to profit from it?
http://dev.openttdcoop.org/projects/home/wiki could well use that addition :)

I will make a guide, I'll do that with a completely clean Windows install in a VM, to make sure I include all needed steps. Then other people don't have to struggle that much with getting things working.

_________________
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML


Top
   
PostPosted: Sun Jun 08, 2014 11:13 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Thu Jun 25, 2009 4:42 pm
Posts: 2364
Location: Location, Location
In a fit of insanity, I decided to try compiling(?) a newgrf myself. However, i get the same (or similar errors as this):
Transportman wrote:
Code:
File "<string>", line 1, in <module>
AttributeError: 'NoneType' object has no attribute 'days'


I'm not on windows (arch linux), so it i don't think it's the same (PATH) issue...
Code:
hg log -rtip --template='{time|shortdate}'
succeeds fine

Code:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
AttributeError: 'NoneType' object has no attribute 'days'
/bin/bash: let: x=5272 days, 0:00:00 + 65536 * 0: syntax error in expression (error token is "days, 0:00:00 + 65536 * 0")
(repeated several times)


Any ideas?

_________________
AroAI - A really feeble attempt at an AI

It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration. --Edsger Dijkstra


Top
   
PostPosted: Sun Jun 08, 2014 12:37 pm 
Offline
Tycoon
Tycoon

Joined: Tue Feb 22, 2011 6:34 pm
Posts: 2652
Lord Aro wrote:
In a fit of insanity, I decided to try compiling(?) a newgrf myself. However, i get the same (or similar errors as this):
Transportman wrote:
Code:
File "<string>", line 1, in <module>
AttributeError: 'NoneType' object has no attribute 'days'


I'm not on windows (arch linux), so it i don't think it's the same (PATH) issue...
Code:
hg log -rtip --template='{time|shortdate}'
succeeds fine

Code:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
AttributeError: 'NoneType' object has no attribute 'days'
/bin/bash: let: x=5272 days, 0:00:00 + 65536 * 0: syntax error in expression (error token is "days, 0:00:00 + 65536 * 0")
(repeated several times)


Any ideas?


I use the latest makefile from here with a modified version of findversion.sh. The modification to findversion.sh I talked about earlier, but that is just to make it work on Windows.

_________________
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML


Top
   
PostPosted: Sun Jun 08, 2014 1:56 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Mon Oct 31, 2005 9:00 pm
Posts: 1032
Location: UK
Transportman wrote:
I use the latest makefile from here with a modified version of findversion.sh. The modification to findversion.sh I talked about earlier, but that is just to make it work on Windows.

You shouldn't need to modify findversion.sh. It works fine for me compiling ISR on Windows.

I'm using MinGW/Msys and Python 2.7.3.

_________________
Image


Top
   
PostPosted: Mon Jun 09, 2014 8:15 am 
Offline
Tycoon
Tycoon

Joined: Tue Feb 22, 2011 6:34 pm
Posts: 2652
mart3p wrote:
Transportman wrote:
I use the latest makefile from here with a modified version of findversion.sh. The modification to findversion.sh I talked about earlier, but that is just to make it work on Windows.

You shouldn't need to modify findversion.sh. It works fine for me compiling ISR on Windows.

I'm using MinGW/Msys and Python 2.7.3.

I have a different Python version (3.3.5), maybe that's causing the issue on my computer.

Found another minor issue, after doing a make clean and then make again, the makefile fails with the following error:
Code:
[DOC] docs/readme.txt
bash: -c: line 0: syntax error near unexpected token `('
bash: -c: line 0: `[ -z "unix2dos" ] || unix2dos unix2dos 6.0.5 (2014-04-17) MSY
S version. Without Unicode UTF-16 support. With native language support. LOCALED
IR: /usr/share/locale -q docs/readme.txt'
make: *** [docs/readme.txt] Error 2

The line from the Makefile that fails is
Code:
$(_V) [ -z "$(UNIX2DOS)" ] || $(UNIX2DOS) $(UNIX2DOS_FLAGS) $@

UNIX2DOS is in both my Windows and Bash PATH variables as it is part of MSYS.

Running make again after this works fine however.

_________________
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML


Top
   
PostPosted: Mon Jun 09, 2014 11:50 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Mon Oct 31, 2005 9:00 pm
Posts: 1032
Location: UK
Transportman wrote:
mart3p wrote:
Transportman wrote:
I use the latest makefile from here with a modified version of findversion.sh. The modification to findversion.sh I talked about earlier, but that is just to make it work on Windows.

You shouldn't need to modify findversion.sh. It works fine for me compiling ISR on Windows.

I'm using MinGW/Msys and Python 2.7.3.

I have a different Python version (3.3.5), maybe that's causing the issue on my computer.

It's possible to install multiple versions of Python. You could try installing Python 2.7 and changing your PATH variable accordingly.

Due to problems I've had using Msys and paths containing spaces, I installed Python 2.7 in C:\Python27, maybe this would help?

_________________
Image


Top
   
PostPosted: Wed Jun 11, 2014 7:31 am 
Offline
Tycoon
Tycoon

Joined: Tue Feb 22, 2011 6:34 pm
Posts: 2652
mart3p wrote:
Transportman wrote:
hat's causing the issue on my computer.

It's possible to install multiple versions of Python. You could try installing Python 2.7 and changing your PATH variable accordingly.

It was indeed my version of Python that was too new, going back to Python 2.7 fixes the problems I had with findversion.sh.

Quote:
Due to problems I've had using Msys and paths containing spaces, I installed Python 2.7 in C:\Python27, maybe this would help?

I also had problems with that, will advise against that in the guide I will be making.

The making of the docs still has issues, but for testing purposes that is not a problem.

_________________
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML


Top
   
PostPosted: Wed Jun 11, 2014 8:43 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Mon Oct 31, 2005 9:00 pm
Posts: 1032
Location: UK
Transportman wrote:
The making of the docs still has issues, but for testing purposes that is not a problem.

As ISR doesn't use the facility to generate docs, I've not had this issue. But out of interest, I changed the name of readme.txt to readme.ptxt to trigger the generation of readme.txt. This all works as intended for me, compilation proceeds without errors.

On my system the variable UNIX2DOS is set to unix2dos and UNIX2DOS_FLAGS is set to -q (running the command 'make help' will display all the makefile variable settings). I think your problem is due to the UNIX2DOS_FLAGS variable not being set correctly. So I believe the line in the makefile that fails for you is:
Code:
UNIX2DOS_FLAGS ?= $(shell [ -n $(UNIX2DOS) ] && $(UNIX2DOS) -q --version 2>/dev/null && echo "-q" || echo "")

You could try overriding the setting of this variable by adding the line:
Code:
UNIX2DOS_FLAGS = -q

to makefile.local.

_________________
Image


Top
   
PostPosted: Wed Jun 11, 2014 3:19 pm 
Offline
Tycoon
Tycoon

Joined: Tue Feb 22, 2011 6:34 pm
Posts: 2652
Changing the UNIX2DOS_FLAGS to -q in the Makefile or Makefile.config works, but in a makefile.local it does not work.

_________________
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML


Top
   
PostPosted: Wed Jun 11, 2014 3:32 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Mon Oct 31, 2005 9:00 pm
Posts: 1032
Location: UK
Transportman wrote:
Changing the UNIX2DOS_FLAGS to -q in the Makefile or Makefile.config works, but in a makefile.local it does not work.

Yes you're right. I added the line:
Code:
-include Makefile.local

to the ISR Makefile.config, so that I could use a Makefile.local file for local settings such as my install path.

Anyway this proves the problem is with the setting of the UNIX2DOS_FLAGS variable. But why you're having this problem, I have no idea. :?

_________________
Image


Top
   
PostPosted: Sun May 28, 2017 12:13 pm 
Offline
Transport Coordinator
Transport Coordinator

Joined: Thu Oct 07, 2004 12:51 pm
Posts: 290
Sorry to revive this topic but i ran into the same issue with the
Code:
print (date(x, y, z)-date(a,b,c)).days 

debacle.

It should actually be...
Code:
print ((date(x, y, z)-date(a,b,c)).days)

As in, an extra set of parenthesis.
As otherwise, the ".days" bit is being applied to the print command.

Surprises me that no one with python experience spotted that...


Top
   
PostPosted: Mon May 29, 2017 12:45 pm 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Sun Sep 09, 2007 5:03 am
Posts: 4671
Location: home
Makefile was created before Python3 was a thing.

_________________
Being a OpenTTD developer does not mean I know what I am doing.
Also, other OpenTTD developers may have different opinions.


Top
   
PostPosted: Mon May 29, 2017 2:44 pm 
Offline
Transport Coordinator
Transport Coordinator

Joined: Thu Oct 07, 2004 12:51 pm
Posts: 290
I never really liked python. I only like strong typed languages. ;)


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 33 posts ]  Go to page Previous 1 2

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 © 2000-2018 phpBB Limited

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2018.
Hosted by Zernebok Hosting.