How are you supposed to build dstep on Windows?
I installed:
- DMD 2.112.0 (
dmd-2.112.0.exe) from https://dlang.org/download.html#dmd
- Visual Studio Build Tools 2019 (DMD installation offered, selected Build Tools instead of full VS)
- Git (
Git-2.54.0-64-bit.exe)
- LLVM 22.1.8 (
LLVM-22.1.8-win64.exe) from https://github.com/llvm/llvm-project/releases/
Then opened D2 64-bit Command Prompt and:
C:\> git clone https://github.com/jacob-carlborg/dstep.git
C:\> cd dstep
C:\dstep> dub build --arch=x86_64
Pre-gen Running commands for dstep
Starting Performing "debug" build using C:\D\dmd2\windows\bin64\dmd.exe for x86_64.
Building dstep ~master: building configuration [default]
Pre-build Running commands
object.Exception@C:\Users\U\AppData\Local\Temp\app_c498b95f_72ad_4131_a54d_f467df7fb976.d(349): Could not find clang.dll in any of the standard paths for llvm:
Please specify a path manually using './configure --llvm-path=<path>'.
----------------
0x0000000140051937 in d_throwc
0x00000001400034BC in std.exception.bailOut!(object.Exception).bailOut at C:\D\dmd2\windows\bin64\..\..\src\phobos\std\exception.d(521)
0x00000001400033E9 in std.exception.enforce!().enforce!bool.enforce at C:\D\dmd2\windows\bin64\..\..\src\phobos\std\exception.d(442)
0x00000001400016F7 in configure.Path.standardPath at C:\Users\U\AppData\Local\Temp\app_c498b95f_72ad_4131_a54d_f467df7fb976.d(349)
0x00000001400014A2 in configure.Path.path at C:\Users\U\AppData\Local\Temp\app_c498b95f_72ad_4131_a54d_f467df7fb976.d(321)
0x000000014000253C in configure.DynamicConfigurator.generateConfig at C:\Users\U\AppData\Local\Temp\app_c498b95f_72ad_4131_a54d_f467df7fb976.d(603)
0x0000000140002A12 in D main at C:\Users\U\AppData\Local\Temp\app_c498b95f_72ad_4131_a54d_f467df7fb976.d(632)
0x0000000140068143 in void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).runAll().__lambda_L524_C29()
0x0000000140067F9F in void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).tryExec(scope void delegate())
0x000000014006809F in void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).runAll()
0x0000000140067F9F in void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).tryExec(scope void delegate())
0x0000000140067EAA in d_run_main2
0x0000000140051879 in d_run_main
0x0000000140004552 in configure._d_cmain!().main at C:\D\dmd2\windows\bin64\..\..\src\druntime\import\core\internal\entrypoint.d(29)
0x00000001400DE1CE in mainCRTStartup
0x00007FFA41A1E8D7 in BaseThreadInitThunk
0x00007FFA42B28D9C in RtlUserThreadStart
Error Program exited with code 1
Error Command failed with exit code 2: C:\D\dmd2\windows\bin64\dub.exe configure --if-needed
Okay:
C:\dstep>dub configure --llvm-path=C:\LLVM
object.Exception@C:\Users\U\AppData\Local\Temp\app_c498b95f_72ad_4131_a54d_f467df7fb976.d(731): All required libclang libraries could not be found in the path 'C:\LLVM\lib'.
Required libraries are:
clang.dll
----------------
0x0000000140051937 in d_throwc
0x00000001400034BC in std.exception.bailOut!(object.Exception).bailOut at C:\D\dmd2\windows\bin64\..\..\src\phobos\std\exception.d(521)
0x00000001400033E9 in std.exception.enforce!().enforce!bool.enforce at C:\D\dmd2\windows\bin64\..\..\src\phobos\std\exception.d(442)
0x00000001400030BB in configure.enforceLibrariesExist at C:\Users\U\AppData\Local\Temp\app_c498b95f_72ad_4131_a54d_f467df7fb976.d(731)
0x0000000140002582 in configure.DynamicConfigurator.generateConfig at C:\Users\U\AppData\Local\Temp\app_c498b95f_72ad_4131_a54d_f467df7fb976.d(603)
0x0000000140002A12 in D main at C:\Users\U\AppData\Local\Temp\app_c498b95f_72ad_4131_a54d_f467df7fb976.d(632)
0x0000000140068143 in void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).runAll().__lambda_L524_C29()
0x0000000140067F9F in void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).tryExec(scope void delegate())
0x000000014006809F in void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).runAll()
0x0000000140067F9F in void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).tryExec(scope void delegate())
0x0000000140067EAA in d_run_main2
0x0000000140051879 in d_run_main
0x0000000140004552 in configure._d_cmain!().main at C:\D\dmd2\windows\bin64\..\..\src\druntime\import\core\internal\entrypoint.d(29)
0x00000001400DE1CE in mainCRTStartup
0x00007FFA41A1E8D7 in BaseThreadInitThunk
0x00007FFA42B28D9C in RtlUserThreadStart
Error Program exited with code 1
I look at C:\LLVM\lib and indeed there is no clang.dll but there is libclang.lib. And there is libclang.dll in C:\LLVM\bin.
So I apply patch:
diff --git a/configure b/configure
index 7c24ad2..88acff3 100755
--- a/configure
+++ b/configure
@@ -230,7 +230,7 @@ static:
else version (Windows)
{
- enum clangLib = "clang.dll";
+ enum clangLib = "libclang.lib";
immutable string[] llvmLibPaths = [];
enum cppLib = "";
}
C:\dstep>dub configure --llvm-path=C:\LLVM
C:\dstep> dub build --arch=x86_64
Pre-gen Running commands for dstep
Starting Performing "debug" build using C:\D\dmd2\windows\bin64\dmd.exe for x86_64.
Building dstep ~master: building configuration [default]
Pre-build Running commands
Linking dstep
lld-link: warning: ignoring unknown argument '-LC:\LLVM\lib'
lld-link: warning: ignoring unknown argument '-lclang'
lld-link: warning: ignoring unknown argument '-Xlinker'
lld-link: warning: ignoring unknown argument '-rpath'
lld-link: error: could not open 'C:\LLVM\lib': is a directory
Error: linker exited with status 1
C:\D\dmd2\windows\bin64\lld-link.exe /NOLOGO "C:\Users\U\AppData\Local\dub\cache\dstep\~master\build\default-debug-iEEvnHHaGoc2KOdSPMYb0w\dstep.obj" /OUT:"C:\Users\U\AppData\Local\dub\cache\dstep\~master\build\default-debug-iEEvnHHaGoc2KOdSPMYb0w\dstep.exe" /DEFAULTLIB:"version.lib" /DEFAULTLIB:phobos64 /DEBUG @C:\dstep/linker_flags.txt /LIBPATH:"C:\D\dmd2\windows\bin64\..\lib64\mingw"
Error C:\D\dmd2\windows\bin64\dmd.exe failed with exit code 1.
Hmm, I look at linker_flags.txt
-LC:\LLVM\lib
-lclang
-Xlinker -rpath C:\LLVM\lib
And
C:\dstep>C:\D\dmd2\windows\bin64\lld-link.exe /help
OVERVIEW: LLVM Linker
USAGE: C:\D\dmd2\windows\bin64\lld-link.exe [options] file...
OPTIONS:
/align:<value> Section alignment
/aligncomm:<value> Set common symbol alignment
/allowbind:no Disable DLL binding
/allowbind Enable DLL binding (default)
/allowisolation:no Disable DLL isolation
/allowisolation Enable DLL isolation (default)
/alternatename:<value> Define weak alias
/appcontainer:no Image can run outside an app container (default)
/appcontainer Image can only be run in an app container
/base:<value> Base address of the program
/Brepro Use a hash of the executable as the PE header timestamp
--color-diagnostics=<value>
Use colors in diagnostics; one of 'always', 'never', 'auto'
--color-diagnostics Use colors in diagnostics
/debug:<value> Embed a symbol table in the image with option
/debugtype:<value> Debug Info Options
/debug Embed a symbol table in the image
/def:<value> Use module-definition file
/defaultlib:<value> Add the library to the list of input files
/delayload:<value> Delay loaded DLL name
/demangle:no Do not demangle symbols in output
/demangle Demangle symbols in output (default)
/dll Create a DLL
/driver:<value> Generate a Windows NT Kernel Mode Driver
/dynamicbase:no Disable ASLR (default when /fixed)
/dynamicbase Enable ASLR (default unless /fixed)
/entry:<value> Name of entry point symbol
/errorlimit:<value> Maximum number of errors to emit before stopping (0 = no limit)
/export:<value> Export a function
/failifmismatch:<value>
/filealign:<value> Section alignment in the output file
/fixed:no Enable base relocations (default)
/fixed Disable base relocations
/force:multipleres Allow multiply defined resources when creating executables
/force:multiple Allow multiply defined symbols when creating executables
/force:unresolved Allow undefined symbols when creating executables
/force Allow undefined and multiply defined symbols when creating executables
/functionpadmin:<value> Prepares an image for hotpatching
/guard:<value> Control flow guard
/heap:<value> Size of the heap
/highentropyva:no Disable 64-bit ASLR
/highentropyva Enable 64-bit ASLR (default on 64-bit)
/ignore:<value> Specify warning codes to ignore
/implib:<value> Import library name
/include:<value> Force symbol to be added to symbol table as undefined one
/includeoptional:<value>
Add symbol as undefined, but allow it to remain undefined
/incremental:no Overwrite import library even if contents are unchanged
/incremental Keep original import library if contents are unchanged
/integritycheck:no No effect (default)
/integritycheck Set FORCE_INTEGRITY bit in PE header
/largeaddressaware:no Disable large addresses (default on 32-bit)
/largeaddressaware Enable large addresses (default on 64-bit)
/libpath:<value> Additional library search path
/lib Act like lib.exe; must be first argument if present
/linkrepro:<value> Dump linker invocation and input files for debugging
/lldltocache:<value> Path to ThinLTO cached object file directory
/lldltocachepolicy:<value>
Pruning policy for the ThinLTO cache
/lldsavetemps Save temporary files instead of deleting them
/machine:<value> Specify target platform
/manifest:<value> NO disables manifest output; EMBED[,ID=#] embeds manifest as resource in the image
/manifestdependency:<value>
Attributes for <dependency> element in manifest file; implies /manifest
/manifestfile:<value> Manifest output path, with /manifest
/manifestinput:<value> Additional manifest inputs; only valid with /manifest:embed
/manifestuac:<value> User access control
/manifest Create .manifest file
/merge:<value> Combine sections
/mllvm:<value> Options to pass to LLVM
/natvis:<value> Path to natvis file to embed in the PDB
/no-color-diagnostics Do not use colors in diagnostics
/nodefaultlib:<value> Remove a default library
/nodefaultlib Remove all default libraries
/noentry Don't add reference to DllMainCRTStartup; only valid with /dll
/nxcompat:no Disable data execution provention
/nxcompat Enable data execution prevention (default)
/opt:<value> Control optimizations
/order:<value> Put functions in order
/out:<value> Path to file to write output
/pdb:<value> PDB file path
/pdbaltpath:<value> PDB file path to embed in the image
/pdbsourcepath:<value> Base path used to make relative source file path absolute in PDB
--rsp-quoting=<value> Quoting style for response files, 'windows' (default) or 'posix'
/safeseh:no Don't produce an image with Safe Exception Handler
/safeseh Produce an image with Safe Exception Handler (only for x86)
/section:<value> Specify section attributes
/stack:<value> Size of the stack
/stub:<value> Specify DOS stub file
/subsystem:<value> Specify subsystem
/swaprun:cd Make loader run output binary from swap instead of from CD
/swaprun:net Make loader run output binary from swap instead of from network
/swaprun:<value> Comma-separated list of 'cd' or 'net'
/thinlto-emit-imports-files
Emit .imports files with -thinlto-index-only
/thinlto-index-only:<value>
-thinlto-index-only and also write native module names to file
/thinlto-index-only Instead of linking, emit ThinLTO index files
/thinlto-object-suffix-replace:<value>
'old;new' replace old suffix with new suffix in ThinLTO index
/thinlto-prefix-replace:<value>
'old;new' replace old prefix with new prefix in ThinLTO outputs
/threads:no Do not run the linker multi-threaded
/threads Run the linker multi-threaded (default)
/timestamp:<value> Specify the PE header timestamp
/tsaware:no Create non-Terminal Server aware executable
/tsaware Create Terminal Server aware executable (default)
/version:<value> Specify a version number in the PE header
--version Print version information
/wholearchive:<value> Include all object files from this archive
/WX:no Don't treat warnings as errors
/WX Treat warnings as errors
Okay so the generated flags have wrong syntax and not how this DMD/LLVM linker wants it.
I apply patch:
diff --git a/configure b/configure
index 7c24ad2..5b6b6dd 100755
--- a/configure
+++ b/configure
@@ -610,7 +610,7 @@ private:
/// Return: a range of all the necessary linker flags.
auto flags()
{
- return format("-L%1$s\n-lclang\n-Xlinker -rpath %1$s", llvmLibPath)
+ return format("/libpath:%1$s\n/defaultlib:libclang", llvmLibPath)
.only;
}
}
C:\dstep>dub configure --llvm-path=C:\LLVM
C:\dstep>dub build --arch=x86_64
Pre-gen Running commands for dstep
Starting Performing "debug" build using C:\D\dmd2\windows\bin64\dmd.exe for x86_64.
Building dstep ~master: building configuration [default]
Pre-build Running commands
Linking dstep
lld-link: error: undefined symbol: CoCreateGuid
>>> referenced by C:\dstep\clang\Util.d:173
>>> C:\Users\U\AppData\Local\dub\cache\dstep\~master\build\default-debug-iEEvnHHaGoc2KOdSPMYb0w\dstep.obj:(_D5clang4Util10createGUIDFZAya)
Error: linker exited with status 1
C:\D\dmd2\windows\bin64\lld-link.exe /NOLOGO "C:\Users\U\AppData\Local\dub\cache\dstep\~master\build\default-debug-iEEvnHHaGoc2KOdSPMYb0w\dstep.obj" /OUT:"C:\Users\U\AppData\Local\dub\cache\dstep\~master\build\default-debug-iEEvnHHaGoc2KOdSPMYb0w\dstep.exe" /DEFAULTLIB:"version.lib" /DEFAULTLIB:phobos64 /DEBUG @C:\dstep/linker_flags.txt /LIBPATH:"C:\D\dmd2\windows\bin64\..\lib64\mingw"
Error C:\D\dmd2\windows\bin64\dmd.exe failed with exit code 1.
Need ole32 aswell.
diff --git a/configure b/configure
index 7c24ad2..5b6b6dd 100755
--- a/configure
+++ b/configure
@@ -610,7 +610,7 @@ private:
/// Return: a range of all the necessary linker flags.
auto flags()
{
- return format("-L%1$s\n-lclang\n-Xlinker -rpath %1$s", llvmLibPath)
+ return format("/libpath:%1$s\n/defaultlib:libclang /defaultlib:ole32", llvmLibPath)
.only;
}
}
Now finally success and dstep works:
C:\dstep>dub configure --llvm-path=C:\LLVM
C:\dstep>dub build --arch=x86_64
Pre-gen Running commands for dstep
Starting Performing "debug" build using C:\D\dmd2\windows\bin64\dmd.exe for x86_64.
Building dstep ~master: building configuration [default]
Pre-build Running commands
Linking dstep
C:\dstep>.\bin\dstep tests\functional\arrays.h
But all tests that need some C include files (eg. stdlib.h, stdint.h, wchar.h) fail:
C:\dstep>dub test
Warning
Warning ## Warning for package dstep, configuration test-functional ##
Warning
Warning The following compiler flags have been specified in the package description
Warning file. They are handled by DUB and direct use in packages is discouraged.
Warning Alternatively, you can set the DFLAGS environment variable to pass custom flags
Warning to the compiler, or use one of the suggestions below:
Warning
Warning debugMode: Call DUB with --build=debug
Warning debugInfo: Call DUB with --build=debug
Warning unittests: Call DUB with --build=unittest
Warning
Warning
Warning ## Warning for package dstep, configuration test-unit ##
Warning
Warning The following compiler flags have been specified in the package description
Warning file. They are handled by DUB and direct use in packages is discouraged.
Warning Alternatively, you can set the DFLAGS environment variable to pass custom flags
Warning to the compiler, or use one of the suggestions below:
Warning
Warning debugMode: Call DUB with --build=debug
Warning debugInfo: Call DUB with --build=debug
Warning unittests: Call DUB with --build=unittest
Warning
Warning Package dstep (configuration "unittest") defines no import paths, use {"importPaths": [...]} or the default package directory structure to fix this.
Pre-gen Running commands for dstep
Starting Performing "unittest" build using C:\D\dmd2\windows\bin64\dmd.exe for x86_64.
Building dstep ~master: building configuration [unittest]
Pre-build Running commands
Linking wrapper
Running bin\test\wrapper.exe
Running unit tests with clang version 22.1.0 (https://github.com/llvm/llvm-project 4434dabb69916856b824f68a64b029c67175e532)
object.Exception@dstep\translator\HeaderIndex.d(304): The translation unit has to be compiled without errors.
----------------
0x00000001401F2F47 in d_throwc
0x00000001401565D2 in dstep.translator.HeaderIndex.HeaderIndex.this at C:\dstep\dstep\translator\HeaderIndex.d(304)
0x0000000140156510 in dstep.translator.HeaderIndex.HeaderIndex.this at C:\dstep\dstep\translator\HeaderIndex.d(293)
0x00000001401D280E in IncludeGraphTests.__unittest_L71_C1 at C:\dstep\tests\unit\IncludeGraphTests.d(78)
0x00000001401D2F7A in void IncludeGraphTests.__modtest()
0x0000000140215BBB in int core.runtime.runModuleUnitTests().__foreachbody_L603_C5(object.ModuleInfo*)
0x00000001401F5207 in int object.ModuleInfo.opApply(scope int delegate(object.ModuleInfo*)).__lambda_L2519_C13(immutable(object.ModuleInfo*))
0x000000014020B564 in int rt.minfo.moduleinfos_apply(scope int delegate(immutable(object.ModuleInfo*))).__foreachbody_L585_C5(ref rt.sections_win64.SectionGroup)
0x000000014021603C in int rt.sections_win64.SectionGroup.opApply(scope int delegate(ref rt.sections_win64.SectionGroup))
0x000000014020B4EB in int rt.minfo.moduleinfos_apply(scope int delegate(immutable(object.ModuleInfo*)))
0x00000001401F51D7 in int object.ModuleInfo.opApply(scope int delegate(object.ModuleInfo*))
0x0000000140215A60 in runModuleUnitTests
0x000000014020AFA5 in void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).runAll()
0x000000014020AF1F in void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).tryExec(scope void delegate())
0x000000014020AE2A in d_run_main2
0x00000001401F2E89 in d_run_main
0x00000001401E7B42 in __main._d_cmain!().main at C:\D\dmd2\windows\bin64\..\..\src\druntime\import\core\internal\entrypoint.d(29)
0x0000000140296F8E in mainCRTStartup
0x00007FFA41A1E8D7 in BaseThreadInitThunk
0x00007FFA42B28D9C in RtlUserThreadStart
Common.TranslateAssertError@tests\unit\IncludeHandlerTests.d(20):
Cannot compile source code. Errors:
----------------
C:\Users\U\AppData\Local\Temp\dstepA0B0D020C01060C00030507060A0A000.h:1:10: fatal error: 'stdlib.h' file not found
----------------
0x00000001401F2F47 in d_throwc
0x00000001401CD3B0 in Common.assertTranslates at C:\dstep\tests\unit\Common.d(182)
0x00000001401CD7BF in Common.assertTranslates at C:\dstep\tests\unit\Common.d(219)
0x00000001401D300F in IncludeHandlerTests.__unittest_L18_C1 at C:\dstep\tests\unit\IncludeHandlerTests.d(20)
0x00000001401D30ED in void IncludeHandlerTests.__modtest()
0x0000000140215BBB in int core.runtime.runModuleUnitTests().__foreachbody_L603_C5(object.ModuleInfo*)
0x00000001401F5207 in int object.ModuleInfo.opApply(scope int delegate(object.ModuleInfo*)).__lambda_L2519_C13(immutable(object.ModuleInfo*))
0x000000014020B564 in int rt.minfo.moduleinfos_apply(scope int delegate(immutable(object.ModuleInfo*))).__foreachbody_L585_C5(ref rt.sections_win64.SectionGroup)
0x000000014021603C in int rt.sections_win64.SectionGroup.opApply(scope int delegate(ref rt.sections_win64.SectionGroup))
0x000000014020B4EB in int rt.minfo.moduleinfos_apply(scope int delegate(immutable(object.ModuleInfo*)))
0x00000001401F51D7 in int object.ModuleInfo.opApply(scope int delegate(object.ModuleInfo*))
0x0000000140215A60 in runModuleUnitTests
0x000000014020AFA5 in void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).runAll()
0x000000014020AF1F in void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).tryExec(scope void delegate())
0x000000014020AE2A in d_run_main2
0x00000001401F2E89 in d_run_main
0x00000001401E7B42 in __main._d_cmain!().main at C:\D\dmd2\windows\bin64\..\..\src\druntime\import\core\internal\entrypoint.d(29)
0x0000000140296F8E in mainCRTStartup
0x00007FFA41A1E8D7 in BaseThreadInitThunk
0x00007FFA42B28D9C in RtlUserThreadStart
Common.TranslateAssertError@tests\unit\MacroTranslTests.d(608):
Cannot compile source code. Errors:
----------------
C:\Users\U\AppData\Local\Temp\dstepC0F070104010D01040F0C0D0702080F0.h:1:10: fatal error: 'stdint.h' file not found
----------------
0x00000001401F2F47 in d_throwc
0x00000001401CD3B0 in Common.assertTranslates at C:\dstep\tests\unit\Common.d(182)
0x00000001401CD8DB in Common.assertTranslates at C:\dstep\tests\unit\Common.d(235)
0x00000001401D7BF2 in MacroTranslTests.__unittest_L603_C1 at C:\dstep\tests\unit\MacroTranslTests.d(608)
0x00000001401D8480 in void MacroTranslTests.__modtest()
0x0000000140215BBB in int core.runtime.runModuleUnitTests().__foreachbody_L603_C5(object.ModuleInfo*)
0x00000001401F5207 in int object.ModuleInfo.opApply(scope int delegate(object.ModuleInfo*)).__lambda_L2519_C13(immutable(object.ModuleInfo*))
0x000000014020B564 in int rt.minfo.moduleinfos_apply(scope int delegate(immutable(object.ModuleInfo*))).__foreachbody_L585_C5(ref rt.sections_win64.SectionGroup)
0x000000014021603C in int rt.sections_win64.SectionGroup.opApply(scope int delegate(ref rt.sections_win64.SectionGroup))
0x000000014020B4EB in int rt.minfo.moduleinfos_apply(scope int delegate(immutable(object.ModuleInfo*)))
0x00000001401F51D7 in int object.ModuleInfo.opApply(scope int delegate(object.ModuleInfo*))
0x0000000140215A60 in runModuleUnitTests
0x000000014020AFA5 in void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).runAll()
0x000000014020AF1F in void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).tryExec(scope void delegate())
0x000000014020AE2A in d_run_main2
0x00000001401F2E89 in d_run_main
0x00000001401E7B42 in __main._d_cmain!().main at C:\D\dmd2\windows\bin64\..\..\src\druntime\import\core\internal\entrypoint.d(29)
0x0000000140296F8E in mainCRTStartup
0x00007FFA41A1E8D7 in BaseThreadInitThunk
0x00007FFA42B28D9C in RtlUserThreadStart
Common.TranslateAssertError@tests\unit\UnitTests.d(410):
Cannot compile source code. Errors:
----------------
C:\Users\U\AppData\Local\Temp\dstepD000C09040C06020F0E090A030302020.h:1:10: fatal error: 'stdint.h' file not found
----------------
0x00000001401F2F47 in d_throwc
0x00000001401CD3B0 in Common.assertTranslates at C:\dstep\tests\unit\Common.d(182)
0x00000001401CD8DB in Common.assertTranslates at C:\dstep\tests\unit\Common.d(235)
0x00000001401E2202 in UnitTests.__unittest_L405_C1 at C:\dstep\tests\unit\UnitTests.d(410)
0x00000001401E377D in void UnitTests.__modtest()
0x0000000140215BBB in int core.runtime.runModuleUnitTests().__foreachbody_L603_C5(object.ModuleInfo*)
0x00000001401F5207 in int object.ModuleInfo.opApply(scope int delegate(object.ModuleInfo*)).__lambda_L2519_C13(immutable(object.ModuleInfo*))
0x000000014020B564 in int rt.minfo.moduleinfos_apply(scope int delegate(immutable(object.ModuleInfo*))).__foreachbody_L585_C5(ref rt.sections_win64.SectionGroup)
0x000000014021603C in int rt.sections_win64.SectionGroup.opApply(scope int delegate(ref rt.sections_win64.SectionGroup))
0x000000014020B4EB in int rt.minfo.moduleinfos_apply(scope int delegate(immutable(object.ModuleInfo*)))
0x00000001401F51D7 in int object.ModuleInfo.opApply(scope int delegate(object.ModuleInfo*))
0x0000000140215A60 in runModuleUnitTests
0x000000014020AFA5 in void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).runAll()
0x000000014020AF1F in void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).tryExec(scope void delegate())
0x000000014020AE2A in d_run_main2
0x00000001401F2E89 in d_run_main
0x00000001401E7B42 in __main._d_cmain!().main at C:\D\dmd2\windows\bin64\..\..\src\druntime\import\core\internal\entrypoint.d(29)
0x0000000140296F8E in mainCRTStartup
0x00007FFA41A1E8D7 in BaseThreadInitThunk
0x00007FFA42B28D9C in RtlUserThreadStart
core.exception.AssertError@tests\unit\clangTests.d(61): unittest failure
----------------
0x00000001401F2F47 in d_throwc
0x00000001401F3568 in d_unittestp
0x00000001401E408B in clangTests.__unittest_L47_C1 at C:\dstep\tests\unit\clangTests.d(61)
0x00000001401E5C74 in void clangTests.__modtest()
0x0000000140215BBB in int core.runtime.runModuleUnitTests().__foreachbody_L603_C5(object.ModuleInfo*)
0x00000001401F5207 in int object.ModuleInfo.opApply(scope int delegate(object.ModuleInfo*)).__lambda_L2519_C13(immutable(object.ModuleInfo*))
0x000000014020B564 in int rt.minfo.moduleinfos_apply(scope int delegate(immutable(object.ModuleInfo*))).__foreachbody_L585_C5(ref rt.sections_win64.SectionGroup)
0x000000014021603C in int rt.sections_win64.SectionGroup.opApply(scope int delegate(ref rt.sections_win64.SectionGroup))
0x000000014020B4EB in int rt.minfo.moduleinfos_apply(scope int delegate(immutable(object.ModuleInfo*)))
0x00000001401F51D7 in int object.ModuleInfo.opApply(scope int delegate(object.ModuleInfo*))
0x0000000140215A60 in runModuleUnitTests
0x000000014020AFA5 in void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).runAll()
0x000000014020AF1F in void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).tryExec(scope void delegate())
0x000000014020AE2A in d_run_main2
0x00000001401F2E89 in d_run_main
0x00000001401E7B42 in __main._d_cmain!().main at C:\D\dmd2\windows\bin64\..\..\src\druntime\import\core\internal\entrypoint.d(29)
0x0000000140296F8E in mainCRTStartup
0x00007FFA41A1E8D7 in BaseThreadInitThunk
0x00007FFA42B28D9C in RtlUserThreadStart
Common.TranslateAssertError@tests\unit\issues\Issue199.d(12):
Cannot compile source code. Errors:
----------------
C:\Users\U\AppData\Local\Temp\dstep3020000070903050A0104080F0D09000.h:1:10: fatal error: 'stdint.h' file not found
----------------
0x00000001401F2F47 in d_throwc
0x00000001401CD3B0 in Common.assertTranslates at C:\dstep\tests\unit\Common.d(182)
0x00000001401CD7BF in Common.assertTranslates at C:\dstep\tests\unit\Common.d(219)
0x00000001401E66B4 in Issue199.__unittest_L10_C1 at C:\dstep\tests\unit\issues\Issue199.d(12)
0x00000001401E66CD in void Issue199.__modtest()
0x0000000140215BBB in int core.runtime.runModuleUnitTests().__foreachbody_L603_C5(object.ModuleInfo*)
0x00000001401F5207 in int object.ModuleInfo.opApply(scope int delegate(object.ModuleInfo*)).__lambda_L2519_C13(immutable(object.ModuleInfo*))
0x000000014020B564 in int rt.minfo.moduleinfos_apply(scope int delegate(immutable(object.ModuleInfo*))).__foreachbody_L585_C5(ref rt.sections_win64.SectionGroup)
0x000000014021603C in int rt.sections_win64.SectionGroup.opApply(scope int delegate(ref rt.sections_win64.SectionGroup))
0x000000014020B4EB in int rt.minfo.moduleinfos_apply(scope int delegate(immutable(object.ModuleInfo*)))
0x00000001401F51D7 in int object.ModuleInfo.opApply(scope int delegate(object.ModuleInfo*))
0x0000000140215A60 in runModuleUnitTests
0x000000014020AFA5 in void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).runAll()
0x000000014020AF1F in void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).tryExec(scope void delegate())
0x000000014020AE2A in d_run_main2
0x00000001401F2E89 in d_run_main
0x00000001401E7B42 in __main._d_cmain!().main at C:\D\dmd2\windows\bin64\..\..\src\druntime\import\core\internal\entrypoint.d(29)
0x0000000140296F8E in mainCRTStartup
0x00007FFA41A1E8D7 in BaseThreadInitThunk
0x00007FFA42B28D9C in RtlUserThreadStart
Common.TranslateAssertError@tests\unit\issues\Issue8.d(14):
Cannot compile source code. Errors:
----------------
C:\Users\U\AppData\Local\Temp\dstep9040A030D040C0401070C080A0F010A0.h:1:10: fatal error: 'stdint.h' file not found
----------------
0x00000001401F2F47 in d_throwc
0x00000001401CD3B0 in Common.assertTranslates at C:\dstep\tests\unit\Common.d(182)
0x00000001401CD7BF in Common.assertTranslates at C:\dstep\tests\unit\Common.d(219)
0x00000001401E76E7 in Issue8.__unittest_L12_C1 at C:\dstep\tests\unit\issues\Issue8.d(14)
0x00000001401E770D in void Issue8.__modtest()
0x0000000140215BBB in int core.runtime.runModuleUnitTests().__foreachbody_L603_C5(object.ModuleInfo*)
0x00000001401F5207 in int object.ModuleInfo.opApply(scope int delegate(object.ModuleInfo*)).__lambda_L2519_C13(immutable(object.ModuleInfo*))
0x000000014020B564 in int rt.minfo.moduleinfos_apply(scope int delegate(immutable(object.ModuleInfo*))).__foreachbody_L585_C5(ref rt.sections_win64.SectionGroup)
0x000000014021603C in int rt.sections_win64.SectionGroup.opApply(scope int delegate(ref rt.sections_win64.SectionGroup))
0x000000014020B4EB in int rt.minfo.moduleinfos_apply(scope int delegate(immutable(object.ModuleInfo*)))
0x00000001401F51D7 in int object.ModuleInfo.opApply(scope int delegate(object.ModuleInfo*))
0x0000000140215A60 in runModuleUnitTests
0x000000014020AFA5 in void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).runAll()
0x000000014020AF1F in void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).tryExec(scope void delegate())
0x000000014020AE2A in d_run_main2
0x00000001401F2E89 in d_run_main
0x00000001401E7B42 in __main._d_cmain!().main at C:\D\dmd2\windows\bin64\..\..\src\druntime\import\core\internal\entrypoint.d(29)
0x0000000140296F8E in mainCRTStartup
0x00007FFA41A1E8D7 in BaseThreadInitThunk
0x00007FFA42B28D9C in RtlUserThreadStart
7/51 modules FAILED unittests
Error Program exited with code 1
[email protected](97): Failed to execute command: dub --verror --config=test-unit --arch=x86_64
----------------
0x0000000140035147 in d_throwc
0x00000001400013AD in test.executeCommand at C:\dstep\test.d(97)
0x00000001400020DB in test.TestRunner.runTest!"unit".runTest at C:\dstep\test.d(63)
0x0000000140001049 in test.TestRunner.run at C:\dstep\test.d(38)
0x0000000140001020 in D main at C:\dstep\test.d(14)
0x0000000140045543 in void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).runAll().__lambda_L524_C29()
0x000000014004539F in void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).tryExec(scope void delegate())
0x000000014004549F in void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).runAll()
0x000000014004539F in void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).tryExec(scope void delegate())
0x00000001400452AA in d_run_main2
0x0000000140035089 in d_run_main
0x0000000140001EA2 in test._d_cmain!().main at C:\D\dmd2\windows\bin64\..\..\src\druntime\import\core\internal\entrypoint.d(29)
0x00000001400BA40E in mainCRTStartup
0x00007FFA41A1E8D7 in BaseThreadInitThunk
0x00007FFA42B28D9C in RtlUserThreadStart
Error Program exited with code 1
I also tried from x64 Native Tools Command Prompt for VS 2019 but same issue.
How are you supposed to build dstep on Windows?
I installed:
dmd-2.112.0.exe) from https://dlang.org/download.html#dmdGit-2.54.0-64-bit.exe)LLVM-22.1.8-win64.exe) from https://github.com/llvm/llvm-project/releases/Then opened
D2 64-bit Command Promptand:Okay:
I look at
C:\LLVM\liband indeed there is noclang.dllbut there islibclang.lib. And there islibclang.dllinC:\LLVM\bin.So I apply patch:
Hmm, I look at
linker_flags.txtAnd
Okay so the generated flags have wrong syntax and not how this DMD/LLVM linker wants it.
I apply patch:
Need
ole32aswell.Now finally success and
dstepworks:But all tests that need some C include files (eg.
stdlib.h,stdint.h,wchar.h) fail:I also tried from
x64 Native Tools Command Prompt for VS 2019but same issue.