-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Datetime fix for MinGW. #214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
It fixes all the failures with MinGW + python 2.5, with python 3.1 a few issues are left. This is with PR-213 and this one together.
|
My guess would be that it's somehow not triggering the 64-bit time_t. |
Hmm, maybe mktime needs to be _mktime64 for the same reasons. I don't get why it works for Python 2.5 though.. |
The errors on 2.5 were never the same ones as on 2.7/3.1. Perhaps related to the Python 2.5 installers being built with VS 2005 (IIRC) and 2.7/3.1 with VS 2008. |
Ralf, if you change |
Ah, I think Python 2.5 might even have been compiled with VS 2003, if I remember correctly. |
I think I understand why Python 2.5 succeeds. It doesn't use the custom functionality, and therefore falls back on a 32-bits time_t and -time functionality. Because the datetime code makes sure that 32-bits time_t size is handled with a kind of overflow mechanism for dates beyond 2038, it does not fail in those cases.. |
Han, after changing
|
That is strange, have you applied all patches here? This seems to be the same bug we had before (with a 32-bits time_t), but that should have been fixed. |
Yes, PR-213, then this PR, then the one-line change The difference with the 2.5 errors from before is that those were using |
That's it for tonight for me. |
Okay, I'll take a look at it tomorrow. |
I tried to reproduce the issue with 64-bits localtime, but MinGW and win64 don't go together. I had to fix some issues with the installer, but after getting things to work on a 32-bit Python32 environment, it crashes after a few tests. |
Hmm, it also crashed on XP, using Python26 and using MinGW 4.6.1. The crash happens for me in test_arrayprint, in the TestComplexArray class and can be reproduced by doing |
I pushed a few changes to add a function |
The test_datetime passes for me on WinXP with Python26 using MinGW. The test_multiarray crashes, however, just like the general test. (Is that the reason for you to stick to the older version of MinGW? I cannot find a download for it, though...) |
This gives the same errors as before, on both Python 2.7 and 3.1:
|
Yeah, I figured. I'm a bit at a loss, though.. |
What I would suggest is instrumenting that part of the code so that before the call to the failing function call, it prints out the value of the parameters being passed in. This way, we could validate that nothing has munged the value before getting there, or create a separate tiny test program to experiment with what's going on. |
I cannot find the installer for MinGW 3.4.5, it is too old. I tried to download it from the Wayback Machine, but they don't have it either. The newest version of MinGW passes the datetime tests, but crashes on other tests. Do you have a version I can download from somewhere, Ralf? Otherwise I'm afraid there is not much more I can do to solve these issues.. |
The installer I used was MinGW-5.1.6.exe, which installs 3.4.5. All the part are still linked at http://wiki.codeblocks.org/index.php?title=MinGW_installation#GCC_3.4.5_manual_install for example. But I have to say that this is getting very questionable to use. Would be much better indeed to make gcc-4.x work. I'll have a look now if David's branch is public, that may solve your crashes. |
His branch doesn't seem to be public, I asked on the list for it. |
Thanks! I've installed the separate files for version 3.4.5 from the given site, but I am running into some problems with it. At first MinGW could not find the .a files that were generated by the setup script (which I had to put into a MinGW directory manually), but now I get a few errors I cannot get around:
Which gives a "broken toolchain" error. Thing is, according to the symbol export, there should not be multiple definitions. |
That is a very common issue, and looks familiar. Seems to be a MinGW bug, http://comments.gmane.org/gmane.comp.emulators.wine.devel/17437. I documented how I set up Wine, see the "To install Wine on OS X..." paragraph at https://github.com/numpy/numpy/blob/master/doc/HOWTO_RELEASE.rst.txt. I think my mention of an issue with Wine + MinGW is exactly this, and I fixed it by installing Wine with http://code.google.com/p/osxwinebuilder/. |
Where are we with this? |
Down to 3 failures, but those are very hard to fix. MinGW is a real problem; 3.4.5 is very hard to even find, while 4.x is not supported. David was close to finishing the move to 4.x, but ran into some problems with DLLs and out of time. I'm not sure what the best way forward is at this point. |
Perhaps this could go in now and additional fixes could be made later. Does that seem reasonable? |
That's fine with me. |
feat: Add vrsubhn_[s16|s32|s64]
Hi,
This should fix the 32/64 bits issues with the time type when using MinGW. (See also here)