Run CMake Install target with incredibuild - visual-studio-2013

I am trying to use incredibuild to speed up the compilation of a cmake project in command line, compiling with Visual Studio 2013.
I am able to compile and install the libraries by using the command:
BuildConsole zlib.sln /prj=INSTALL /cfg="Debug|x64"
But it skips the install part:
Microsoft Visual Studio 2013 Version 12.0.40629.0.
Copyright (C) Microsoft Corp. All rights reserved.
1>------ Skipped Build: Project: INSTALL, Configuration: Debug x64 ------
1>Project not selected to build for this solution configuration
However, if I execute it from Visual Studio, it works fine:
Initializing...
Microsoft Visual Studio 2013 Version 12.0.40629.0.
Copyright (C) Microsoft Corp. All rights reserved.
1>------ Build started: Project: INSTALL, Configuration: Debug x64 ------
1>Build started 1/6/2016 4:52:09 PM.
1>PrepareForBuild:
1> Creating directory "x64\Debug\INSTALL\INSTALL.tlog\".
1>InitializeBuildStatus:
1> Creating "x64\Debug\INSTALL\INSTALL.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
1>PostBuildEvent:
1> -- Install configuration: "Debug"
1>-- Installing: C:/work/dev/workspace/thirdparty/tmp/install/zlib/lib/zlibd.lib
1>-- Installing: C:/work/dev/workspace/thirdparty/tmp/install/zlib/bin/zlibd.dll
1>-- Installing: C:/work/dev/workspace/thirdparty/tmp/install/zlib/lib/zlibstaticd.lib
1>-- Installing: C:/work/dev/workspace/thirdparty/tmp/install/zlib/include/zconf.h
1>-- Installing: C:/work/dev/workspace/thirdparty/tmp/install/zlib/include/zlib.h
1>-- Installing: C:/work/dev/workspace/thirdparty/tmp/install/zlib/share/man/man3/zlib.3
1>-- Installing: C:/work/dev/workspace/thirdparty/tmp/install/zlib/share/pkgconfig/zlib.pc
1> ...
1>
1>FinalizeBuildStatus:
1> Deleting file "x64\Debug\INSTALL\INSTALL.tlog\unsuccessfulbuild".
1> Touching "x64\Debug\INSTALL\INSTALL.tlog\INSTALL.lastbuildstate".
1>
1>Build succeeded.
1>
1>Time Elapsed 00:00:00.40
========== Build: 1 succeeded, 0 failed, 6 up-to-date, 0 skipped ==========
Any clue ?
Thanks !
Emmanuel

This reply is from the IncrediBuild team:
We have downloaded and tried the same build of zlib-1.2.8 with Microsoft Visual Studio 2013 in our lab.
We've found out that by default in zlib, when using cmake to generate the .sln and .vcxproj files, the generated INSTALL project was NOT included in the build configuration "Debug|x64".
When building the generated zlib.sln for "Debug|x64", it does not build the INSTALL project, not via VS IDE and neither via the BuildConsole command - which is fine, since the project was not included in the build configuration.
Once the INSTALL project is marked as selected to build in the "Debug|x64"
configuration, there is no issue of it being skipped and the project is built correctly.
Either choosing to explicitly build this project for "Debug|x64" or fixing the zlib cmake to include this project to be built in "Debug|x64" fixes the issue.
Disclaimer: the writer is an IncrediBuild employee

The solution that works for me is first run MSBuild on the solution, then on the Install.vcxproj individually. This is completely unrelated to IncrediBuild though, I'm using just plain MSBuild. I suppose IncrediBuild can be used on the solution, then MSBuild on the Install project.
Actually, in my case (without IncrediBuild) just running MSBuild on the Install.vcxproj is enough, it detects the dependencies and builds the other projects before the Install project.

Related

Compile user mode driver in Visual Studio 2013

There is a driver project https://github.com/Psypher9/VG-STC-Driver/tree/master/WinVgStc .
I want to compile it.
I have:
Windows 10 19041.1
Visual Studio 2013 Community 12.0.40629.0
From this page https://learn.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk installed:
Refreshed Windows SDK 10.0.19041.16385 for Windows 10, version 2004
Refreshed WDK for Windows 10, version 2004
Issue:
Trying to build, get errors:
1>------ Build started: Project: WinVgStc, Configuration: Release x64 ------
1> Device.c
1>c:\users\usr\downloads\winvgstc\winvgstc\driver.h(18): fatal error C1083: Cannot open include file: 'wdf.h': No such file or directory
1> Driver.c
1>c:\users\usr\downloads\winvgstc\winvgstc\driver.h(18): fatal error C1083: Cannot open include file: 'wdf.h': No such file or directory
1> Queue.c
1>c:\users\usr\downloads\winvgstc\winvgstc\driver.h(18): fatal error C1083: Cannot open include file: 'wdf.h': No such file or directory
1> Generating Code...
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
When I downloaded this project from GitHub the first error was, that there is no usermode drivers toolset. In project properties I changed it to Visual Studio 2013 (v120). Then I got the error list above.
At this point I didn't have SDK and WDK I mentioned in the list above, so I downloaded it.
After restarting Visual Studio I still have errors. Also there is still only 2 variants of platform toolset in project properties: Visual Studio 2013 (v120) and Visual Studio 2013 - Windows XP (v120_xp).
What should I do to compile it on the current Visual Studio?

Building WiX on Visual Studio Team Services times out

I have an existing XAML build I am porting over to Visual Studio Team Services build. There is a Solution file that contains two wixproj projects, and this builds with no issues on the current (legacy XAML) Hosted Build Controller (which uses WiX Toolset v3.7).
In VS TS, I created a new build process and added a step to Build solution using a Visual Studio Build step. I have set the Solution path to my sln that contains the two wixproj projects. All the other options are the defaults except the timeout which is set to 10 minutes.
The build step initiates but times out after calling the Light.exe step, as in the log below:
PrepareForBuild:
Creating directory "obj\Debug\".
Creating directory "bin\Debug\".
Compile:
C:\Program Files (x86)\WiX Toolset v3.10\bin\candle.exe -dDebug ...
Windows Installer XML Toolset Compiler version 3.10.3.3007
Copyright (c) .NET Foundation and contributors. All rights reserved.
{myfile}.wxs
Link:
C:\Program Files (x86)\WiX Toolset v3.10\bin\Light.exe -out ...
Windows Installer XML Toolset Linker version 3.10.3.3007
Copyright (c) .NET Foundation and contributors. All rights reserved.
##[error]The task has timed out.
The build will run 10 minutes and then throw a timeout error. It usually takes ~1 minute to finish. There is no information in the log about where this may be timing out or why.
I see that VS TS Build uses WiX version 3.10, but WiX version 3.10 works for me locally to build this same sln. I haveve tried all options for Visual Studio Version in the build step with same results.
Any ideas what I am missing and why this isn't working?
I found a post in the wixtoolset GitHub project documenting a bug in WiX 3.10 about deadlocks occurring with WiX projects if there are any warning or error messages generated during the build.
The workaround is to add the following MSBuild Arguments in the build step:
/p:RunWixToolsOutOfProc=true
This resolved my issue with the Light.exe process timing out.
Files (x86)\WiX Toolset v3.10\bin\candle.exe -dDebug ...
Windows Installer XML Toolset Compiler version 3.10.3.3007
Copyright (c) .NET Foundation and contributors. All rights reserved.
{myfile}.wxs
Link:
C:\Program Files (x86)\WiX Toolset v3.10\bin\Light.exe -out ...
Windows Installer XML Toolset

Build doesn’t produce apk

I’m using Visual Studio Tools for Apache Cordova CTP3.1 on VS 2013. Building a simple Blank App template for Android. Build succeeds with no errors, but I can’t find compiled APK file anywhere! bin\Android\ folder contains empty Release and Debug folders. Below is my output from VS build. I don’t see the actual call to Cordova to do the Android build, should it be there? Ripple emulator works just fine.
Thank you.
Build output:
1>------ Build started: Project: BlankCordovaApp1, Configuration: Release Android ------
1>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\TypeScript\Microsoft.TypeScript.targets(95,5): warning : The TypeScript Compiler was given no files for compilation, so it will skip compiling.
1> GeneratedJavascript=
1> C:\Users\XXX\Documents\Visual Studio 2013\Projects\BlankCordovaApp1>call "C:\Program Files\nodejs\"\nodevars.bat
1> Your environment has been set up for using Node.js 0.12.0 (x64) and npm.
1> ------ Ensuring correct global installation of package from source package directory: C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 12.0\COMMON7\IDE\EXTENSIONS\DUZVVBQ3.2O1\packages\vs-mda
1> ------ Name from source package.json: vs-mda
1> ------ Version from source package.json: 0.1.75
1> ------ Current globally installed version: 0.1.75
1> ------ Package already installed globally at correct version.
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
To create apk, you need to select target as Device or Emulator. Apk is not created for Ripple because no package deployment is required, it is just launching the index.html in browser.

Rebuild fails where Clean/Build succeeds in Visual Studio 2010

I've created two projects in a solution, a static library called vm and a console application called vmx. I use the new approach of Framework and References to create the dependency of vm for vmx. I also added x64 platforms to both projects.
Now, when I select Rebuild Solution, I get this output:
1>------ Rebuild All started: Project: vm, Configuration: Debug Win32 ------
1> vm.c
1> vm.vcxproj -> D:\Shared\Dynos\Build\Visual Studio 2010\Solutions\..\..\..\Lib\Win32\Debug\vm.lib
2>------ Rebuild All started: Project: vmx, Configuration: Debug Win32 ------
2> main.c
2>LINK : fatal error LNK1104: cannot open file 'D:\Shared\Dynos\Lib\Win32\Debug\vm.lib'
========== Rebuild All: 1 succeeded, 1 failed, 0 skipped ==========
It as if vm.lib is deleted after being built before vmx is compiled.
If I select Clean Solution, then Build Solution, I get this output:
1>------ Build started: Project: vm, Configuration: Debug Win32 ------
1> vm.c
1> vm.vcxproj -> D:\Shared\Dynos\Build\Visual Studio 2010\Solutions\..\..\..\Lib\Win32\Debug\vm.lib
2>------ Build started: Project: vmx, Configuration: Debug Win32 ------
2> main.c
2> vmx.vcxproj -> D:\Shared\Dynos\Build\Visual Studio 2010\Solutions\..\..\..\Lib\Win32\Debug\vmx.exe
========== Build: 2 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
Everything is OK.
Could someone explain to me what is happening here?
Thanks
I ran into this problem recently as well, and after much head banging, I realized that the output directory was the same on several of the projects. So project A would get rebuilt fine, however when project B was "rebuilt" it would clean out the output directory including projectA's .lib and .dll files, and subsequent project rebuilds would fail.
Our fix for the moment for our auto build was to do a clean, then a build on the solution, instead of doing rebuild or clean/rebuild. Obviously the alternative would be to change the projects to each have their own output directory.
Hope that helps someone!
I found the solution to my problem. The solution is to not to use the Frameworks and References feature in project settings and JUST use the old Project Dependencies system. I removed my reference and clicked the checkbox in the Project Dependencies dialog box and it all works now. Weird!
I huess Frameworks and References is just for C# projects and should be avoided for C++ ones.
For me it was the intermediate directory that has been cleaned before the next project got built. This was really confusing, as I didn't knew what exactly will be separated into that directory and my solution and project files are all in the directory.
If you have the solution file *.sln and the referenced project files *.vcxproj all in one directory, then add $(TargetName)\ to the value of Project Properties > Configuration Properties > General > Intermediate Directory or replace it with $(Configuration)\Int\$(ProjectName)\.
This is needed for me, as I use the project in other solutions, too.
I have encountered similar problems. Certain versions of Visual Studio have this problem (see reference). I was using Visual Studio Community 2022 (64-bit) Version 17.2.6, and switched to different versions (Microsoft Visual Studio Community 2019 Version 16.11.18 and Microsoft Visual Studio Community 2022 RC (64-bit) Version 17.0.0 RC2), which fixed the problem.
1)Might be some dependency issue
OR
2)Some old intermediate files might be remaining during rebuild which
get deleted during clean & are replaced by new, correct ones during fresh build.

Devenv ProjectConfig switch - Win32 and x64

Running Visual Studio 2008 interactively, I can build the project successfully for both the x64 and Win32 targets. However, if I invoke devenv, regardless of my /projectconfig argument, it always performs the x64 build:
devenv /Rebuild Release MySolution.sln /projectconfig "Release|Win32"
Microsoft (R) Visual Studio Version 9.0.21022.8.
Copyright (C) Microsoft Corp. All rights reserved.
------ Rebuild All started: Project: my-project, Configuration: Release x64 ------
Note that the /projectconfig arg doesn't match the Configuration: output. Am I missing something simple? It works fine within the IDE but there are a bunch of targets and I'd prefer to script it.
Thanks in advance!
I'm not sure exactly why this is happening, but does it work with the following?
devenv /Rebuild "Release|Win32" MySolution.sln
Or alternatively, using msbuild:
msbuild MySolution.sln /p:Configuration=Release;Platform=Win32 /t:proj:Rebuild
Using Visual Studio 2019 to build .NET 5 solution with devenv.exe in command line:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\devenv.com SolutionName.sln /build "Release|x86" /project Project /projectconfig Release
Still did not affect on build configuration and used Any CPU instead of x86:
14:08:42 [exec] 80>------ Build started: Project: Project, Configuration: Release Any CPU ------
After dig into Project.csproj (note this is .NET 5 project file format) file I found this:
<Platforms>AnyCPU;x86;x64</Platforms>
Experimentally changed platforms order to:
<Platforms>x86;AnyCPU;x64</Platforms>
And it did the trick:
15:27:30 [exec] 80>------ Build started: Project: Project, Configuration: Release x86 ------
Hope this helps someone who uses devenv.com for assembling nowadays.

Resources