Jump to page: 1 25  
Page
Thread overview
Building from source on Windows
Jan 28, 2022
forkit
Jan 28, 2022
H. S. Teoh
Jan 28, 2022
forkit
Jan 28, 2022
max haughton
Jan 28, 2022
forkit
Jan 28, 2022
max haughton
Jan 28, 2022
forkit
Jan 28, 2022
forkit
Jan 28, 2022
max haughton
Jan 28, 2022
forkit
Jan 28, 2022
MoonlightSentinel
Jan 28, 2022
forkit
Jan 28, 2022
forkit
Jan 29, 2022
forkit
Jan 29, 2022
zjh
Jan 29, 2022
forkit
Jan 29, 2022
rikki cattermole
Jan 29, 2022
forkit
Jan 29, 2022
forkit
Jan 29, 2022
forkit
Jan 29, 2022
forkit
Jan 29, 2022
forkit
Jan 29, 2022
forkit
Jan 29, 2022
forkit
Jan 29, 2022
zjh
Jan 29, 2022
MoonlightSentinel
Jan 30, 2022
forkit
Jan 30, 2022
MoonlightSentinel
Jan 30, 2022
forkit
Jan 30, 2022
forkit
Jan 30, 2022
frame
Jan 30, 2022
forkit
Jan 30, 2022
H. S. Teoh
Jan 30, 2022
forkit
Jan 31, 2022
H. S. Teoh
Jan 30, 2022
pilger
Jan 30, 2022
forkit
Jan 31, 2022
forkit
Jan 29, 2022
12345swordy
Jan 29, 2022
Andre Pany
January 28, 2022
No matter what instructions, blogs, articles... I use.. I simply cannot manage to build druntime,dmd,phobos, from source on Windows.

Of course, building from source in linux is a breeze.

But I cannot test my changes on Windows, cause I cannot build from source on Windows!

Does anyone have a step-by-step process, that is 'guaranteed' to work? (with as few unnecessary dependencies as possible please).

I'm happy to build a dedicated build machine for this purpose, with just the software needed to build from source.

NOTE: I said 'guaranteed' to work ;-)  ... I've wasted to much time following instructions that just do not work.

January 28, 2022
On Fri, Jan 28, 2022 at 09:39:39PM +0000, forkit via Digitalmars-d wrote:
> No matter what instructions, blogs, articles... I use.. I simply cannot manage to build druntime,dmd,phobos, from source on Windows.
[...]
> Does anyone have a step-by-step process, that is 'guaranteed' to work? (with as few unnecessary dependencies as possible please).
[...]
> NOTE: I said 'guaranteed' to work ;-)  ... I've wasted to much time following instructions that just do not work.

Would help if you posted the exact error message(s) here (including how you expect it to behave) so that people know how to help you.  "It doesn't work" gives no information as to what went wrong, and isn't an actionable bug report.

Cf.: https://www.chiark.greenend.org.uk/~sgtatham/bugs.html


T

-- 
What do you get if you drop a piano down a mineshaft? A flat minor.
January 28, 2022

On 1/28/22 4:39 PM, forkit wrote:

>

No matter what instructions, blogs, articles... I use.. I simply cannot manage to build druntime,dmd,phobos, from source on Windows.

Of course, building from source in linux is a breeze.

But I cannot test my changes on Windows, cause I cannot build from source on Windows!

Does anyone have a step-by-step process, that is 'guaranteed' to work? (with as few unnecessary dependencies as possible please).

I'm happy to build a dedicated build machine for this purpose, with just the software needed to build from source.

NOTE: I said 'guaranteed' to work ;-)  ... I've wasted to much time following instructions that just do not work.

I'm not sure if I've ever done it either... Any changes I make to the main projects, I test on Mac/Linux, and then let the online CI test for Windows.

I'd point you at where I would start, but I can't guarantee it will work, having never done it ;)

-Steve

January 28, 2022
On Friday, 28 January 2022 at 21:55:07 UTC, H. S. Teoh wrote:
>
> Would help if you posted the exact error message(s) here (including how you expect it to behave) so that people know how to help you.  "It doesn't work" gives no information as to what went wrong, and isn't an actionable bug report.
>
> Cf.: https://www.chiark.greenend.org.uk/~sgtatham/bugs.html
>
>
> T

the error(s) depend on what instructions I'm following....

yesterday I was using these instructions:

https://wiki.dlang.org/Building_under_Windows

what the $%@% ... it's so complicated!

I spent hours on it!

when googling about it, all kinds of people had all kinds of error messages..

I got some message about ../generated/ .. something not existing... which made no sense at all...

I really would prefer to not waste any more time on things that don't work.

I'm more interested in whether someone knows a step-by-step guaranteed way to build a build system **from scratch** (i.e. not adding stuff to an existing system that might cause all kinds of dependency problems, and hence you get all these nonsensical errors).

On linux, I just git the source and make. That's it.
January 28, 2022

On Friday, 28 January 2022 at 21:39:39 UTC, forkit wrote:

>

No matter what instructions, blogs, articles... I use.. I simply cannot manage to build druntime,dmd,phobos, from source on Windows.

Of course, building from source in linux is a breeze.

But I cannot test my changes on Windows, cause I cannot build from source on Windows!

Does anyone have a step-by-step process, that is 'guaranteed' to work? (with as few unnecessary dependencies as possible please).

I'm happy to build a dedicated build machine for this purpose, with just the software needed to build from source.

NOTE: I said 'guaranteed' to work ;-) ... I've wasted to much time following instructions that just do not work.

Post exactly what you have tried and what about it doesn't work.

January 28, 2022
On Friday, 28 January 2022 at 22:22:27 UTC, max haughton wrote:
>
> Post exactly what you have tried and what about it doesn't work.

I'm really trying for a different approach here.

That is, start from something that is guaranteed to work, in all cases ;-)


i.e.

step 1 - start with a clean install of Windows 7 (ideally, cause I hate Win10!)
step 2 - install this version of this ...
step 3 - install this version of this ...
...
....
.....
...... then your done! And it all works!


My Windows pc has multiple VS versions installed, and all kinds of things as well... so anything other than starting from scratch is just inviting all the problems I've encountered.


January 28, 2022
On Friday, 28 January 2022 at 22:31:26 UTC, forkit wrote:
> On Friday, 28 January 2022 at 22:22:27 UTC, max haughton wrote:
>>
>> Post exactly what you have tried and what about it doesn't work.
>
> I'm really trying for a different approach here.
>
> That is, start from something that is guaranteed to work, in all cases ;-)
>
>
> i.e.
>
> step 1 - start with a clean install of Windows 7 (ideally, cause I hate Win10!)
> step 2 - install this version of this ...
> step 3 - install this version of this ...
> ...
> ....
> .....
> ...... then your done! And it all works!
>
>
> My Windows pc has multiple VS versions installed, and all kinds of things as well... so anything other than starting from scratch is just inviting all the problems I've encountered.

I can't help if you don't say what you've actually tried to do. I haven't actually worked on D directly from windows for a while now so I can only fix things that are broken or point you in the right way rather than dictating what you are to do (in part because I'm not a slave)
January 28, 2022
On Friday, 28 January 2022 at 22:35:14 UTC, max haughton wrote:
>
> I can't help if you don't say what you've actually tried to do. I haven't actually worked on D directly from windows for a while now so I can only fix things that are broken or point you in the right way rather than dictating what you are to do (in part because I'm not a slave)

As a systems admin/engineer, I build production systems from scratch.

They are **guaranteed** to work, as defined.

I can provide the instruction/scripts to others, they can run them, and they WILL work... ** guaranteed **

That's the approach I want to take here (as opposed to the approach your suggesting, which starts from an existing system, and which for me, has just wasted too many hours of my life that I cannot get back).

January 28, 2022

On 1/28/22 5:45 PM, forkit wrote:

>

On Friday, 28 January 2022 at 22:35:14 UTC, max haughton wrote:

>

I can't help if you don't say what you've actually tried to do. I haven't actually worked on D directly from windows for a while now so I can only fix things that are broken or point you in the right way rather than dictating what you are to do (in part because I'm not a slave)

As a systems admin/engineer, I build production systems from scratch.

They are guaranteed to work, as defined.

I can provide the instruction/scripts to others, they can run them, and they WILL work... ** guaranteed **

That's the approach I want to take here (as opposed to the approach your suggesting, which starts from an existing system, and which for me, has just wasted too many hours of my life that I cannot get back).

So what Max is asking for, e.g. is:

I was using https://wiki.dlang.org/Building_under_Windows and I got to
step x, and then the error I got was "blah blah blah"

I have to be honest, most people here don't build the compiler or runtime/phobos, and those that do usually are developing on Linux or Mac. So you are likely to get more traction with "I'm here, it doesn't work, please help" than wishing for a person who has the magic recipe.

There's a reason the posix build is so much smoother...

-Steve

January 28, 2022

As others have said before, steps + error messages would be appreciated s.t. we can determine whether it's a local or general issue.

Software:

  • Any VS version (already used 17 and 22 but others should work as well)
  • DM make

Setup for Druntime / Phobos*:

  • Change the VS-related variables in win64.mak based on your specific VS installation (because they change with each version)
    • VCDIR
    • SDKDIR
    • BINDIR

Building should then be as simple as running make -f win64.mak in each directory (for dmd it simply forwards to src/build.d).


Currently using VS 2022 which required the following changes:

Druntime

diff --git a/win64.mak b/win64.mak
index 505d0d93..91fbed29 100644
--- a/win64.mak
+++ b/win64.mak
@@ -5,9 +5,10 @@ MODEL=64
 # Visual Studio 2019
 #VCDIR=\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110
 #SDKDIR=\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0
-# Visual Studio 2015 and before
-VCDIR=\Program Files (x86)\Microsoft Visual Studio 10.0\VC
-SDKDIR=\Program Files (x86)\Microsoft SDKs\Windows\v7.0A
+
+# Visual Studio 2022
+VCDIR=C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705
+SDKDIR=C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0

 DMD_DIR=..\dmd
 BUILD=release
@@ -15,9 +16,9 @@ OS=windows
 DMD=$(DMD_DIR)\generated\$(OS)\$(BUILD)\$(MODEL)\dmd

 # Visual Studio 2017/2019
-#BINDIR=$(VCDIR)\bin\Hostx64\x64
+BINDIR=$(VCDIR)\bin\Hostx64\x64
 # Visual Studio 2015 and before
-BINDIR=$(VCDIR)\bin\amd64
+#BINDIR=$(VCDIR)\bin\amd64

 CC=$(BINDIR)\cl
 LD=$(BINDIR)\link
@@ -37,9 +38,9 @@ DDOCFLAGS=-conf= -c -w -o- -Isrc -Iimport -version=CoreDdoc
 UTFLAGS=-version=CoreUnittest -unittest -checkaction=context

 #CFLAGS=/O2 /I"$(VCDIR)"\INCLUDE /I"$(SDKDIR)"\Include
-CFLAGS=/Z7 /I"$(VCDIR)"\INCLUDE /I"$(SDKDIR)"\Include
+#CFLAGS=/Z7 /I"$(VCDIR)"\INCLUDE /I"$(SDKDIR)"\Include
 # Visual Studio 2019
-#CFLAGS=/Z7 /I"$(VCDIR)"\include /I"$(SDKDIR)"\ucrt
+CFLAGS=/Z7 /I"$(VCDIR)"\include /I"$(SDKDIR)"\ucrt

 DRUNTIME_BASE=druntime$(MODEL)
 DRUNTIME=lib\$(DRUNTIME_BASE).lib

Phobos

diff --git a/etc/c/zlib/win64.mak b/etc/c/zlib/win64.mak
index 83dd0690b..30919d538 100644
--- a/etc/c/zlib/win64.mak
+++ b/etc/c/zlib/win64.mak
@@ -7,7 +7,7 @@ CC=$(VCDIR)\bin\amd64\cl
 LD=$(VCDIR)\bin\amd64\link
 LIB=$(VCDIR)\bin\amd64\lib

-CFLAGS=/O2 /nologo /I"$(VCDIR)\INCLUDE"
+CFLAGS=/O2 /nologo  /I"$(VCDIR)"\include /I"$(SDKDIR)"\ucrt
 LIBFLAGS=/nologo
 LDFLAGS=/nologo
 O=.obj
diff --git a/win64.mak b/win64.mak
index 041fb19c2..fcbb2dcbf 100644
--- a/win64.mak
+++ b/win64.mak
@@ -29,13 +29,13 @@ CP=cp
 DIR=\dmd2

 ## Visual C directories
-VCDIR=\Program Files (x86)\Microsoft Visual Studio 10.0\VC
-SDKDIR=\Program Files (x86)\Microsoft SDKs\Windows\v7.0A
+VCDIR=C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705
+SDKDIR=C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0

 ## Flags for VC compiler

 #CFLAGS=/Zi /nologo /I"$(VCDIR)\INCLUDE" /I"$(SDKDIR)\Include"
-CFLAGS=/O2 /nologo /I"$(VCDIR)\INCLUDE" /I"$(SDKDIR)\Include"
+CFLAGS=/O2 /nologo /I"$(VCDIR)"\include /I"$(SDKDIR)"\ucrt

 ## Location of druntime tree

@@ -54,9 +54,12 @@ UDFLAGS=-conf= -g -m$(MODEL) -O -w -preview=dip1000 -preview=fieldwise -I$(DRUNT

 ## C compiler, linker, librarian

-CC=$(VCDIR)\bin\amd64\cl
-LD=$(VCDIR)\bin\amd64\link
-AR=$(VCDIR)\bin\amd64\lib
+BINDIR=$(VCDIR)\bin\Hostx64\x64
+
+CC=$(BINDIR)\cl.exe
+LD=$(BINDIR)\link.exe
+AR=$(BINDIR)\lib.exe
+
 MAKE=make

 ## D compiler
@@ -499,7 +502,7 @@ unittest32mscoff:

 $(ZLIB): $(SRC_ZLIB)
        cd etc\c\zlib
-       "$(MAKE)" -f win64.mak MODEL=$(MODEL) zlib$(MODEL).lib "CC=$(CC)" "LIB=$(AR)" "VCDIR=$(VCDIR)"
+       "$(MAKE)" -f win64.mak MODEL=$(MODEL) zlib$(MODEL).lib "CC=$(CC)" "LIB=$(AR)" "VCDIR=$(VCDIR)" "SDKDIR=$(SDKDIR)"
        cd ..\..\..

 ######################################################
« First   ‹ Prev
1 2 3 4 5