CyberShadow / Digger

A tool to build D and bisect old D versions
Other
57 stars 9 forks source link

Win64 builds #4

Closed Trass3r closed 9 years ago

Trass3r commented 10 years ago

After lots of trial and error I can now build druntime and phobos at least.

 sys/d/builder.d | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/sys/d/builder.d b/sys/d/builder.d
index d8d716f..4c88bad 100644
--- a/sys/d/builder.d
+++ b/sys/d/builder.d
@@ -109,9 +109,9 @@ LINKCMD=%DMC%\link.exe
 [Environment64]
 LIB="%@P%\..\lib"
 DFLAGS=%DFLAGS% -L/OPT:NOICF
-VCINSTALLDIR=\Program Files (x86)\Microsoft Visual Studio 10.0\VC\
+VCINSTALLDIR=...\VisualStudio\VC
 PATH=%PATH%;%VCINSTALLDIR%\bin\amd64
-WindowsSdkDir=\Program Files (x86)\Microsoft SDKs\Windows\v7.0A
+WindowsSdkDir=C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A
 LINKCMD=%VCINSTALLDIR%\bin\amd64\link.exe
 LIB=%LIB%;"%VCINSTALLDIR%\lib\amd64"
 LIB=%LIB%;"%WindowsSdkDir%\Lib\winv6.3\um\x64"
@@ -145,7 +145,9 @@ EOS";

            setTimes(buildPath("src", "rt", "minit.obj"), Clock.currTime(), Clock.currTime());

-           run(["make", "-f", makeFileNameModel, "MODEL=" ~ config.build.model]);
+           run(["make", "-f", makeFileNameModel, "MODEL=" ~ config.build.model,
+               `VCDIR=...\VisualStudio\VC`,
+               `SDKDIR=C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A`]);
        }

        install(
@@ -177,7 +179,10 @@ EOS";
            version (Windows)
            {
                auto lib = "phobos%s.lib".format(modelSuffix);
-               run(["make", "-f", makeFileNameModel, "MODEL=" ~ config.build.model, lib]);
+               run(["make", "-f", makeFileNameModel, "MODEL=" ~ config.build.model,
+                    `VCDIR=...\VisualStudio\VC`,
+                    `SDKDIR=C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A`,
+                    lib]);
                enforce(lib.exists);
                targets = [lib];
            }

But then it still fails.

digger: Phobos OK!
LINK : fatal error LNK1104: cannot open file 'shell32.lib'
--- errorlevel 1104

All those hardcoded paths are a real pita.

Trass3r commented 10 years ago

Ok now I got it, the ini needs to be:

-VCINSTALLDIR=\Program Files (x86)\Microsoft Visual Studio 10.0\VC\
+VCINSTALLDIR=...\VisualStudio\VC\
 PATH=%PATH%;%VCINSTALLDIR%\bin\amd64
-WindowsSdkDir=\Program Files (x86)\Microsoft SDKs\Windows\v7.0A
+WindowsSdkDir=C:\Program Files (x86)\Windows Kits\8.1\
Trass3r commented 10 years ago

@CyberShadow any thoughts on how to improve the Win64 situation? :)

CyberShadow commented 10 years ago

Yes, I've put down some thoughts in a source code comment, here: https://github.com/CyberShadow/ae/blob/fb500ee56bad91be297fc01eea25c2978340ac74/sys/d/builder.d#L101-L103

We can do either or both of the following:

I've already made some advances in the second option in a different project.

CyberShadow commented 10 years ago

Download and unpack just the VC++ Express components we need

Digger now does this. Can you give it a try?

rainers commented 9 years ago

I just tried it with digger 1.0. I get

digger: Installing Visual Studio 2013 (vcRuntimeMinimum_x86, vc_compilercore86,
vc_compilercore86res, vc_librarycore86, vc_libraryDesktop_x64, win_xpsupport) to
 dl\vs2013...
Fatal error: 0: The system cannot find the file specified.

It seems to have downloaded a wrapper only, wdexpress_full.exe is just 1MB.

CyberShadow commented 9 years ago

Digger uses WinINet to download stuff. Are your Internet Explorer settings OK?

If yes, could you please build from source with debug symbols and get a stack trace?

CyberShadow commented 9 years ago

It seems to have downloaded a wrapper only, wdexpress_full.exe is just 1MB.

This is as expected, BTW. It downloads the web installer, then uses the information contained in it to obtain only the necessary components. It would be nuts to download the entire 1.5GB ISO.

rainers commented 9 years ago

If yes, could you please build from source with debug symbols and get a stack trace?

When I build digger myself it works (both git HEAD and 2.066). [What's missing from the readme: I had to create an OMF version of wininet.lib (the other libs seem not to be used)].

After removing the dl folder, running the distributed executable again reproduces the error.

Anything else I should try to find the issue?

rainers commented 9 years ago

It would be nuts to download the entire 1.5GB ISO.

Actually, I implemented something similar in Visual D to download the missing msobj*.dll when only using VS Shell. I didn't enabled it because I could never convince myself that it is not the same as just distributing the files directly. Even if freely distributed, it might at least require the user to accept the respective MS EULA.

CyberShadow commented 9 years ago

Looks like yet another -inline codegen bug... :(

[What's missing from the readme: I had to create an OMF version of wininet.lib (the other libs seem not to be used)]

Thanks for letting me know, I'll fix that.

CyberShadow commented 9 years ago

https://issues.dlang.org/show_bug.cgi?id=13503

Reuploaded build without -inline.

rainers commented 9 years ago

Looks like yet another -inline codegen bug... :(

Ouch. Thanks for "fixing".