Various things I've tried do not work.
`make -fwin32.mak import`
for example, does not put core/stdc/* into the import directory.
Comment #1 by bugzilla — 2022-06-18T02:43:18Z
For example, how do I set the bootstrap dmd compiler?
What commands do I pass to make?
What make.exe is run?
Comment #2 by ibuclaw — 2022-06-18T16:48:07Z
(In reply to Walter Bright from comment #0)
> Various things I've tried do not work.
>
> `make -fwin32.mak import`
>
> for example, does not put core/stdc/* into the import directory.
Build, or prep the import directory?
Without any arguments should just do the right thing. The first recipe in that file I note is:
target : import copy dll $(DRUNTIME)
Comment #3 by ibuclaw — 2022-06-18T16:49:58Z
(In reply to Walter Bright from comment #1)
> For example, how do I set the bootstrap dmd compiler?
>
> What commands do I pass to make?
>
> What make.exe is run?
where make.exe
If you don't know your own toolchain, we're all doomed. :-)
Comment #4 by bugzilla — 2022-06-19T06:46:22Z
What I do is make a git zip of the druntime repository, unzip it into a directory, and try to build it.
This requires:
1. What compiler will be used to compile it? How do I set it?
2. What arguments need to be passed to the win32.mak? I.e.
make -f win32.mak ????????
What are the targets that the user should use and what do they do?
3. There's a DMD and a HOST_DMD. ??????
4. Which variables are the user supposed to set?
5. Which make program should be used?
6. Sadly, not a single variable is documented.
Why is this so hard to explain?
Same problems with win64.mak, which, ironically, is also used to build 32mscoff, I presume, though there are no instructions for that, either. I looked at the wiki page recommended by README.md for build instructions,
http://wiki.dlang.org/Building_DMD
which is epic in its complete uselessness.
Comment #5 by bugzilla — 2022-06-19T06:57:34Z
Let's start with a `makefile` with the following contents:
-----
HOST_DMD=e:\dmd2.092\windows\bin\dmd.exe
all:
make HOST_DMD=$(HOST_DMD) -f win32.mak
clean:
make HOST_DMD=$(HOST_DMD) -f win32.mak clean
-----
Let's try it out:
-----
make clean
del lib\druntime.lib errno_c_32omf.obj
Could Not Find C:\forks\druntime\lib\druntime.lib
Could Not Find C:\forks\druntime\errno_c_32omf.obj
rmdir /S /Q doc import
The system cannot find the file specified.
The system cannot find the file specified.
-----
ok. Now let's try a build:
----
C:\forks\druntime>make
make HOST_DMD=e:\dmd2.092\windows\bin\dmd.exe -f win32.mak
"make" -f mak/WINDOWS import DMD="..\dmd\generated\windows\release\32\dmd" HOST_DMD="e:\dmd2.092\windows\bin\d
md.exe" MODEL=32 IMPDIR="import"
..\dmd\generated\windows\release\32\dmd -conf= -c -o- -Isrc -Iimport -Hfimport\core\sync\barrier.di src\core\s
ync\barrier.d
..\dmd\generated\windows\release\32\dmd -conf= -c -o- -Isrc -Iimport -Hfimport\core\sync\condition.di src\core
\sync\condition.d
..\dmd\generated\windows\release\32\dmd -conf= -c -o- -Isrc -Iimport -Hfimport\core\sync\config.di src\core\sy
nc\config.d
..\dmd\generated\windows\release\32\dmd -conf= -c -o- -Isrc -Iimport -Hfimport\core\sync\exception.di src\core
\sync\exception.d
..\dmd\generated\windows\release\32\dmd -conf= -c -o- -Isrc -Iimport -Hfimport\core\sync\mutex.di src\core\syn
c\mutex.d
..\dmd\generated\windows\release\32\dmd -conf= -c -o- -Isrc -Iimport -Hfimport\core\sync\rwmutex.di src\core\s
ync\rwmutex.d
..\dmd\generated\windows\release\32\dmd -conf= -c -o- -Isrc -Iimport -Hfimport\core\sync\semaphore.di src\core
\sync\semaphore.d
"make" -f mak/WINDOWS copydir DMD="..\dmd\generated\windows\release\32\dmd" HOST_DMD="e:\dmd2.092\windows\bin\
dmd.exe" MODEL=32 IMPDIR="import"
Target 'copydir' is up to date
"make" -f mak/WINDOWS copy DMD="..\dmd\generated\windows\release\32\dmd" HOST_DMD="e:\dmd2.092\windows\bin\dmd
.exe" MODEL=32 IMPDIR="import"
if not exist generated md generated
if not exist generated\windows md generated\windows
if exist "../../release-build/dmd-2.079.0/windows/bin/dmd.exe" (echo @"../../release-build/dmd-2.079.0/windows
/bin/dmd.exe" %* >generated\windows\host_dmd.bat)
if not "" == "" ("\dmd2\Windows\bin\dmd.exe" --version >nul 2>&1 && echo @"\dmd2\Windows\bin\dmd.exe" %* >gen
erated\windows\host_dmd.bat)
if not "" == "" ("" --version >nul 2>&1 && echo @"" %* >generated\windows\host_dmd.bat)
if not "e:\dmd2.092\windows\bin\dmd.exe" == "" ("e:\dmd2.092\windows\bin\dmd.exe" --version >nul 2>&1 && echo
@"e:\dmd2.092\windows\bin\dmd.exe" %* >generated\windows\host_dmd.bat)
generated\windows\host_dmd.bat -of=generated\windows\copyimports.exe -m32 mak\copyimports.d
if not exist generated md generated
if not exist generated\windows md generated\windows
if exist "../../release-build/dmd-2.079.0/windows/bin/dmd.exe" (echo @"../../release-build/dmd-2.079.0/windows
/bin/dmd.exe" %* >generated\windows\host_dmd.bat)
Error: command line too long
--- errorlevel 1
--- errorlevel 1
----------
Well, that crashed and burned. As you can see, it only partly created the import directory (no import\core\stdc):
---
C:\forks\druntime>dir import
Volume in drive C has no label.
Volume Serial Number is 6E3B-6D44
Directory of C:\forks\druntime\import
06/18/2022 11:52 PM <DIR> ..
06/18/2022 11:52 PM <DIR> core
06/18/2022 11:52 PM <DIR> .
0 File(s) 0 bytes
3 Dir(s) 209,004,240,896 bytes free
C:\forks\druntime>dir import\core
Volume in drive C has no label.
Volume Serial Number is 6E3B-6D44
Directory of C:\forks\druntime\import\core
06/18/2022 11:52 PM <DIR> ..
06/18/2022 11:52 PM <DIR> .
06/18/2022 11:52 PM <DIR> sync
0 File(s) 0 bytes
3 Dir(s) 209,002,799,104 bytes free
---
Comment #6 by ibuclaw — 2022-06-19T16:33:21Z
(In reply to Walter Bright from comment #5)
> if not exist generated md generated
> if not exist generated\windows md generated\windows
> if exist "../../release-build/dmd-2.079.0/windows/bin/dmd.exe" (echo
> @"../../release-build/dmd-2.079.0/windows
> /bin/dmd.exe" %* >generated\windows\host_dmd.bat)
> Error: command line too long
>
> --- errorlevel 1
>
> --- errorlevel 1
> ----------
So really, this is the problem. We've now so many files in druntime, that we've exceeded the command-line limit?
https://github.com/dlang/druntime/pull/3026
Perhaps this copyimports.d helper should be adapted to just read/parse in `mak/COPY` directly and do the work, rather than us giving it the list of files.
On a related note, I can't see why we still have generated .di headers in druntime, so opened https://github.com/dlang/druntime/pull/3850 to remove them, and converge everything into the `make copy` list.
That'll avoid some of the confusion here regarding `make import` doing something different to what might be expected.
Comment #7 by bugzilla — 2022-06-21T06:25:02Z
That can't be the problem, as whatever is building druntime for the test suite works.
The problem is there are no instructions on how to successfully build druntime.
Comment #8 by schveiguy — 2022-06-21T13:23:04Z
Every time I build druntime (on Linux/Mac, not Windows), I just do make -f posix.mak
If you build Phobos, and you have your directory structure set up, phobos will build it for you.
There exists this wiki page, I have no idea how up to date it is: https://wiki.dlang.org/Building_under_Windows#Building_D
Comment #9 by ibuclaw — 2022-06-21T17:34:46Z
(In reply to Walter Bright from comment #7)
> That can't be the problem, as whatever is building druntime for the test
> suite works.
I doubt running the druntime unit-tests is dependent on all iles being copied to the import directory.
Comment #10 by bugzilla — 2022-06-26T08:32:42Z
I still have no clue even what make program is required. The \dm\bin\make.exe does not work anymore with win64.mak.
I'm tempted to just delete win64.mak and make a new one.