www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Does anyone know how druntime gets built?

reply Walter Bright <newshound2 digitalmars.com> writes:
There are no instructions for it. Trying the obvious does not work.

https://issues.dlang.org/show_bug.cgi?id=23193
Jun 20 2022
next sibling parent reply Walter Bright <newshound2 digitalmars.com> writes:
What I'd like to see is, say, a .bat file named cc32mscoff.bat, that will build 
the 32 bit mscoff libraries. I don't want to set paths, environment variables, 
etc., I just want it to build the 32 bit mscoff libraries.
Jun 20 2022
next sibling parent reply Tejas <notrealemail gmail.com> writes:
On Tuesday, 21 June 2022 at 06:48:56 UTC, Walter Bright wrote:
 What I'd like to see is, say, a .bat file named cc32mscoff.bat, 
 that will build the 32 bit mscoff libraries. I don't want to 
 set paths, environment variables, etc., I just want it to build 
 the 32 bit mscoff libraries.
I think one is supposed to use the package [digger](https://code.dlang.org/packages/digger) for a painless process of building D/DRT/Phobos **Note**: I've never built D or its libraries
Jun 21 2022
parent reply Walter Bright <newshound2 digitalmars.com> writes:
On 6/21/2022 12:15 AM, Tejas wrote:
 On Tuesday, 21 June 2022 at 06:48:56 UTC, Walter Bright wrote:
 What I'd like to see is, say, a .bat file named cc32mscoff.bat, that will 
 build the 32 bit mscoff libraries. I don't want to set paths, environment 
 variables, etc., I just want it to build the 32 bit mscoff libraries.
I think one is supposed to use the package [digger](https://code.dlang.org/packages/digger) for a painless process of building D/DRT/Phobos
It's madness to require a special tool to just compile a library. :-( Somehow, the simple concept of: dmd <bunch of flags> <all the files> -odruntime.lib has turned into quite a rube goldberg morass.
Jun 21 2022
parent reply ryuukk_ <ryuukk.dev gmail.com> writes:
On Tuesday, 21 June 2022 at 07:20:45 UTC, Walter Bright wrote:
 On 6/21/2022 12:15 AM, Tejas wrote:
 On Tuesday, 21 June 2022 at 06:48:56 UTC, Walter Bright wrote:
 What I'd like to see is, say, a .bat file named 
 cc32mscoff.bat, that will build the 32 bit mscoff libraries. 
 I don't want to set paths, environment variables, etc., I 
 just want it to build the 32 bit mscoff libraries.
I think one is supposed to use the package [digger](https://code.dlang.org/packages/digger) for a painless process of building D/DRT/Phobos
It's madness to require a special tool to just compile a library. :-( Somehow, the simple concept of: dmd <bunch of flags> <all the files> -odruntime.lib has turned into quite a rube goldberg morass.
I 100% agree; requiring external tool = obfuscating the build process, which is an indication that something went wrong, poor UX
Jun 21 2022
parent "H. S. Teoh" <hsteoh qfbox.info> writes:
On Tue, Jun 21, 2022 at 07:10:03PM +0000, ryuukk_ via Digitalmars-d wrote:
 On Tuesday, 21 June 2022 at 07:20:45 UTC, Walter Bright wrote:
[...]
 Somehow, the simple concept of:
 
     dmd <bunch of flags> <all the files> -odruntime.lib
 
 has turned into quite a rube goldberg morass.
I 100% agree; requiring external tool = obfuscating the build process, which is an indication that something went wrong, poor UX
My personal philosophy is: the default command (e.g., make with no additional arguments) should (1) do the default thing that most users would want it to do (e.g., build all the default targets with the default configuration, no questions asked); and (2) do so with as few assumptions about the environment as possible (e.g., should just run whatever version of dmd.exe is the default, and should not depend on some obscure environment variables being set or the presence of some obscure external utilities). All the rest of the options and bells and whistles are non-default configuration, and the user shouldn't be burdened with that unless he specifically wants a non-default configuration. T -- Amateurs built the Ark; professionals built the Titanic.
Jun 21 2022
prev sibling next sibling parent reply forkit <forkit gmail.com> writes:
On Tuesday, 21 June 2022 at 06:48:56 UTC, Walter Bright wrote:
 What I'd like to see is, say, a .bat file named cc32mscoff.bat, 
 that will build the 32 bit mscoff libraries. I don't want to 
 set paths, environment variables, etc., I just want it to build 
 the 32 bit mscoff libraries.
not sure if this is the info you're looking for..but: you need to build dmd before druntime. I only use win64.mak first update the win64.mak file to work with the version of the Visual Studio you have installed. i.e. VCDIR= SDKDIR= BINDIR= you could run this first(to see the actual commands it will run): make -n -f win64.mak But I just run this .bat file I made (always works fine - although the version of the src I use is kinda old, but I happy to stick with it -> v2.098.1 -- echo off call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 %* d: cd D:\Dsource\dmd rdmd src/build.d clean rdmd src/build.d -v cd D:\Dsource\druntime C:\DMC\dm\bin\make -f win64.mak clean C:\DMC\dm\bin\make -f win64.mak cd D:\Dsource\phobos C:\DMC\dm\bin\make -f win64.mak clean C:\DMC\dm\bin\make -f win64.mak pause -------
Jun 21 2022
parent forkit <forkit gmail.com> writes:
On Tuesday, 21 June 2022 at 09:17:32 UTC, forkit wrote:

ensure this is in your path though:

C:\D\DMD2\WINDOWS\BIN64
Jun 21 2022
prev sibling parent reply "H. S. Teoh" <hsteoh qfbox.info> writes:
On Mon, Jun 20, 2022 at 11:48:56PM -0700, Walter Bright via Digitalmars-d wrote:
 What I'd like to see is, say, a .bat file named cc32mscoff.bat, that
 will build the 32 bit mscoff libraries. I don't want to set paths,
 environment variables, etc., I just want it to build the 32 bit mscoff
 libraries.
I've no idea how it's done on Windows, but on Linux, it's as simple as: export HOST_DMD=/path/to/bootstrap/dmd make -f posix.mak PIC=1 MODEL=64 T -- Lottery: tax on the stupid. -- Slashdotter
Jun 21 2022
parent Walter Bright <newshound2 digitalmars.com> writes:
On 6/21/2022 9:05 AM, H. S. Teoh wrote:
 On Mon, Jun 20, 2022 at 11:48:56PM -0700, Walter Bright via Digitalmars-d
wrote:
 What I'd like to see is, say, a .bat file named cc32mscoff.bat, that
 will build the 32 bit mscoff libraries. I don't want to set paths,
 environment variables, etc., I just want it to build the 32 bit mscoff
 libraries.
I've no idea how it's done on Windows, but on Linux, it's as simple as: export HOST_DMD=/path/to/bootstrap/dmd make -f posix.mak PIC=1 MODEL=64
Thank you. When I try win32.mak, I get the results as described in the bugzilla issue. It doesn't even build the import directory properly.
Jun 21 2022
prev sibling next sibling parent reply AnimusPEXUS <animuspexus protonmail.com> writes:
On Tuesday, 21 June 2022 at 06:27:23 UTC, Walter Bright wrote:
 There are no instructions for it. Trying the obvious does not 
 work.

 https://issues.dlang.org/show_bug.cgi?id=23193
I've wrote some building script to automate dmd and friend (druntime) builds. but I don't know if it's what your looking for https://github.com/AnimusPEXUS/deployD .
Jun 21 2022
next sibling parent AnimusPEXUS <animuspexus protonmail.com> writes:
On Tuesday, 21 June 2022 at 16:19:28 UTC, AnimusPEXUS wrote:
 On Tuesday, 21 June 2022 at 06:27:23 UTC, Walter Bright wrote:
 There are no instructions for it. Trying the obvious does not 
 work.

 https://issues.dlang.org/show_bug.cgi?id=23193
I've wrote some building script to automate dmd and friend (druntime) builds. but I don't know if it's what your looking for https://github.com/AnimusPEXUS/deployD .
oops, looks like this script of mine doesn't actually build druntime, but it's builds at my place ok with just `make -f posix.mak` ------------- [animus animus druntime]$ make -C ../dmd/src -f posix.mak BUILD=release OS=linux MODEL=64 make[1]: Entering directory '/home/animus/dlang/dmd/src' posix.mak:42: ===== DEPRECATION NOTICE ===== posix.mak:43: ===== DEPRECATION: posix.mak is deprecated. Please use src/build.d instead. posix.mak:44: ============================== dmd -of../generated/build -g build.d ../generated/build OS="linux" BUILD="release" MODEL="64" HOST_DMD="dmd" CXX="c++" AUTO_BOOTSTRAP="" DOCDIR="" STDDOC="" DOC_OUTPUT_DIR="" MAKE="make" VERBOSE="" ENABLE_RELEASE="" ENABLE_DEBUG="" ENABLE_ASSERTS="" ENABLE_LTO="" ENABLE_UNITTEST="" ENABLE_PROFILE="" ENABLE_COVERAGE="" DFLAGS="" dmd (TX) VERSION (TX) SYSCONFDIR (DC) COMMON (TX) DMD_CONF (DC) BACKEND (DC) LEXER (DC) DMD Success make[1]: Leaving directory '/home/animus/dlang/dmd/src' ../dmd/generated/linux/release/64/dmd -conf= -c -o- -Isrc -Iimport -Hfimport/core/sync/barrier.di src/core/sync/barrier.d ../dmd/generated/linux/release/64/dmd -conf= -c -o- -Isrc -Iimport -Hfimport/core/sync/condition.di src/core/sync/condition.d ../dmd/generated/linux/release/64/dmd -conf= -c -o- -Isrc -Iimport -Hfimport/core/sync/config.di src/core/sync/config.d ../dmd/generated/linux/release/64/dmd -conf= -c -o- -Isrc -Iimport -Hfimport/core/sync/exception.di src/core/sync/exception.d ../dmd/generated/linux/release/64/dmd -conf= -c -o- -Isrc -Iimport -Hfimport/core/sync/mutex.di src/core/sync/mutex.d ../dmd/generated/linux/release/64/dmd -conf= -c -o- -Isrc -Iimport -Hfimport/core/sync/rwmutex.di src/core/sync/rwmutex.d ../dmd/generated/linux/release/64/dmd -conf= -c -o- -Isrc -Iimport -Hfimport/core/sync/semaphore.di src/core/sync/semaphore.d cc -c -m64 -fPIC -DHAVE_UNISTD_H -O3 src/core/stdc/errno.c -ogenerated/linux/release/64/errno_c.o cc -c -m64 -fPIC -DHAVE_UNISTD_H -O3 src/core/threadasm.S -ogenerated/linux/release/64/threadasm.o ../dmd/generated/linux/release/64/dmd -c -fPIC -ofgenerated/linux/release/64/libdruntime.so.o -conf= ------------- and it's exited with 0
Jun 21 2022
prev sibling parent Walter Bright <newshound2 digitalmars.com> writes:
On 6/21/2022 9:19 AM, AnimusPEXUS wrote:
 On Tuesday, 21 June 2022 at 06:27:23 UTC, Walter Bright wrote:
 There are no instructions for it. Trying the obvious does not work.

 https://issues.dlang.org/show_bug.cgi?id=23193
I've wrote some building script to automate dmd and friend (druntime) builds. but I don't know if it's what your looking for https://github.com/AnimusPEXUS/deployD .
Thank you. It makes posix druntime, which does work! But the instructions still need to be in posix.mak.
Jun 21 2022
prev sibling next sibling parent Johan <j j.nl> writes:
On Tuesday, 21 June 2022 at 06:27:23 UTC, Walter Bright wrote:
 There are no instructions for it. Trying the obvious does not 
 work.

 https://issues.dlang.org/show_bug.cgi?id=23193
In case anyone is wondering, for LDC, it is `ldc-build-runtime`. https://wiki.dlang.org/Building_LDC_runtime_libraries -Johan
Jun 21 2022
prev sibling next sibling parent reply forkit <forkit gmail.com> writes:
On Tuesday, 21 June 2022 at 06:27:23 UTC, Walter Bright wrote:

I'm going to add this to my list of favourite quotes:

"Does anyone know how druntime gets built?" - Walter Bright, 2022 
(22 years after he created D).
Jun 21 2022
next sibling parent reply Abdulhaq <alynch4047 gmail.com> writes:
On Wednesday, 22 June 2022 at 06:54:49 UTC, forkit wrote:
 On Tuesday, 21 June 2022 at 06:27:23 UTC, Walter Bright wrote:

 I'm going to add this to my list of favourite quotes:

 "Does anyone know how druntime gets built?" - Walter Bright, 
 2022 (22 years after he created D).
Walter doesn't have time to be messing about with build solutions across multiple platforms, this has been delegated to others (which is a good thing). Nor does he pretend to know all things. Seeing as you want him to implement your new fascination, you should be happy that he does not need to pay attention to this sort of stuff.
Jun 22 2022
parent forkit <forkit gmail.com> writes:
On Wednesday, 22 June 2022 at 09:12:34 UTC, Abdulhaq wrote:
 On Wednesday, 22 June 2022 at 06:54:49 UTC, forkit wrote:
 On Tuesday, 21 June 2022 at 06:27:23 UTC, Walter Bright wrote:

 I'm going to add this to my list of favourite quotes:

 "Does anyone know how druntime gets built?" - Walter Bright, 
 2022 (22 years after he created D).
Walter doesn't have time to be messing about with build solutions across multiple platforms, this has been delegated to others (which is a good thing). Nor does he pretend to know all things. Seeing as you want him to implement your new fascination, you should be happy that he does not need to pay attention to this sort of stuff.
C'mon. This was just dry humour. It was not having a dig at Walter.
Jun 22 2022
prev sibling parent reply Walter Bright <newshound2 digitalmars.com> writes:
On 6/21/2022 11:54 PM, forkit wrote:
 On Tuesday, 21 June 2022 at 06:27:23 UTC, Walter Bright wrote:

 
 I'm going to add this to my list of favourite quotes:
 
 "Does anyone know how druntime gets built?" - Walter Bright, 2022 (22 years 
 after he created D).
 
Well, the makefile I made for druntime worked. :-) Now, I don't even know what make program is used to build win64.mak.
Jun 26 2022
parent zjh <fqbqrr 163.com> writes:
On Sunday, 26 June 2022 at 17:50:56 UTC, Walter Bright wrote:

 Now, I don't even know what make program is used to build 
 win64.mak.
Maybe you can try `'xmake'`!
Jun 26 2022
prev sibling next sibling parent reply forkit <forkit gmail.com> writes:
On Tuesday, 21 June 2022 at 06:27:23 UTC, Walter Bright wrote:
 There are no instructions for it. Trying the obvious does not 
 work.

 https://issues.dlang.org/show_bug.cgi?id=23193
btw. these are the **exact** steps I take to build D, on my linux system: NOTE: It creates the build into a different directory, not my dmd directory, as I like to keep the build separate from my actual installation. (now clone the source from git) https://github.com/dlang/dmd;git clone https://github.com/dlang/druntime;git clone https://github.com/dlang/phobos;git clone https://github.com/dlang/tools (now I use one big long concatenated command, and sit back till it's done.) INSTALL_DIR=/home/user/opt/dmdnew install;cd /ramdisk/dlang/druntime;make -f posix.mak -j8 VERBOSE=1 INSTALL_DIR=/home/user/opt/dmdnew install;cd /ramdisk/dlang/phobos;make -f posix.mak -j8 VERBOSE=1 INSTALL_DIR=/home/user/opt/dmdnew install;cd /ramdisk/dlang/tools;make -f posix.mak -j8 VERBOSE=1 INSTALL_DIR=/home/user/opt/dmdnew/tools install;/usr/bin/cp -fR /ramdisk/dlang/dmd/src/dmd /home/user/opt/dmdnew/src;/usr/bin/cp -fR /ramdisk/dlang/druntime /home/user/opt/dmdnew/src (hopefully, it all built correctly). Now I create a link in my bin directory to the newly build dmd /home/user/bin/dmdnew -> /home/user/opt/dmdnew/linux/bin64/dmd That way I can switch between dmd and dmdnew, painlessly. If you're using an actual ramdisk, as I do, consider the implications of that ;-)
Jun 23 2022
parent Walter Bright <newshound2 digitalmars.com> writes:
It's the posix build, not the Windows build. I'm able to build the posix.mak 
one. The Windows build does not work.
Jun 26 2022
prev sibling parent reply Walter Bright <newshound2 digitalmars.com> writes:
 kinke had the answer. The Windows versions get built with the make.exe that 
comes with dmc. It used to be included with the dmd distribution, but was
removed.
Jun 27 2022
parent reply forkit <forkit gmail.com> writes:
On Monday, 27 June 2022 at 17:50:45 UTC, Walter Bright wrote:
  kinke had the answer. The Windows versions get built with the 
 make.exe that comes with dmc. It used to be included with the 
 dmd distribution, but was removed.
Ummm... 'C:\DMC\dm\bin\make' is what I indicated in: https://forum.dlang.org/post/bkdunhvzttbbuiepyeny forum.dlang.org the only thing you really need to do, is alter some vars, in the win64.mak for druntime and phobos (although the recent win64.mak for druntime seems to have removed all three of these vars completely?? so don't know what's going on there. VCDIR= SDKDIR= CFLAGS= for CFLAGS, I just use: CFLAGS=/Z7 /I"$(VCDIR)"\INCLUDE /I"$(SDKDIR)"\Include for VCDIR and SDKDIR, it depends on your VS version, but you can run this code *within* a VS command prompt: the output of this is what I enter into VCDIR= and SDKDIR= // ---- int main() { auto VCDIR = environment.get("VCToolsInstallDir"); if (VCDIR is null) { return 1;} writeln("VCDIR=", VCDIR[0..$-1]); // also removes the trailing backslash auto SDKVersion = environment.get("WindowsSDKVersion"); if (SDKVersion is null) { return 1;} auto SDKDIR = environment.get("WindowsSdkDir"); if (SDKDIR is null) { return 1;} writeln("SDKDIR=", SDKDIR ~ "Include\\" ~ SDKVersion[0..$-1]); // also removes the trailing backslash return 0; } // -------
Jun 27 2022
next sibling parent Walter Bright <newshound2 digitalmars.com> writes:
I was using that make, but it was failing. Turns out there was more than one 
version of make.exe.

On 6/27/2022 2:22 PM, forkit wrote:
 Ummm...  'C:\DMC\dm\bin\make'
 
 is what I indicated in:
 
 https://forum.dlang.org/post/bkdunhvzttbbuiepyeny forum.dlang.org
Jun 27 2022
prev sibling parent zjh <fqbqrr 163.com> writes:
On Monday, 27 June 2022 at 21:22:34 UTC, forkit wrote:

 for VCDIR and SDKDIR,
Using `'xmake'` ,finding `'SDK'` and other directories is `automatic`. You don't have to worry. It supports `various` languages and is very `convenient`!
Jun 27 2022