FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Debug build.cmd problems

 
Post new topic   Reply to topic     Forum Index -> Visual D
View previous topic :: View next topic  
Author Message
awishformore



Joined: 03 Sep 2008
Posts: 17

PostPosted: Wed Jun 30, 2010 6:24 pm    Post subject: Debug build.cmd problems Reply with quote

Hello there once again.

I've been fiddling around again to find out where the problems I'm having with VisualD originate. One of these problems is the fact that it becomes impossible to compile a Debug build from within the IDE once you've cleaned the project. It will naturally delete most files, but for some reason, your plugin still expects the .exe_cv file to be there and it's not.

Even if you delete the build.cmd file (or the entire Debug folder, for that matter), your plugin will recreate an erroneous build.cmd file that once more expects the .exe_cv file to still be there, thus failing to compile every time:

Code:
------ Build started: Project: nexuniverse, Configuration: Debug Win32 ------
Building Debug\nexuniverse.exe...
Converting debug information...
Debug\nexuniverse.exe_cv: Can't open file
Building Debug\nexuniverse.exe failed!
Details saved as "file://C:\code\nexuniverse\Debug\buildlog.html"
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Back to top
View user's profile Send private message
sagitario



Joined: 03 Mar 2007
Posts: 292

PostPosted: Fri Jul 02, 2010 2:55 am    Post subject: Reply with quote

Hi,

Hmmm, still cannot reproduce here.

Can you execute the build batch from the command line? Something like running this:

Code:
C:\code\nexuniverse>Debug\nexuniverse.build.cmd


Does this produce the same result?

Another idea: maybe it's an access sharing problem: cv2pdb currently needs exclusive read access to the *.exe_cv which may be blocked by some virus scanner checking the just created file...

Rainer
Back to top
View user's profile Send private message
awishformore



Joined: 03 Sep 2008
Posts: 17

PostPosted: Fri Jul 02, 2010 7:48 am    Post subject: Reply with quote

sagitario wrote:
Hi,

Hmmm, still cannot reproduce here.

Can you execute the build batch from the command line? Something like running this:

Does this produce the same result?

Another idea: maybe it's an access sharing problem: cv2pdb currently needs exclusive read access to the *.exe_cv which may be blocked by some virus scanner checking the just created file...

Rainer


Hey.

There is no .exe_cv file created at all, so it doesn't matter where the build.cmd is executed from (I tried). It also can't really be blocked by the virus scanner if it doesn't exist.

I however think that the issue is in fact not related to VisualD, but rather to optlink. Unfortunately, optlink sometimes doesn't give any feedback on linking errors. I will let you know as soon as I tested this with the fixed D bindings of a C lib.
Back to top
View user's profile Send private message
awishformore



Joined: 03 Sep 2008
Posts: 17

PostPosted: Fri Jul 02, 2010 1:22 pm    Post subject: Reply with quote

Hello again.

I'm no longer able to reproduce it with the fixed binding either. Strangely enough, though, the previous version compiled once but wouldn't compile after deleting the exe_cv again. Now it does. Very weird happenings indeed, but apparently not a VisualD bug.
Back to top
View user's profile Send private message
awishformore



Joined: 03 Sep 2008
Posts: 17

PostPosted: Mon Jul 19, 2010 7:10 pm    Post subject: Reply with quote

Hey there.

I ran into the same issue again and I know what causes it now.

Somehow, this problem seems to come up when rebuilding an application where the linking step fails without message (probably when OPTLINK crashes).

I'm not sure if there is a way to fix this, maybe you could tell the linker to delete the output file on linking error and detect that, there should be a linker flag for that.

Greets, Max.
Back to top
View user's profile Send private message
sagitario



Joined: 03 Mar 2007
Posts: 292

PostPosted: Wed Jul 21, 2010 11:29 am    Post subject: Reply with quote

Hi,

awishformore wrote:
I ran into the same issue again and I know what causes it now.

Somehow, this problem seems to come up when rebuilding an application where the linking step fails without message (probably when OPTLINK crashes).


You could enable verbose messages to see if it is the compiler or the linker that is actually failing.

Quote:
I'm not sure if there is a way to fix this, maybe you could tell the linker to delete the output file on linking error and detect that, there should be a linker flag for that.


The problem seems to be that there is no output file, but dmds exit code tells "success". So there is nothing to delete for the linker. A possible error message would be "dmd did not create app.cv_exe", but that is not a lot different from the error message shown by cv2pdb.

If running debug info through cv2pdb is not enabled, you won't get any error message, but also no exe. In this situation, an error would be nice, so it is not a bad idea to add a check after all.

Rainer
Back to top
View user's profile Send private message
Poita_



Joined: 23 Jul 2010
Posts: 8

PostPosted: Fri Jul 23, 2010 8:20 am    Post subject: Reply with quote

Hi,

I'm having the same issue. I enabled verbose output. This is what I get:

Code:
------ Build started: Project: DGame, Configuration: Debug Win32 ------
Building Debug\DGame.exe...
binary    C:\D\dmd2\windows\bin\dmd.exe
version   v2.047
config    C:\D\dmd2\windows\bin\sc.ini
parse     winmain
parse     glut
parse     opengl
parse     openglu
importall winmain
import    object   (C:\D\dmd2\windows\bin\..\..\src\druntime\import\object.di)
import    std.conv   (C:\D\dmd2\windows\bin\..\..\src\phobos\std\conv.d)
import    core.memory   (C:\D\dmd2\windows\bin\..\..\src\druntime\import\core\memory.di)
import    core.stdc.errno   (C:\D\dmd2\windows\bin\..\..\src\druntime\import\core\stdc\errno.di)
import    core.stdc.string   (C:\D\dmd2\windows\bin\..\..\src\druntime\import\core\stdc\string.di)
import    core.stdc.stddef   (C:\D\dmd2\windows\bin\..\..\src\druntime\import\core\stdc\stddef.di)
import    core.stdc.stdlib   (C:\D\dmd2\windows\bin\..\..\src\druntime\import\core\stdc\stdlib.di)
import    core.stdc.config   (C:\D\dmd2\windows\bin\..\..\src\druntime\import\core\stdc\config.di)
import    std.array   (C:\D\dmd2\windows\bin\..\..\src\phobos\std\array.d)
import    std.c.stdio   (C:\D\dmd2\windows\bin\..\..\src\phobos\std\c\stdio.d)
import    core.stdc.stdio   (C:\D\dmd2\windows\bin\..\..\src\druntime\import\core\stdc\stdio.di)
import    core.stdc.stdarg   (C:\D\dmd2\windows\bin\..\..\src\druntime\import\core\stdc\stdarg.di)
import    std.algorithm   (C:\D\dmd2\windows\bin\..\..\src\phobos\std\algorithm.d)
import    std.c.string   (C:\D\dmd2\windows\bin\..\..\src\phobos\std\c\string.d)
import    std.container   (C:\D\dmd2\windows\bin\..\..\src\phobos\std\container.d)
import    std.contracts   (C:\D\dmd2\windows\bin\..\..\src\phobos\std\contracts.d)
import    std.range   (C:\D\dmd2\windows\bin\..\..\src\phobos\std\range.d)
import    std.traits   (C:\D\dmd2\windows\bin\..\..\src\phobos\std\traits.d)
import    std.typetuple   (C:\D\dmd2\windows\bin\..\..\src\phobos\std\typetuple.d)
import    std.typecons   (C:\D\dmd2\windows\bin\..\..\src\phobos\std\typecons.d)
import    std.metastrings   (C:\D\dmd2\windows\bin\..\..\src\phobos\std\metastrings.d)
import    std.functional   (C:\D\dmd2\windows\bin\..\..\src\phobos\std\functional.d)
import    std.stdio   (C:\D\dmd2\windows\bin\..\..\src\phobos\std\stdio.d)
import    std.stdiobase   (C:\D\dmd2\windows\bin\..\..\src\phobos\std\stdiobase.d)
import    core.stdc.wchar_   (C:\D\dmd2\windows\bin\..\..\src\druntime\import\core\stdc\wchar_.di)
import    core.stdc.time   (C:\D\dmd2\windows\bin\..\..\src\druntime\import\core\stdc\time.di)
import    core.stdc.stdint   (C:\D\dmd2\windows\bin\..\..\src\druntime\import\core\stdc\stdint.di)
import    core.stdc.signal   (C:\D\dmd2\windows\bin\..\..\src\druntime\import\core\stdc\signal.di)
import    std.file   (C:\D\dmd2\windows\bin\..\..\src\phobos\std\file.d)
import    std.date   (C:\D\dmd2\windows\bin\..\..\src\phobos\std\date.d)
import    std.dateparse   (C:\D\dmd2\windows\bin\..\..\src\phobos\std\dateparse.d)
import    std.string   (C:\D\dmd2\windows\bin\..\..\src\phobos\std\string.d)
import    core.exception   (C:\D\dmd2\windows\bin\..\..\src\druntime\import\core\exception.di)
import    core.sys.windows.windows   (C:\D\dmd2\windows\bin\..\..\src\druntime\import\core\sys\windows\windows.di)
import    std.ctype   (C:\D\dmd2\windows\bin\..\..\src\phobos\std\ctype.d)
import    std.encoding   (C:\D\dmd2\windows\bin\..\..\src\phobos\std\encoding.d)
import    std.format   (C:\D\dmd2\windows\bin\..\..\src\phobos\std\format.d)
import    std.bitmanip   (C:\D\dmd2\windows\bin\..\..\src\phobos\std\bitmanip.d)
import    std.intrinsic   (C:\D\dmd2\windows\bin\..\..\src\phobos\std\intrinsic.d)
import    std.stdarg   (C:\D\dmd2\windows\bin\..\..\src\phobos\std\stdarg.d)
import    std.utf   (C:\D\dmd2\windows\bin\..\..\src\phobos\std\utf.d)
import    std.system   (C:\D\dmd2\windows\bin\..\..\src\phobos\std\system.d)
import    std.regex   (C:\D\dmd2\windows\bin\..\..\src\phobos\std\regex.d)
import    std.outbuffer   (C:\D\dmd2\windows\bin\..\..\src\phobos\std\outbuffer.d)
import    std.c.stdlib   (C:\D\dmd2\windows\bin\..\..\src\phobos\std\c\stdlib.d)
import    std.c.stdarg   (C:\D\dmd2\windows\bin\..\..\src\phobos\std\c\stdarg.d)
import    std.uni   (C:\D\dmd2\windows\bin\..\..\src\phobos\std\uni.d)
import    std.c.windows.windows   (C:\D\dmd2\windows\bin\..\..\src\phobos\std\c\windows\windows.d)
import    std.path   (C:\D\dmd2\windows\bin\..\..\src\phobos\std\path.d)
import    std.process   (C:\D\dmd2\windows\bin\..\..\src\phobos\std\process.d)
import    std.c.process   (C:\D\dmd2\windows\bin\..\..\src\phobos\std\c\process.d)
import    std.c.stddef   (C:\D\dmd2\windows\bin\..\..\src\phobos\std\c\stddef.d)
import    std.random   (C:\D\dmd2\windows\bin\..\..\src\phobos\std\random.d)
import    std.c.time   (C:\D\dmd2\windows\bin\..\..\src\phobos\std\c\time.d)
import    std.math   (C:\D\dmd2\windows\bin\..\..\src\phobos\std\math.d)
import    core.stdc.math   (C:\D\dmd2\windows\bin\..\..\src\druntime\import\core\stdc\math.di)
import    std.numeric   (C:\D\dmd2\windows\bin\..\..\src\phobos\std\numeric.d)
import    core.thread   (C:\D\dmd2\windows\bin\..\..\src\druntime\import\core\thread.di)
import    core.thread_helper   (C:\D\dmd2\windows\bin\..\..\src\druntime\import\core\thread_helper.di)
import    std.regexp   (C:\D\dmd2\windows\bin\..\..\src\phobos\std\regexp.d)
import    std.windows.charset   (C:\D\dmd2\windows\bin\..\..\src\phobos\std\windows\charset.d)
import    std.windows.syserror   (C:\D\dmd2\windows\bin\..\..\src\phobos\std\windows\syserror.d)
import    std.__fileinit   (C:\D\dmd2\windows\bin\..\..\src\phobos\std\__fileinit.d)
importall glut
importall opengl
importall openglu
semantic  winmain
semantic  glut
semantic  opengl
semantic  openglu
semantic2 winmain
semantic2 glut
semantic2 opengl
semantic2 openglu
semantic3 winmain
semantic3 glut
semantic3 opengl
semantic3 openglu
code      winmain
function  display
function  main
code      glut
code      opengl
code      openglu
C:\D\dmd2\windows\bin\link.exe "Debug\DGame","Debug\DGame.exe_cv",Debug\DGame.map,"ole32.lib"+"kernel32.lib"+"user32.lib"+"comctl32.lib"+"comdlg32.lib"+"opengl32.lib"+"glu32.lib"+"winmm.lib"+"glut32.lib"+user32+kernel32/m/co/noi/NOMAP;
Converting debug information...
Debug\DGame.exe_cv: Can't open file
Building Debug\DGame.exe failed!
Back to top
View user's profile Send private message
Poita_



Joined: 23 Jul 2010
Posts: 8

PostPosted: Fri Jul 23, 2010 8:37 am    Post subject: Reply with quote

Hmm, I was just messing around and noticed that I can get past this using the following steps:

- Go to linker properties and remove all the library references.
- Build (with errors)
- Go back to linker properties, and put the library references back.
- Build again

That manages to produce the .exe, but now I'm getting a "cannot launch debugger on C:/.../DGame.exe"

Any ideas what's causing this?

EDIT: If I run the exe manually from explorer, I get

"C:/.../DGame.exe is not a valid Win32 application."
Back to top
View user's profile Send private message
sagitario



Joined: 03 Mar 2007
Posts: 292

PostPosted: Fri Jul 23, 2010 8:49 am    Post subject: Reply with quote

Hi,

as it seems, the linker fails silently on libraries that have an unexpected format. If you have passed through the LIB environment variable in DMD's sc.ini, the search path will contain the paths to incompatible libraries from the Visual Studio installation, with e.g. opengl32.lib found there.

Please try removing this entry in sc.ini and add absolute references to the external libraries.

I hope that dmd will add an option to pass a library path to the linker, but until then I should switch to some less common environment variable (e.g. DMD_LIB).

Rainer
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Visual D All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group