[phobos] Question about std.datetime

Jonathan M Davis jmdavisProg at gmx.com
Sat Feb 12 07:42:09 PST 2011


On Saturday 12 February 2011 05:08:34 Andrei Alexandrescu wrote:
> Now that I made one pass through std.datetime, I have an unrelated
> question - why version(testStdDateTime)? Unless there is a special
> reason, I suggest let's just define unittests the same way for the
> entire phobos.

It's because of

http://d.puremagic.com/issues/show_bug.cgi?id=5454

For whatever reason, dmd runs out of memory when compiling all of the unit tests 
on Windows. I think that it's related to the fact that the Windows build 
compiles all of the unit tests in Phobos at once whereas Linux does each module 
separately (though Windows is definitely using more memory regardless). What's 
particularly bizarre about it is that dmd runs out of memory before it even 
reaches 1GB, let alone the limit of memory on the box.

Redoing the unit tests in std.datetime as you've requested may or may not fix the 
problem. As I don't know what's causing the problem, I can't say. Regardless, 
there's definitely a serious dmd bug there regarding memory usage.

So, for the moment, I created version(testStdDateTime) to make it so that most 
of the unit tests in std.datetime aren't compiled in in Windows. If you compile 
std.datetime separately in Windows and use version=testStdDateTime if you run 
the unit tests in Linux with OS=win32wine and version=testStdDateTime, you can 
test that the unit tests pass just fine. I have no intention of having 
version(testStdDateTme) in there in the long run. It's just there to compensate 
for a dmd bug.

- Jonathan M Davis


More information about the phobos mailing list