Visual D error messages not useful

FunkyD MrFunky at YourDaddy.com
Fri May 15 09:57:54 UTC 2020


On Thursday, 14 May 2020 at 06:37:46 UTC, Rainer Schuetze wrote:
>
>
> On 12/05/2020 18:33, FunkyD wrote:
>> Win32\Debug DMD\TestApp.exe not up to date: command line 
>> changed
>> ------ Build started: Project: TestApp, Configuration: Debug 
>> DMD Win32
>> ------
>> Building Win32\Debug DMD\TestApp.exe...
>>         1 file(s) copied.
>
> I haven't found any invocation of "copy" in the batches 
> generated by Visual D, is that the output of a custom build 
> step?
>
Yes, but it is just a copy, it doesn't fail and has nothing to do 
with the problems below.

>> Building Win32\Debug DMD\TestApp.exe failed!
>> Details saved as
>> "file://C:\TestApp\TestApp\Win32\Debug%20DMD\TestApp.buildlog.html"
>> Build time: 9 s
>> Solution build stopped.
>> Build has been canceled.
>> 
>> I have no idea why my app won't compile. Same stuff in x64 
>> mode. It used to compile but it's been a while since I've 
>> tried and have updated dmd and visual d several times since. 
>> Nothing in the log
>> 
>> In the html file:
>> 
>> if %errorlevel% neq 0 goto reportError
>
> All usages of this statement follow an invocation of some 
> program that is expected to print its own message on failure.
>

The problem is if those programs are missing then no error is 
reported or if they don't report errors. As I said, I have no 
idea which reportError is being called. If you were to generate a 
simple verbose stepping so that at the very least one would get 
something like:

Error 3:
which would be empty but I would be able to go to the 3rd error 
and look at the line above it to see what is going on:

...
if %errorlevel% neq 0 (
     echo error 3
     goto reportError)

> Other similar cases add a message about what is probably wrong.
>

I copied exactly the error output and as you can see nothing is 
telling me what is wrong. I literally have zero idea what it 
could be. I copy a file but that clearly is not failing.

You could also add some text to partition off the build steps.
----- Custom Prebuild commands ----
...Whatever...
-----------------------------------
----- Compiling ----
...Whatever...
-----------------------------------

etc...

>> ...
>> :reportError
>> echo Building Win32\Debug DMD\TestApp.exe failed!
>> 
>> Which is a useless error message. Can we not get an error 
>> message that actually helps and also maybe the line number 
>> which of the html file that has the error?
>> 
>
> The html file is just a capture of the output pane.

Surely not, the html file is a batch file. It looks like the 
TestApp.build.cmd file. The output pane is what I copied and 
pasted in the OP. It is very uninformative.

I'm suggesting that you modify the generation of the .build.cmd 
file to print better error diagnostics and tracking.


>> 
>> Suggestions:
>> 
>> 1. Replace the error goto's with more useful info such as 
>> passing the
>> line of the batch file(or some unique id to find it) and also 
>> the last
>> line that erred(the line above the if statement usually).
>> 
>> 2. Possibly first check paths that are used by the compilation 
>> process and all the exe's used to make sure they exist. Do 
>> this first before compiling. I'm thinking maybe something 
>> changed with the windows libraries but I have no idea because 
>> the buildlog is large and has many of those error goto's that 
>> any one could have been the problem.
>> 
>
> Indeed there might be cases where the invoked executable is not 
> found by the system, and the cmd interpreter just reports 
> "command not found" or similar without telling what comamnd is 
> invoked. Retrying that now, it seems that has changed, maybe 
> with recent Windows versions.
>

Not sure, I sorta always have this problem with visual D when I 
don't use it for a while and come back and get some error and 
then have to track down what changed. Usually it seems to be an 
issue with DMD or windows SDK changes. (cause usually I had to 
update the SDK or I update DMD since a new version came out)

>> 
>> I'm pretty sure you generate the build batch file so you could 
>> easily automate adding better checking like this(unique id or 
>> line number) along with printing out the command line that 
>> failed or whatever fails. Also it should be easy to add a few 
>> `if exists` type of checks for the various paths used in 
>> building(both windows stuff and dmd/visual d). Normally these 
>> checks should pass fine but in some cases they won't and it 
>> would be helpful to have that info.
>> 
>> 
>> Maybe even have a verbose mode that provides more info?
>
> You can run the generated batch (e.g. Debug\TestApp.build.cmd) 
> from the
> command line (from the folder of the project). This will echo 
> the
> executed commands to the console.
>
> Maybe an option to show this output in the output window would 
> help.

Yes, it might, but I'd still like a little better error handling 
because it still might be a lot to sift through otherwise.

I think making sure all paths contain the appropriate files 
required would be of great benefit so that when SDK's change or 
whatever it catches them and prints a meaningful error message. 
It should be quite simple to do.

You could have a verbose output flag that adds all this or always 
add the error checks and then verbosity could print out the full 
output.


It can't hurt to have extra validity checks and some "line 
numbering" for the errors so when things don't output we at least 
have some connection.

-------------
When I run the cmd I do get an error from the pipedmd command:

std.file.FileException at std\file.d(4602): x64\Debug DMD: The 
system cannot find the path specified.

also I see a lot of

The system cannot find the path specified.

but it seems I have to run it in the base dir... because the 
paths are relative to it....

-----
Ok, so now when I run it at the pipedmd I get a dmd windows crash.


I have no idea why.

------------

So, it seems dmd.exe is crashing(possibly a compiler fault which 
is a regression). Pipedmd isn't catching that it is crashing in 
any meaningful way but just errors out.

So basically I'm stuck with an app that won't compile because dmd 
seems to be faulting and I have no info why. (Used to dmd would 
print some diagnostic errors)




More information about the Digitalmars-d-ide mailing list