Bug 9736 – VS2010 project file does full rebuild every time
Status
RESOLVED
Resolution
FIXED
Severity
trivial
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
Windows
Creation time
2013-03-16T06:09:00Z
Last change time
2013-03-16T09:39:22Z
Keywords
pull
Assigned to
nobody
Creator
dlang-bugzilla
Comments
Comment #0 by dlang-bugzilla — 2013-03-16T06:09:58Z
For some reason, the VS2010 project never appears to be "cleanly built" - every time I hit build or run, it rebuilds DMD entirely, starting from compiling and running idgen. I can reproduce the problem with both VS2010 and 2012.
I've tried to enable CPS diagnostics by adding the system.diagnostics XML snippet to devenv.exe.config [1], but this has produced no insightful output.
This flaw is not present in the VS2008 project file.
[1]: http://blogs.msdn.com/b/vsproject/archive/2009/07/21/enable-c-project-system-logging.aspx
Comment #1 by dlang-bugzilla — 2013-03-16T06:29:57Z
Converting the VS2008 project file to VS2010 created a VS2010 project file that does not exhibit the problem.
Comment #2 by dlang-bugzilla — 2013-03-16T06:54:58Z
And now it doesn't work again. And when I run the conversion again, only optabgen would run every time. Looks like a VS bug.
Comment #3 by dlang-bugzilla — 2013-03-16T07:23:10Z
VS2010's CPS diagnostics output was more helpful. Buried, I found the line:
Information: 0 : Project 'C:\Projects\Extern\D\dmd\src\dmd_msc.vcxproj' not up to date because build input 'C:\PROJECTS\EXTERN\D\DMD\SRC\BACKEND\CPP.H' is missing.
Comment #4 by dlang-bugzilla — 2013-03-16T07:29:13Z
OK... after removing nonexistent files from the project, Visual Studio acknowledges that the project is built right after a build. However, now, after touching one source file, VS still reruns idgen/optabgen/etc.
Comment #5 by r.sagitario — 2013-03-16T07:48:01Z
Yes, msbuild is pretty horrible. Non existing files in the project cause it to think it needs update, but won't find anything to do.
I usually use VS2008, but I don't have problems with unnecessary rebuilding the generated files with VS2012. They do have dependencies to a few source files though (e.g. mtype.h).
Comment #6 by dlang-bugzilla — 2013-03-16T07:49:17Z
I've set the msbuild debug level to "Diagnostic". In the build log file, I see this line:
"Forcing rebuild of source file "C:\Projects\Extern\D\dmd\src\idgen.c" due to a change in the command line since the last build. (TaskId:16)"
Comment #7 by dlang-bugzilla — 2013-03-16T08:14:15Z
I found the problem. It was caused by newlines in the custom build tools' command line. I've replaced the "if" lines with the && operator and the problem is gone.
Comment #8 by dlang-bugzilla — 2013-03-16T08:25:20Z