Thread overview
D Contributor Tutorials Part 1 - Building the Compiler From Source
Jan 08, 2023
Mike Parker
Jan 08, 2023
Salih Dincer
Jan 08, 2023
Mike Shah
Jan 08, 2023
jmh530
Jan 08, 2023
ryuukk_
Jan 22, 2023
Nick Treleaven
Jan 22, 2023
zjh
Jan 08, 2023
matheus
Re: D Contributor Tutorials Part 1 - Building the Compiler From Source - Windows
Jan 22, 2023
Nick Treleaven
Jan 23, 2023
Nick Treleaven
January 08, 2023

Have you ever considered hacking on the D compiler but were intimidated by the build process? Dennis Korpel has been working on a series of video tutorials aimed at helping potential contributors establish a foundation from which to start contributing code.

In this first tutorial of the series, he gives an overview of what happens when compiling a D source file, then shows how to set up an environment from which to build dmd and the standard library/runtime binary. The next video will use this setup to start making changes to dmd.

https://youtu.be/iLN4rQkk4Fs

The plan is to publish a new tutorial in the series every two weeks, so you can look for the next tutorial on January 22.

Thanks to Dennis for offering to put these videos together. Even a short video like this one takes a significant time investment to go from concept to publication. I'm certain there are people out there who will find them beneficial.

January 08, 2023

On Sunday, 8 January 2023 at 11:27:14 UTC, Mike Parker wrote:

>

The next video will use this setup to start making changes to dmd.

https://youtu.be/iLN4rQkk4Fs

Thank you to everyone who contributed to presenting this series to us, especially to Dennis!

Hope to see more videos like this...

SDB@79

January 08, 2023

On Sunday, 8 January 2023 at 11:27:14 UTC, Mike Parker wrote:

>

Have you ever considered hacking on the D compiler but were intimidated by the build process? Dennis Korpel has been working on a series of video tutorials aimed at helping potential contributors establish a foundation from which to start contributing code.

[...]

This is fantastic! I like seeing these videos organized into a playlist as well -- I think this will be very important to bringing new contributors to D!

January 08, 2023

On Sunday, 8 January 2023 at 11:27:14 UTC, Mike Parker wrote:

>

[snip]
Thanks to Dennis for offering to put these videos together. Even a short video like this one takes a significant time investment to go from concept to publication. I'm certain there are people out there who will find them beneficial.

Thanks.

January 08, 2023

On Sunday, 8 January 2023 at 11:27:14 UTC, Mike Parker wrote:

>

Have you ever considered hacking on the D compiler but were intimidated by the build process? Dennis Korpel has been working on a series of video tutorials aimed at helping potential contributors establish a foundation from which to start contributing code.

In this first tutorial of the series, he gives an overview of what happens when compiling a D source file, then shows how to set up an environment from which to build dmd and the standard library/runtime binary. The next video will use this setup to start making changes to dmd.

https://youtu.be/iLN4rQkk4Fs

The plan is to publish a new tutorial in the series every two weeks, so you can look for the next tutorial on January 22.

Thanks to Dennis for offering to put these videos together. Even a short video like this one takes a significant time investment to go from concept to publication. I'm certain there are people out there who will find them beneficial.

Last time i tried to build DMD to finish a PR i had was a miserable expenrience that i decided to give up https://github.com/dlang/dmd/pull/14418

The Wiki is outdated and mentions tools that do not exist https://wiki.dlang.org/Building_under_Windows

I updated it with the little information i had but that still wasn't enough to be able to build the whole thing

I even asked on the forum for some help, wich was met with silence https://forum.dlang.org/thread/aapqglgpugyuimhofxiq@forum.dlang.org?page=1

While this video definitely help, but i'm not going to rewind to find information on a 7minutes video, it should be a simple document, with a set of simple scripts and they should put accessible under the DMD repo

It shouldn't be that convoluted

January 08, 2023
On Sunday, 8 January 2023 at 11:27:14 UTC, Mike Parker wrote:
> ...

Awesome and I'm looking forward to see some debugging in these series.

Matheus.
January 22, 2023

On Sunday, 8 January 2023 at 19:28:59 UTC, ryuukk_ wrote:

>

The Wiki is outdated and mentions tools that do not exist https://wiki.dlang.org/Building_under_Windows

I haven't been able to build druntime on Windows. I have just updated the page to make it clear that DM make is needed even when not using Visual Studio. Which tools does it mention that don't exist?

>

I updated it with the little information i had but that still wasn't enough to be able to build the whole thing

I even asked on the forum for some help, wich was met with silence https://forum.dlang.org/thread/aapqglgpugyuimhofxiq@forum.dlang.org?page=1

Well some people replied, but it didn't really help.

January 22, 2023

On Sunday, 8 January 2023 at 11:27:14 UTC, Mike Parker wrote:

>

In this first tutorial of the series, he gives an overview of what happens when compiling a D source file, then shows how to set up an environment from which to build dmd and the standard library/runtime binary. The next video will use this setup to start making changes to dmd.

Thanks, this is great (for posix builds).

However I'm not sure the Windows instructions in the video are correct. It is good Dennis mentioned to use DM make as the wiki only mentioned that for the VS build instructions (I have updated it to make it clear).

I tried running make -f win32.mak from the phobos root and got this:

Error: don't know how to make '../dmd/druntime/lib/druntime.lib'

So it seems on Windows druntime still does have to be built before that (unlike on Linux). So I ran make -f win32.mak from dmd/druntime and got this error:

..\compiler\..\generated\windows\release\32\dmd -c -of=errno_c_32omf.obj -m32omf -conf= -O -release -preview=dip1000 -preview=fieldwise -preview=dtorfields -inline -w -Isrc -Iimport -v -P=-I. src\core\stdc\errno.c
predefs   DigitalMars LittleEndian D_Version2 all Windows Win32 CRuntime_DigitalMars CppRuntime_DigitalMars D_InlineAsm D_InlineAsm_X86 X86 D_ModuleInfo D_Exceptions D_TypeInfo D_HardFloat D_Optimized
binary    ..\compiler\..\generated\windows\release\32\dmd.exe
version   v2.101.0-rc.1-72-g5c3dafa06f
config
DFLAGS    (none)
include   src\importc.h
sppn.exe src\core\stdc\errno.c -HIsrc\importc.h -ED -oerrno.i -I.
Error: C preprocess command sppn.exe failed for file src\core\stdc\errno.c, exit status 1

failed launching sppn.exe src\core\stdc\errno.c -HIsrc\importc.h -ED -oerrno.i -I.

I don't know what sppn.exe is.


Before trying phobos win32.mak I also tried the win64.mak but it needs cl.exe which apparently I can get here:
https://ftp.digitalmars.com/bup.zip

But chrome says 'Your connection is not private' and won't let me download that even if I look under Advanced. I also tried curl:

curl: (60) SSL: no alternative certificate subject name matches target host name 'ftp.digitalmars.com'
More details here: https://curl.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.
January 22, 2023

On Sunday, 8 January 2023 at 19:28:59 UTC, ryuukk_ wrote:

>

While this video definitely help, but i'm not going to rewind to find information on a 7minutes video, it should be a simple document, with a set of simple scripts and they should put accessible under the DMD repo

It shouldn't be that convoluted

Yes, the document is better. Although it takes more time to produce, it saves users' time, which is worthwhile for D ecology
.

January 23, 2023

On Sunday, 22 January 2023 at 12:51:53 UTC, Nick Treleaven wrote:

>

sppn.exe src\core\stdc\errno.c -HIsrc\importc.h -ED -oerrno.i -I.
Error: C preprocess command sppn.exe failed for file src\core\stdc\errno.c, exit status 1

failed launching sppn.exe src\core\stdc\errno.c -HIsrc\importc.h -ED -oerrno.i -I.

Turned out dmc wasn't correctly installed. I downloaded dmc.zip which fixed it.

>

But chrome says 'Your connection is not private' and won't let me download that even if I look under Advanced. I also tried curl:

curl: (60) SSL: no alternative certificate subject name matches target host name 'ftp.digitalmars.com'

Fixed by updating & using Firefox.