January 29, 2022
On Saturday, 29 January 2022 at 05:00:20 UTC, rikki cattermole wrote:
>
> On 29/01/2022 3:07 PM, forkit wrote:
>> still trying to take-apart this command 'dub run digger'.. wtf is it doing ... I gotta work that out first :-(
>
> Step 1: Download digger + dependencies
> Step 2: Compile digger
> Step 3: Run digger
>
> https://github.com/CyberShadow/Digger/blob/master/dub.sdl
>
> Pretty straight forward as far as digger itself is concerned.

gunna try the easy option... so most new-comers are going to want to do just that ;-)

'Building with Visual Studio'

From here: https://wiki.dlang.org/Building_under_Windows

I started with clean install of Windows 10 and clean install of VS2017 Enterprise (the same version used in the instructions on that site)

Downloaded and installed Visual D as it states.

All is fine with Visual Studio. Can build D projects, compile and run.

ok. Visual D integration with VS2017 seems fine.

Proceed to next instructions:

So I have all the source in the directory as per the instructions (D:\source\D)

I open a cmd prompt:

call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
(Ok, that worked fine)

cd C:\source\D\druntime
set VCDIR="C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC"
(everything fine so far)

make -f win64.mak -j4 "VCDIR=%VCDIR%"
Command error: undefined switch '-j4'
(ok, first problem has appeared)

(let's try without the -j4 then)

make -f win64.mak "VCDIR=%VCDIR%"
Error: don't know how to make 'Files'
(great. another error)

there is no make on my system?? instructions have not factored that in yet??


January 29, 2022
On Saturday, 29 January 2022 at 05:43:50 UTC, forkit wrote:
>
>
> make -f win64.mak -j4 "VCDIR=%VCDIR%"
> Command error: undefined switch '-j4'
> (ok, first problem has appeared)
>
> (let's try without the -j4 then)
>
> make -f win64.mak "VCDIR=%VCDIR%"
> Error: don't know how to make 'Files'
> (great. another error)
>
> there is no make on my system?? instructions have not factored that in yet??

oops. correct that. above occured after I install dmc (which has make)

before I installed dmc, the error was:

>  make -f win64.mak -j4 "VCDIR=%VCDIR%"
'make' is not recognized as an internal or external command, operable program or batch file.

(so that's actually the first part of the instructions, that don't work).

I'm getting rid of dmc, and installing msys64 (which I assume is the make its after??)

January 29, 2022
On Saturday, 29 January 2022 at 05:48:59 UTC, forkit wrote:
>
so now got a make on my system..whooohoooooo


c:\source\D\druntime>make --version
GNU Make 4.3
Built for x86_64-pc-msys
Copyright (C) 1988-2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

now going to proceed with the instructions for Building DRuntime (with Visual Studio):

https://wiki.dlang.org/Building_under_Windows

open a command prompt:

> call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64

(ok it seems to run fine)

(instructions then say to run this:
set VCDIR="C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC"

but that env variable is already set in the win64.mak  ?? so why type the above command in?? which has a different value to what is in my win64.mak anyway ??

my settings in that file are (I have VS2017 enterprise installed):

----
.....

VCDIR=C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.15.26726

SDKDIR=C:\Program Files (x86)\Windows Kits\10\Include\10.0.17134.0

.....

CFLAGS=/Z7 /I"$(VCDIR)"\INCLUDE /I"$(SDKDIR)"\Include

....
-----

so I'll skip that part of the instruction and look at the next one:

make -f win64.mak -j4 "VCDIR=%VCDIR%" target

well, since I'm not setting VCDIR manually, but using the one in the win64.mak, I'll change that instruction to something simpler: make -f win64.mak

c:\source\D\druntime>make -f win64.mak
"make" -f mak/WINDOWS import DMD="..\dmd\generated\windows\release\64\dmd" HOST_DMD="dmd" MODEL=64 IMPDIR="import"
make[1]: Entering directory '/c/source/D/druntime'
make[1]: Nothing to be done for 'import'.
make[1]: Leaving directory '/c/source/D/druntime'
"make" -f mak/WINDOWS copydir HOST_DMD="dmd" MODEL=64 IMPDIR="import"
make[1]: Entering directory '/c/source/D/druntime'
make[1]: Nothing to be done for 'copydir'.
make[1]: Leaving directory '/c/source/D/druntime'
"make" -f mak/WINDOWS copy DMD="..\dmd\generated\windows\release\64\dmd" HOST_DMD="dmd" MODEL=64 IMPDIR="import"
make[1]: Entering directory '/c/source/D/druntime'
if not exist generated md generated
/bin/sh: -c: line 1: syntax error: unexpected end of file
make[1]: *** [mak/WINDOWS:48: generated\windows\host_dmd.bat] Error 1
make[1]: Leaving directory '/c/source/D/druntime'
make: *** [win64.mak:76: copy] Error 2

oh great!@%$!@#

January 29, 2022
On Saturday, 29 January 2022 at 06:44:54 UTC, forkit wrote:
> On Saturday, 29 January 2022 at 05:48:59 UTC, forkit wrote:

ooops.

"Then compile with DigitalMars make (not to confuse with GNUMake)."

I kinda skipped over the line ;-)

I better get rid of GNUMake and use DigitialMars make again ;-)

ok. now got Digital Mars Make Version 5.06 again.

start again....


c:\source\D\druntime>make -f win64.mak
"make" -f mak/WINDOWS import DMD="..\dmd\generated\windows\release\64\dmd" HOST_DMD="dmd" MODEL=64 IMPDIR="import"
..\dmd\generated\windows\release\64\dmd -conf= -c -o- -Isrc -Iimport -Hfimport\core\sync\barrier.di src\core\sync\barrier.d
Error: '..\dmd\generated\windows\release\64\dmd' not found

--- errorlevel 1

oh great %@#%T$GF
January 29, 2022
On Saturday, 29 January 2022 at 06:44:54 UTC, forkit wrote:
> On Saturday, 29 January 2022 at 05:48:59 UTC, forkit wrote:

ooops.

"Then compile with DigitalMars make (not to confuse with GNUMake)."

I kinda skipped over the line ;-)

I better get rid of GNUMake and use DigitialMars make again ;-)

ok. now got Digital Mars Make Version 5.06 again.

start again....


c:\source\D\druntime>make -f win64.mak
"make" -f mak/WINDOWS import DMD="..\dmd\generated\windows\release\64\dmd" HOST_DMD="dmd" MODEL=64 IMPDIR="import"
..\dmd\generated\windows\release\64\dmd -conf= -c -o- -Isrc -Iimport -Hfimport\core\sync\barrier.di src\core\sync\barrier.d
Error: '..\dmd\generated\windows\release\64\dmd' not found

--- errorlevel 1

oh great %@#%T$GF

A whole day wasted!

I think I might stick to linux ;-)

January 29, 2022
On Saturday, 29 January 2022 at 07:00:29 UTC, forkit wrote:
>

C:\source\D\druntime>set VCDIR="C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC"

C:\source\D\druntime>make -f win64.mak
"make" -f mak/WINDOWS import DMD="..\dmd\generated\windows\release\64\dmd" HOST_DMD="dmd" MODEL=64 IMPDIR="import"
..\dmd\generated\windows\release\64\dmd -conf= -c -o- -Isrc -Iimport -Hfimport\core\sync\barrier.di src\core\sync\barrier.d
34 modules passed unittests

..\dmd\generated\windows\release\64\dmd -conf= -c -o- -Isrc -Iimport -Hfimport\core\sync\condition.di src\core\sync\condition.d
34 modules passed unittests

..\dmd\generated\windows\release\64\dmd -conf= -c -o- -Isrc -Iimport -Hfimport\core\sync\config.di src\core\sync\config.d
34 modules passed unittests

..\dmd\generated\windows\release\64\dmd -conf= -c -o- -Isrc -Iimport -Hfimport\core\sync\exception.di src\core\sync\exception.d
34 modules passed unittests

..\dmd\generated\windows\release\64\dmd -conf= -c -o- -Isrc -Iimport -Hfimport\core\sync\mutex.di src\core\sync\mutex.d
34 modules passed unittests

..\dmd\generated\windows\release\64\dmd -conf= -c -o- -Isrc -Iimport -Hfimport\core\sync\rwmutex.di src\core\sync\rwmutex.d
34 modules passed unittests

..\dmd\generated\windows\release\64\dmd -conf= -c -o- -Isrc -Iimport -Hfimport\core\sync\semaphore.di src\core\sync\semaphore.d
34 modules passed unittests


"make" -f mak/WINDOWS copydir HOST_DMD="dmd" MODEL=64 IMPDIR="import"
conf= -c -o- -Isrc -Iimport -Hfimport\core\sync\barrier.di src\core\sync\barrier.d
Error: 'conf=' not found

--- errorlevel 1

C:\source\D\druntime>



January 29, 2022
On Saturday, 29 January 2022 at 07:41:02 UTC, forkit wrote:
>

copydir:
	"$(MAKE)" -f mak/WINDOWS copydir HOST_DMD="$(HOST_DMD)" MODEL=$(MODEL) IMPDIR="$(IMPDIR)"

so it seems the line above (in file: C:\source\D\druntime\win64.mak )
is causing a problem, when I run:

> cd C:\source\D\druntime
> make -f win64.mak
(error is below)

"make" -f mak/WINDOWS import DMD="..\dmd\generated\windows\release\64\dmd" HOST_DMD="dmd" MODEL=64 IMPDIR="import"
..\dmd\generated\windows\release\64\dmd -conf= -c -o- -Isrc -Iimport -Hfimport\core\sync\barrier.di src\core\sync\barrier.d
34 modules passed unittests

..\dmd\generated\windows\release\64\dmd -conf= -c -o- -Isrc -Iimport -Hfimport\core\sync\condition.di src\core\sync\condition.d
34 modules passed unittests

..\dmd\generated\windows\release\64\dmd -conf= -c -o- -Isrc -Iimport -Hfimport\core\sync\config.di src\core\sync\config.d
34 modules passed unittests

..\dmd\generated\windows\release\64\dmd -conf= -c -o- -Isrc -Iimport -Hfimport\core\sync\exception.di src\core\sync\exception.d
34 modules passed unittests

..\dmd\generated\windows\release\64\dmd -conf= -c -o- -Isrc -Iimport -Hfimport\core\sync\mutex.di src\core\sync\mutex.d
34 modules passed unittests

..\dmd\generated\windows\release\64\dmd -conf= -c -o- -Isrc -Iimport -Hfimport\core\sync\rwmutex.di src\core\sync\rwmutex.d
34 modules passed unittests

..\dmd\generated\windows\release\64\dmd -conf= -c -o- -Isrc -Iimport -Hfimport\core\sync\semaphore.di src\core\sync\semaphore.d
34 modules passed unittests


"make" -f mak/WINDOWS copydir HOST_DMD="dmd" MODEL=64 IMPDIR="import"
conf= -c -o- -Isrc -Iimport -Hfimport\core\sync\barrier.di src\core\sync\barrier.d
Error: 'conf=' not found

--- errorlevel 1

January 29, 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.

Not an expert here, I just wonder. As DMD now supports cross compilation,the easiest solution would be to provide a Docker Image which compiles your local source files.
Therefore you need only the DMD sources and Docker on your windows OS, nothing more.

Kind regards
Andre



January 29, 2022

On Saturday, 29 January 2022 at 09:17:08 UTC, forkit wrote:

>

On Saturday, 29 January 2022 at 07:41:02 UTC, forkit wrote:

>

Compiling is a hassle, especially for software with holes..
However it seems that DMD only needs to click ondmd.sln inwindows, and then it's done.

January 29, 2022

On Saturday, 29 January 2022 at 07:41:02 UTC, forkit wrote:

>

[...]
C:\source\D\druntime>make -f win64.mak
"make" -f mak/WINDOWS import DMD="..\dmd\generated\windows\release\64\dmd" HOST_DMD="dmd" MODEL=64 IMPDIR="import"
..\dmd\generated\windows\release\64\dmd -conf= -c -o- -Isrc -Iimport -Hfimport\core\sync\barrier.di src\core\sync\barrier.d
34 modules passed unittests
[...]

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.