January 30, 2022
On Saturday, 29 January 2022 at 12:50:40 UTC, MoonlightSentinel wrote:
>
> You apparently built dmd with unittests enabled. D applications build with `-unittest` do snot execute the actual main unless explicitly requested via a Druntime option. So the targets of the make rule are never built, causing the cascading error later on for `copydir`.
>
> Not sure how you build that dmd since `make` / `build.d` explicitly use a different name for the unittest executable.

so I just did this:

c:\source\D\dmd>make -f win64.mak
(output from above command is below - and yes, it seems something is defaulting to "ENABLE_UNITTEST=1)

(this is the output below, from the command above)
cd src
make -f win64.mak
dmd -g -ofvcbuild\msvc-lib.exe vcbuild\msvc-lib.d

if not exist "..\generated\windows\release\64" mkdir ..\generated\windows\release\64
make -f win32.mak "OS=windows" "BUILD=release" "MODEL=64" "HOST_DMD=" "HOST_DC=dmd" "MAKE=make" "VERBOSE=" "ENABLE_RELEASE=" "ENABLE_DEBUG=" "ENABLE_ASSERTS=" "ENABLE_UNITTEST=" "ENABLE_PROFILE=" "ENABLE_COVERAGE=" "DFLAGS=" "GEN=..\generated" "G=..\generated\windows\release\64" "LIB=vcbuild\msvc-lib" defaulttarget
if not exist "..\generated\windows\release\64" mkdir ..\generated\windows\release\64

make -fwin32.mak MAKE="make" HOST_DC="dmd" MODEL=64 CC="" VERBOSE= "ENABLE_DEBUG=1" "ENABLE_UNITTEST=1" ..\generated\windows\release\64\dmd.exe
echo "===== DEPRECATION NOTICE ====="
"===== DEPRECATION NOTICE ====="
echo "===== DEPRECATION: win32.mak is deprecated. Please use src\build.d instead."
"===== DEPRECATION: win32.mak is deprecated. Please use src\build.d instead."
echo "=============================="
"=============================="
dmd -m64 -of..\generated\build.exe -g build.d

..\generated\build.exe --called-from-make "OS=windows" "BUILD=release" "MODEL=64" "HOST_DMD=" "HOST_DC=dmd" "MAKE=make" "VERBOSE=" "ENABLE_RELEASE=" "ENABLE_DEBUG=1" "ENABLE_ASSERTS=" "ENABLE_UNITTEST=1" "ENABLE_PROFILE=" "ENABLE_COVERAGE=" "DFLAGS=" ..\generated\windows\release\64\dmd.exe
(TX) VERSION
(TX) SYSCONFDIR
(DC) COMMON
(DC) LEXER
(DC) BACKEND
(DC) DMD
Success

copy ..\generated\windows\release\64\dmd.exe .
        1 file(s) copied.


January 30, 2022

On Sunday, 30 January 2022 at 00:16:41 UTC, forkit wrote:

>

so I just did this:

Thanks, seems like the makefiles got hit by the switch to the new default for executables with unittests (run test and exit instead of main()). I've raised a PR to fix this issue: https://github.com/dlang/dmd/pull/13585.

You can simply skip the deprecated makefiles and run rdmd src/build.d.

January 30, 2022
On Sunday, 30 January 2022 at 00:37:46 UTC, MoonlightSentinel wrote:
> On Sunday, 30 January 2022 at 00:16:41 UTC, forkit wrote:
>> so I just did this:
>
> Thanks, seems like the makefiles got hit by the switch to the new default for executables with unittests (run test and exit instead of `main()`). I've raised a PR to fix this issue: https://github.com/dlang/dmd/pull/13585.
>
> You can simply skip the deprecated makefiles and run `rdmd src/build.d`.

Thanks for your help. It's so appreciated!

I'm starting to make real progress now...

(not sure why this site thought this response was spam though :-(
January 30, 2022
On Sunday, 30 January 2022 at 00:37:46 UTC, MoonlightSentinel wrote:
>

there appears to be another (separate) problem with compiling the 'tools'

in file:

c:\source\D\tools\win32.mak

it contains this line:
DFLAGS=-O -release -m$(MODEL)

but -m is not a valid option in dmd??

I changed that line to:
DFLAGS=-O -release

and I was then able to build all the tools

(excluding dman which says someeting about a .json file that I don't understand - but I don't know what dman.exe is anyway, so not too bothered :)


C:\source\D\tools>make -f win32.mak "ROOT=generated\windows\64" "MODEL=" generated\windows\64\dman.exe
'Build d-tags.json and copy it here, e.g. by running:'
"    make -C ../dlang.org -f win32.mak d-tags.json && copy ../dlang.org/d-tags-latest.json d-tags.json"
dmd -O -release -ofgenerated\windows\64\dman.exe dman.d -J.
dman.d(131): Error: file `"d-tags.json"` cannot be found or not in a path specified with `-J`
dman.d(131):        Path(s) searched (as provided by `-J`):
dman.d(131):        [0]: `.`

--- errorlevel 1

January 30, 2022

On Sunday, 30 January 2022 at 04:33:32 UTC, forkit wrote:

>

in file:

c:\source\D\tools\win32.mak

it contains this line:
DFLAGS=-O -release -m$(MODEL)

but -m is not a valid option in dmd??

Do you realize that it isn't just -m but -mXXXX because ${MODEL} stands for a variable which should be set? ;)

>

C:\source\D\tools>make -f win32.mak "ROOT=generated\windows\64" "MODEL=" generated\windows\64\dman.exe

If you ignore this and mix up 32 and 64bit / MS-COFF you have not to wonder why something will not work as expected.

January 30, 2022
On Sunday, 30 January 2022 at 10:03:28 UTC, frame wrote:
>
> If you ignore this and mix up 32 and 64bit / MS-COFF you have not to wonder why something will not work as expected.

yeah, I knew what, but since -m doesn't work, you gotta remove it.

The tools built ok, and all 64bit.

(except for the dman.exe tool, which I've never heard of and have no idea what it does, and it's isn't in the D distribution anyway.

What I can say, after a lot of mucking around, and a little help, is that building from source on Windows is as easy as it is on linux.

just git and make. that's it.

providing all the prerequistes programs/settings are in place of course ;-)

- an exisiting installation of windows
- an exisiting installation of visual studio build tools
- an exisiting installation of dmd
- an exisiting installation of dmc (which has the 'make' that you'll need)
- set the correct settings for VCDIR, SDKDIR, and BINDIR in the win64.mak files for druntime and phobos (didn't need it for dmd or the tools) to match your version of VS.

then run 'make -f win64.mak' in each of the folders for dmd, druntime, phobos, tools... and you're done.

That's really all there is too it.

January 30, 2022
On Sun, Jan 30, 2022 at 08:20:06PM +0000, forkit via Digitalmars-d wrote: [...]
> What I can say, after a lot of mucking around, and a little help, is that building from source on Windows is as easy as it is on linux.
> 
> just git and make. that's it.
> 
> providing all the prerequistes programs/settings are in place of course ;-)
> 
> - an exisiting installation of windows
> - an exisiting installation of visual studio build tools
> - an exisiting installation of dmd
> - an exisiting installation of dmc (which has the 'make' that you'll need)
> - set the correct settings for VCDIR, SDKDIR, and BINDIR in the win64.mak
> files for druntime and phobos (didn't need it for dmd or the tools) to match
> your version of VS.
> 
> then run 'make -f win64.mak' in each of the folders for dmd, druntime, phobos, tools... and you're done.
> 
> That's really all there is too it.

This should be incorporated into the wiki page so that the next person that comes along can benefit from it.


T

-- 
Freedom of speech: the whole world has no right *not* to hear my spouting off!
January 30, 2022
On Sunday, 30 January 2022 at 20:33:58 UTC, H. S. Teoh wrote:
>
> This should be incorporated into the wiki page so that the next person that comes along can benefit from it.
>
>
> T

I'm still working on gaining a fuller understanding of all this.

Also, I don't just want to know 'what', but also 'why'.

The 'what' on it's own, just gives you a very limited understanding, which is problematic when things go wrong.

The problem with existing wiki (well, one of it's problem) is it lacks a good explanation of precisely why you need what.

The most complex part at the moment, is working out 'precisely' what VS components you need, and why.

https://docs.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-community?view=vs-2022&preserve-view=true#desktop-development-with-c

Ideally, the whole thing (installing VS/DMD/DMC/GIT/) could be open scripted as well.

I don't like the process being hidden behind some executable thing, like
dub digger dogger... ....
January 30, 2022
On Sunday, 30 January 2022 at 20:20:06 UTC, forkit wrote:
> - an exisiting installation of dmc (which has the 'make' that you'll need)
> - set the correct settings for VCDIR, SDKDIR, and BINDIR in the win64.mak files for druntime and phobos (didn't need it for dmd or the tools) to match your version of VS.
>
> then run 'make -f win64.mak' in each of the folders for dmd, druntime, phobos, tools... and you're done.

there is also "/src/build.d" which you can use instead.

January 30, 2022
On Sunday, 30 January 2022 at 23:34:04 UTC, pilger wrote:
>
> there is also "/src/build.d" which you can use instead.

yeah, but that's only for dmd (and you have to use that currently, due to a problem in the .mak file - see:

https://forum.dlang.org/post/winmkmwpjkicdjgtourj@forum.dlang.org

But for druntime, phobos and tools, the only option is the 'make -f win64.mak'.

I don't know why the dmd build has this 'option' of using /src/build.d

Ideally, it should just be one command to use for each component.