ldc
ldc copied to clipboard
Bundled Dub can't call LDC on Windows
$ wine ~/data/software/dmd/ldc2-1.32.2-windows-x64/ldc2-1.32.2-windows-x64/bin/dub.exe test
Error Failed to invoke the compiler Z:\home\vladimir\data\software\dmd\ldc2-1.32.2-windows-x64\ldc2-1.32.2-windows-x64\bin\ldc2.exe to determine the build platform: ldc2.exe: Unknown command line argument '-quiet'. Try: 'Z:\home\vladimir\data\software\dmd\ldc2-1.32.2-windows-x64\ldc2-1.32.2-windows-x64\bin\ldc2.exe --help'
ldc2.exe: Did you mean '-i'?
I am running it via Wine but I'm not sure if that matters or not.
Worth noting that it works if I specify the full path to ldmd2.exe
:
$ wine ~/data/software/dmd/ldc2-1.32.2-windows-x64/ldc2-1.32.2-windows-x64/bin/dub.exe test --compiler='Z:\home\vladimir\data\software\dmd\ldc2-1.32.2-windows-x64\ldc2-1.32.2-windows-x64\bin\ldmd2.exe'
Generating test runner configuration 'ae-test-library' for 'library' (sourceLibrary).
...
Isn't this a DUB bug? Indeed LDC and LDMD both do not have a -quiet
cmdline flag.
I am not sure. As a user I would expect that Dub would call the LDC binary in its own directory. I know it has some code to that effect.
I think it also has something which makes it default to the compiler that it was built with.
So, I think the problem is with this "integration" with the LDC package, if you could call it that.
The fact that this slip-up ended up in a published package also possibly indicates some missing integration test?
Indeed LDC and LDMD both do not have a -quiet cmdline flag.
I think ldmd
needs -quiet
because dmd
has -quiet
(although it seems undocumented).
Oh, actually ldmd2
does have -quiet
, it's just (also) undocumented.
The problem is that Dub is trying to call ldc2
with the DMD (or ldmd2
) syntax.
Yep, this seems like a Wine-specific (?) dub issue; this definitely works on native Windows (with ldc2.exe
being the default driver, not ldmd2.exe
). Edit: I.e. it's somehow using the DMDCompiler
implementation, not LDCCompiler
.