Skip to content
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

do not skip unittests for Win64 #1411

Merged
merged 1 commit into from Feb 28, 2014
Merged

Conversation

rainers
Copy link
Member

@rainers rainers commented Jul 13, 2013

With recent fixes to the compiler it is now possible to run unittests on Win64 aswell.

@alexrp
Copy link
Member

alexrp commented Jul 13, 2013

Hooray!

@yebblies
Copy link
Member

Hmm, maybe not quite there yet.

@rainers
Copy link
Member Author

rainers commented Jul 13, 2013

Hmm, maybe not quite there yet.

Works on my system (Win8). Does anybody know what OS the Win64 tester is
running?

According to the test history, all other targets are built, but
AMAZONA-3SL049J is idle. Anything that can be done to make it start
building?

Other strange things:

  • the status of the other targets is not propagated to other pages.
  • other targets are built multiple times on the same server

@braddr
Copy link
Member

braddr commented Jul 13, 2013

The win64 tester host rebooted itself last night and it's not setup to auto-start the tester. It's back in service now.

@braddr
Copy link
Member

braddr commented Jul 13, 2013

Oh, and it's a windows server 2012 ec2 instance.

@@ -573,7 +573,7 @@ Throws: $(D ErrnoException) if the file is not opened or if the call to $D(fread
*/
void rawWrite(T)(in T[] buffer)
{
version(Windows)
version(Win32)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know enough about windows libc's to evaluate the correctness of this change. Can you cite a resource justifying why this is win32 only? The rest of the changes are great, assuming the tests pass.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was just imitting what rawRead is doing, but it is wrong, I have already added setmode for MSVCRT locally, so switching the translation on/off will work, too.

@rainers
Copy link
Member Author

rainers commented Jul 13, 2013

Oh, and it's a windows server 2012 ec2 instance.

Thanks for the info.

@rainers
Copy link
Member Author

rainers commented Jul 14, 2013

I have installed Windows Server 2012 into a VM, still no problems if I add the correct libcurl.dll for x64. Is it possible that the build server picks up the 32-bit version?

I have removed the corresponding unittest too try it without that dependency.

@braddr
Copy link
Member

braddr commented Jul 14, 2013

$ md5sum ../win64libs/dmd2/windows/bin/libcurl.dll ../win64libs/dmd2/windows/libcurl-win64.zip
892907274847c20c4740bb9182fa9a89 *../win64libs/dmd2/windows/bin/libcurl.dll
11649bd1306cccb424c4f6765bb2f182 *../win64libs/dmd2/windows/libcurl-win64.zip

@rainers
Copy link
Member Author

rainers commented Jul 14, 2013

Hmm, that is exactly the same dll I am using. But the recent changes never ran, because the tester seems to be merging dmd/2346 for 9 hours now...

The error code reported in the log is 0xc0000022, but I didn't find a lot of information on this. Seems to be STATUS_ACCESS_DENIED, so maybe there are some restrictions on what is allowed to be executed?

@braddr
Copy link
Member

braddr commented Jul 14, 2013

I just chmod u+x'ed the files, which ought to help

@rainers
Copy link
Member Author

rainers commented Jul 14, 2013

I just chmod u+x'ed the files, which ought to help

Thanks. It seems one of our changes has helped. I'll add the dependency
on the libcurl.dll back in to see if the problem is solved.

@rainers
Copy link
Member Author

rainers commented Jul 14, 2013

Please don't merge yet. I'll enable all unittests, most of them are not compiled in yet. Some of them revealed codegen bugs, so I'll version those out.

@braddr
Copy link
Member

braddr commented Jul 15, 2013

imho, increased test coverage is important and useful. Get this or a subset of it in shape to be committed and save the rest for a second or more pull request.

@rainers
Copy link
Member Author

rainers commented Jul 15, 2013

I have committed my changes to enable all unittests but the few that actually trigger bugs. Unfortunately I just realized that this depends on dlang/druntime#545.

Anyway, I've filed the related bugs:
http://d.puremagic.com/issues/show_bug.cgi?id=10633
http://d.puremagic.com/issues/show_bug.cgi?id=10634
http://d.puremagic.com/issues/show_bug.cgi?id=10639
http://d.puremagic.com/issues/show_bug.cgi?id=10642
http://d.puremagic.com/issues/show_bug.cgi?id=10644

@@ -30441,6 +30444,7 @@ string tzDatabaseNameToWindowsTZName(string tzName)
case "Africa/Johannesburg": return "South Africa Standard Time";
case "Africa/Lagos": return "W. Central Africa Standard Time";
case "Africa/Nairobi": return "E. Africa Standard Time";
case "Africa/Tripoli": return "Libya Standard Time";
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmdavis Is this the correct fix for http://d.puremagic.com/issues/show_bug.cgi?id=10161 ? I was just guessing here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be. I'll have to look some stuff up to be sure. I haven't fixed it myself yet, because I'm in the middle of splitting up std.datetime and didn't want to commit anything which would conflict with that.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the page that I got all of that information from ( http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/zone_tzid.html ) "South Africa Standard Time" is "Africa/Tripoli," and "Libya Standard Time" is not yet listed at all. But Tripoli is in Libya, so I don't know. It looks like that page was last updated in March. However, given that Tripoli is the capital of Libya and that Windows now seems to have a "Libya Standard Time," it's likely correct. However, what's missing with your change is the change to windowsTZNameToTZDatabaseName. Its switch statement needs the conversion in the other direction, and it's actually that missing piece which is causing test failures for Dmitry on his Windows 8 box.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do clearly need to be doing a better job of checking that site for updates though, since it does have "Africa/Tripoli" (albeit with a different Windows time zone), and std.datetime doesn't currently have it at all.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like there's a bug report for "Africa/Tripoli": http://unicode.org/cldr/trac/ticket/5721

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for looking it up. Regarding the inverse in "windowsTZNameToTZDatabaseName" that's what I have added below in line 30462.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah. I missed that, because I was looking at what was shown above the comment and forgot to look at the rest of the diff.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I opened a PR #1482 which is identical with this, because now it is an actual issue on Windows 7 from 2013/8/13, by KB2863058.

@rainers
Copy link
Member Author

rainers commented Jul 15, 2013

Argh! Out of memory! I can split object files so that it manages to build datetime.d, but it later fails on algorithm.d.

Would it be possible to set the LARGEADDRESSAWARE bit on dmd.exe during the build process? That helps.

@@ -13941,7 +13943,7 @@ assert(tod6 == TimeOfDay(0, 0, 59));
else
static assert(0);

value %= 60;
value = value % 60;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please mark this with the bug# so that it's clear when it should be reverted. Though it looks like Walter has a pull which fixes the %= problem already, so I don't know that we want to make commits which get rid of %=.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the fix by Walter will precede this commit, I'll revert it then.

@rainers
Copy link
Member Author

rainers commented Jul 16, 2013

Would it be possible to set the LARGEADDRESSAWARE bit on dmd.exe during the build process? That helps.

DigitalMars/optlink#9

This helps, too:
dlang/dmd#2351

@rainers
Copy link
Member Author

rainers commented Jul 18, 2013

This finally builds successfully, but I found another issue when disabling debug information: http://d.puremagic.com/issues/show_bug.cgi?id=10664

@braddr Regarding the failure when building debug info that I could not reproduce locally: the log says "LINK : fatal error LNK1318: Unexpected PDB error; RPC (23) '(0x000006BA)'". Are the testers checking out into a new directory or could there be some old files left from previous builds (like vc100.pdb or unittest.pdb)?

@braddr
Copy link
Member

braddr commented Jul 18, 2013

always new.. the first step is mkdir and the last step is rm -r . If something is left over, it'd have to be because files are being written explicitly outside the build dir by the compiler.

@rainers
Copy link
Member Author

rainers commented Jul 20, 2013

rebased and squashed.

@rainers
Copy link
Member Author

rainers commented Aug 1, 2013

Rebased, squashed and tests for another fixed bug enabled.

@rainers
Copy link
Member Author

rainers commented Aug 12, 2013

Merged and rebased.

@rainers
Copy link
Member Author

rainers commented Sep 10, 2013

It seems that the win64.mak file is modified by the tester after checkout, but before merging. This stops any PR that tries to modify the makefile.

@braddr
Copy link
Member

braddr commented Sep 10, 2013

yeah. I'll try to get that aspect of the win64 auto-tester cleaned up sometime this week. I put priority on having it back up and working at all over doing it cleanly.

@rainers
Copy link
Member Author

rainers commented Sep 17, 2013

yeah. I'll try to get that aspect of the win64 auto-tester cleaned up sometime this week. I put priority on having it back up and working at all over doing it cleanly.

Thanks, the win64.mak issue is fine now. Unfortunately curl.lib seems to be missing for the Win64 builder.

@braddr
Copy link
Member

braddr commented Oct 5, 2013

Oh right.. and I even have the previous email still. Thanks for the re-send though. I've put the file up at downloads.dlang.org/other/curl-7.28.1-devel-rainer.win64.zip for future reference. With a little luck, the next run of this pull request will go that much better.

@braddr
Copy link
Member

braddr commented Oct 5, 2013

Great progress on reducing this big diff down over the last few months. Just a few issues left to split out and get addressed. All cases of disabled tests should have a critical bug created and associated with them. The real == double changes should probably be a standalone commit. Likely they should be conditional on real.sizeof == double.sizeof or something similar rather than version(Win64).

One pull request that would be good to have is one that just drops the big version'ing of unittest.d. That will be a good indicator of what part of the onion of issues is the outermost, so to speak.

@rainers
Copy link
Member Author

rainers commented Oct 6, 2013

All cases of disabled tests should have a critical bug created and associated with them

I was afraid someone would say that ;-) Actually there are no longer a lot of tests disabled, these are only fibers in core.thread and tmpfile in std.stdio AFAICT. There are still some implementations missing in std.math, but these are not tested at all (or only for Posix).

The real == double changes should probably be a standalone commit. Likely they should be conditional on real.sizeof == double.sizeof or something similar rather than version(Win64).

real != double for Win64, but the MS-C runtime does not support reals, and we don't have a version for the used C runtime. I wish we had a D implementation of parsing and printing reals, as these differ for every C runtime. See the different versions to check output.

Most of the changes here can only be split from enabling the unittests by not running any tests, some only fix the tests. I'll add a few bug resports for the actual code changes.

@ghost
Copy link

ghost commented Oct 24, 2013

@rainers: I've pulled #1538 since your pull still seems to fail, and the changes in #1538 are rather minimal. This will create a merge conflict for your pull, so you will have to rebase.

@rainers
Copy link
Member Author

rainers commented Nov 19, 2013

Fixed and rebased.

@rainers
Copy link
Member Author

rainers commented Jan 5, 2014

rebased. No interest in running phobos unittests on win64?

@MartinNowak
Copy link
Member

There is still a linker error.
unittest3c.obj : fatal error LNK1179: invalid or corrupt file: duplicate COMDAT '_D3std6format100__T9formatNthTS3std5array17__T8AppenderTAyaZ8AppenderTaTAyC3std8typecons18__unittestL867_444FZv3FooZ9formatNthFNaNfS3std5array17__T8AppenderTAyaZ8AppenderKS3std6format18__T10FormatSpecTaZ10FormatSpecmAyC3std8typecons18__unittestL867_444FZv3FooZv15__T7gencodeVm1Z7gencodeFNaNfZAya'

@rainers
Copy link
Member Author

rainers commented Jan 9, 2014

The error seems like a variation of https://d.puremagic.com/issues/show_bug.cgi?id=9756.

@rainers
Copy link
Member Author

rainers commented Jan 9, 2014

dlang/dmd#3074 allows this pull to pass.

@ghost
Copy link

ghost commented Feb 15, 2014

@rainers : Does this only require a rebase?

@braddr
Copy link
Member

braddr commented Feb 15, 2014

I think the way I'd approach finishing this little bugger off is to pull the unitest.d and win64.mak changes into a separate pull request. It will, of course, fail. From there, chip off logically separate parts of this set until the unittest.d/win64.mak pull request passes. I still think this one contains 3-5 separate issues that should be addressed individually.

The largest block, the real changes, I also really wish weren't conditional on win64 but rather on some less single platform and more generic real == double sort of conditional. Done with the consultation of platform porters that have similar issues. ARM, for example, falls into this set.

For the other parts, is it really win64 or is it msvc vs dmc? Could the win32 side use the same code? Etc. I'm not familiar with windows enough to do a good evaluation, but this much additional conditional logic concerns me from a maintainability standpoint.

@rainers
Copy link
Member Author

rainers commented Feb 16, 2014

fixed conflicts and rebased.

@rainers
Copy link
Member Author

rainers commented Feb 16, 2014

The largest block, the real changes, I also really wish weren't conditional on win64 but rather on some less single platform and more generic real == double sort of conditional. Done with the consultation of platform porters that have similar issues. ARM, for example, falls into this set.

It's slightly different for Win64, because the processor and D support 80-bit reals, but the C runtime does not. I'd rather have C runtime independent conversion functions string-to-float and back, as every C runtime is slightly different anyway.

For the other parts, is it really win64 or is it msvc vs dmc? Could the win32 side use the same code? Etc. I'm not familiar with windows enough to do a good evaluation, but this much additional conditional logic concerns me from a maintainability standpoint.

Most of the time it is MS runtime vs. DM runtime. I use version CRuntime_Microsoft vs. CRuntime_DigitalMars in my COFF32 version.

@rainers
Copy link
Member Author

rainers commented Feb 16, 2014

Aargh, "Out of memory"

@braddr The build server uses an older version of optlink when compiling dmd. Here is the end of the dmd build log:

OPTLINK (R) for Win32  Release 8.00.13
Copyright (C) Digital Mars 1989-2010  All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
OPTLINK : Warning 9: Unknown Option : LA

Could you please update it to 8.00.15 to support the /LARGEADDRESS option

@DmitryOlshansky
Copy link
Member

@rainers things are changing, it no longer runs out of memory:
core.exception.AssertError@std.stream(1449): Assertion failure

any chance addressing this?
UPDATE: nvm I see that out of memory is Win32 thing.

@MartinNowak
Copy link
Member

It would be great to have Win64 on the auto tester soon :).

@rainers
Copy link
Member Author

rainers commented Feb 27, 2014

Grrr, it's another issue of using C's printf output that's different in every implementation (nan/inf again). I'd prefer if we were not relying on it at all (aswell as the rest of the C runtime).

…ing convention

std.format, std.math: workarounds for different behaviour of sprintf
std.conv: workarounds for different behaviour of strtold
std.math: disable unittests for exp2f and exp2l
std.math: fix lrint(real), disable tmpfile test
std.process: seek to end of file before trying to append to it from another process
std.process: do not try to terminate an invalid process handle
win64.mak: disable COMDAT folding for release build
@rainers
Copy link
Member Author

rainers commented Feb 27, 2014

It wasn't as bad as expected, because the test call mapped to doFormat, not printf. Unittest should be fixed now.

@MartinNowak
Copy link
Member

Grrr, it's another issue of using C's printf output that's different in every implementation (nan/inf again). I'd prefer if we were not relying on it at all (aswell as the rest of the C runtime).

True, strtol is very problematic.

@MartinNowak
Copy link
Member

Nice to see a working Win64 test.

@9rnsr
Copy link
Contributor

9rnsr commented Feb 28, 2014

Looks like it's ready to merge.

@9rnsr
Copy link
Contributor

9rnsr commented Feb 28, 2014

Auto-merge toggled on

9rnsr added a commit that referenced this pull request Feb 28, 2014
@9rnsr 9rnsr merged commit 0e65012 into dlang:master Feb 28, 2014
@rainers
Copy link
Member Author

rainers commented Feb 28, 2014

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
9 participants