Thread overview
Re: A DUB Case Study: Compiling DMD as a Library
Dec 20
Venkat
Dec 21
Venkat
December 20
This is regarding the latest D blog post. Jacob Carlborg is here, so I figured I'd post it.

https://dlang.org/blog/2017/08/01/a-dub-case-study-compiling-dmd-as-a-library/#comment-2922

Simply changing the targetType from library to dynamicLibrary breaks the code. What is going on with it ?

--dub.sdl--
name "dmd-dub-test"
description "Test of the DMD Dub package"
license "BSL 1.0"

sourcePaths "."
targetType "library"
dependency "dmd" path="../DSource/dmd/"
--end dub.sdl--

-- output --
venkat@venkat-U46E /d/Documents/NetbeansProjects/dmd-test $ dub build
Performing "debug" build using dmd for x86_64.
-- end output --

--dub.sdl--
name "dmd-dub-test"
description "Test of the DMD Dub package"
license "BSL 1.0"

sourcePaths "."
targetType "dynamicLibrary"
dependency "dmd" path="../DSource/dmd/"
--end dub.sdl--

Performing "debug" build using dmd for x86_64.
dmd ~stable: building configuration "library"...
../DSource/dmd/src/ddmd/scanmscoff.d(180,10): Error: undefined identifier WORD
../DSource/dmd/src/ddmd/scanmscoff.d(181,10): Error: undefined identifier WORD
../DSource/dmd/src/ddmd/scanmscoff.d(182,10): Error: undefined identifier WORD
../DSource/dmd/src/ddmd/scanmscoff.d(183,10): Error: undefined identifier WORD
../DSource/dmd/src/ddmd/scanmscoff.d(184,11): Error: undefined identifier DWORD
../DSource/dmd/src/ddmd/scanmscoff.d(185,15): Error: undefined identifier BYTE
../DSource/dmd/src/ddmd/scanmscoff.d(185,15): Error: undefined identifier BYTE
../DSource/dmd/src/ddmd/scanmscoff.d(187,14): Error: undefined identifier DWORD
../DSource/dmd/src/ddmd/scanmscoff.d(187,14): Error: undefined identifier DWORD
../DSource/dmd/src/ddmd/scanmscoff.d(188,11): Error: undefined identifier DWORD
../DSource/dmd/src/ddmd/scanmscoff.d(189,11): Error: undefined identifier DWORD
../DSource/dmd/src/ddmd/scanmscoff.d(190,11): Error: undefined identifier DWORD
../DSource/dmd/src/ddmd/scanmscoff.d(196,11): Error: undefined identifier WORD
../DSource/dmd/src/ddmd/scanmscoff.d(197,11): Error: undefined identifier WORD
../DSource/dmd/src/ddmd/scanmscoff.d(198,11): Error: undefined identifier DWORD
../DSource/dmd/src/ddmd/scanmscoff.d(199,11): Error: undefined identifier DWORD
../DSource/dmd/src/ddmd/scanmscoff.d(200,11): Error: undefined identifier DWORD
../DSource/dmd/src/ddmd/scanmscoff.d(201,11): Error: undefined identifier WORD
../DSource/dmd/src/ddmd/scanmscoff.d(202,11): Error: undefined identifier WORD
../DSource/dmd/src/ddmd/scanmscoff.d(225,24): Error: undefined identifier BYTE
dmd failed with exit code 1.
December 20
On 2017-12-20 05:52, Venkat wrote:
> 
> This is regarding the latest D blog post. Jacob Carlborg is here, so I figured I'd post it.
> 
> https://dlang.org/blog/2017/08/01/a-dub-case-study-compiling-dmd-as-a-library/#comment-2922 
> 
> 
> Simply changing the targetType from library to dynamicLibrary breaks the code. What is going on with it ?
> 
> --dub.sdl--
> name "dmd-dub-test"
> description "Test of the DMD Dub package"
> license "BSL 1.0"
> 
> sourcePaths "."
> targetType "library"
> dependency "dmd" path="../DSource/dmd/"
> --end dub.sdl--
> 
> -- output --
> venkat@venkat-U46E /d/Documents/NetbeansProjects/dmd-test $ dub build
> Performing "debug" build using dmd for x86_64.
> -- end output --
> 
> --dub.sdl--
> name "dmd-dub-test"
> description "Test of the DMD Dub package"
> license "BSL 1.0"
> 
> sourcePaths "."
> targetType "dynamicLibrary"
> dependency "dmd" path="../DSource/dmd/"
> --end dub.sdl--
> 
> Performing "debug" build using dmd for x86_64.
> dmd ~stable: building configuration "library"...
> ../DSource/dmd/src/ddmd/scanmscoff.d(180,10): Error: undefined identifier WORD
> ../DSource/dmd/src/ddmd/scanmscoff.d(181,10): Error: undefined identifier WORD
> ../DSource/dmd/src/ddmd/scanmscoff.d(182,10): Error: undefined identifier WORD
> ../DSource/dmd/src/ddmd/scanmscoff.d(183,10): Error: undefined identifier WORD
> ../DSource/dmd/src/ddmd/scanmscoff.d(184,11): Error: undefined identifier DWORD
> ../DSource/dmd/src/ddmd/scanmscoff.d(185,15): Error: undefined identifier BYTE
> ../DSource/dmd/src/ddmd/scanmscoff.d(185,15): Error: undefined identifier BYTE
> ../DSource/dmd/src/ddmd/scanmscoff.d(187,14): Error: undefined identifier DWORD
> ../DSource/dmd/src/ddmd/scanmscoff.d(187,14): Error: undefined identifier DWORD
> ../DSource/dmd/src/ddmd/scanmscoff.d(188,11): Error: undefined identifier DWORD
> ../DSource/dmd/src/ddmd/scanmscoff.d(189,11): Error: undefined identifier DWORD
> ../DSource/dmd/src/ddmd/scanmscoff.d(190,11): Error: undefined identifier DWORD
> ../DSource/dmd/src/ddmd/scanmscoff.d(196,11): Error: undefined identifier WORD
> ../DSource/dmd/src/ddmd/scanmscoff.d(197,11): Error: undefined identifier WORD
> ../DSource/dmd/src/ddmd/scanmscoff.d(198,11): Error: undefined identifier DWORD
> ../DSource/dmd/src/ddmd/scanmscoff.d(199,11): Error: undefined identifier DWORD
> ../DSource/dmd/src/ddmd/scanmscoff.d(200,11): Error: undefined identifier DWORD
> ../DSource/dmd/src/ddmd/scanmscoff.d(201,11): Error: undefined identifier WORD
> ../DSource/dmd/src/ddmd/scanmscoff.d(202,11): Error: undefined identifier WORD
> ../DSource/dmd/src/ddmd/scanmscoff.d(225,24): Error: undefined identifier BYTE
> dmd failed with exit code 1.

Looks like it's trying to build all files again, even though it shouldn't. I suggest you run "dub build --force --vverbose" to see the exact commands that Dub is executing.

For me it works both with "library" and "dynamicLibrary".

-- 
/Jacob Carlborg
December 21
I did a fresh clone of dmd and added that as a dependency. That fixed it. Should've thought of it !! Thankyou.
December 21
On 2017-12-21 05:12, Venkat wrote:
> I did a fresh clone of dmd and added that as a dependency. That fixed it. Should've thought of it !! Thankyou.

Great that it works :)

-- 
/Jacob Carlborg