VS Solution in custom cmake target sometimes hangs - visual-studio-2010

I've expirienced the promlem using CMake. I need to use VS solution (.sln) in one target, so I have something like that:
set(SLN "${SOME_PATH}/src/exemple.sln")
get_filename_component(
VS_DIR "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup\\VS;ProductDir]"
REALPATH CACHE)
set(BUILD_TOOL "${VS_DIR}/Common7/IDE/devenv.exe")
set(BUILD_COMMAND
"${BUILD_TOOL}" "${SLN}" "/build" "Debug"
)
add_custom_target(
${Project_OUTPUT}
COMMAND ${BUILD_COMMAND}
VERBATIM
)
And sometimes this target (when it is being compiled) hangs. Does someone know what it might be? Maybe it doesn't depend on CMake? According to logs, build system starts few projects (from this solution) and does nothing after that:
26>------ Build started: Project: project26, Configuration: Debug Win32 ------
27>------ Build started: Project: project27, Configuration: Debug Win32 ------
28>------ Build started: Project: project28, Configuration: Debug Win32 ------
29>------ Build started: Project: project29, Configuration: Debug Win32 ------

It seems that you need to specify devenv.com instead of devenv.exe. See the output of the following commands:
E:\folder>devenv.exe "E:\folder\solution.sln" /build Debug
E:\folder>devenv.com "E:\folder\solution.sln" /build Debug
Microsoft (R) Visual Studio Version 10.0.40219.1.
Copyright (C) Microsoft Corp. All rights reserved.
========== Build: 0 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
E:\folder>

Related

Unable to get error logs from VS remote debug/deploy

I'm trying to deploy and debug my project on remote machine. My attempt to deploy and debug my code fails and Visual Studio provides me with following log:
1>------ Deploy started: Project: ProjectName, Configuration: Debug x64 ------
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========
Any ideas how I may get more output with some actual error codes?
Environment:
MSVS 2019 16.11.5
Verbosity level -- diagnostic both for build output and log file

No buildtime speedup after using Incredibuild with Visual Studio Solution file

I am trying to use Xoreax Incredibuild(v 8.01) to buid LLVM solution file using “BuildConsole” but I am not seeing any speedup in the build times.
In the LLVM logs I can see a message Maximum number of concurrent builds reached. Waiting for a build to complete
I believe this could be the reason that I am not seeing the benefit of using Incredibuild to build LLVM.
Version of Visual Studio used by Incredibuild to build the solution file is 2015.
Has anyone else encountered such a message and if so what is the reason/solution?
I have also tried using IB_profile.xml file to build LLVM and see if it helps in getting rid of the above message but
I am seeing the same message when using XML file to integrate Incredibuild with LLVM.
This is the Make command that I am using to build LLVM with Incredibuild:
BuildConsole LLVM.sln /build "Release|x64" /prj="INSTALL" /AvoidLocal=On /profile=IB_profile.xml
This is the content of IB_profile.xml file:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Profile FormatVersion="1">
<Tools>
<Tool Filename="devenv" AllowIntercept="true" AllowRemote="true" AllowPredictedBatch="true" VCCompiler="true" OutputFileMasks="*.exe,*.dll" />
<Tool Filename="cl" AllowRemote="true" AllowPredictedBatch="true" VCCompiler="true" OutputFileMasks="*.exe,*.dll" />
</Tools>
</Profile>
Below is the snippet of LLVM logs:
BuildConsole LLVM.sln /build "Release|x64" /prj="INSTALL" /AvoidLocal=On /profile=IB_profile.xml
-----------------------------------------------------------------
Build Acceleration Console 8.2 (build 1885)
Copyright (C) 2001-2017 Xoreax Software Ltd. All rights reserved.
-----------------------------------------------------------------
-- Generating done
CMake Warning:
Manually-specified variables were not used by the project:
CMAKE_MODULE_LINKER_FLAGS
-- Build files have been written to: C:/TEMP/rohit/win64/LLVM
BuildConsole LLVM.sln /build "Release|x64" /prj="INSTALL" /AvoidLocal=On /profile=IB_profile.xml
-----------------------------------------------------------------
Build Acceleration Console 8.2 (build 1885)
Copyright (C) 2001-2017 Xoreax Software Ltd. All rights reserved.
-----------------------------------------------------------------
Maximum number of concurrent builds reached.
Waiting for a build to complete...
--------------------Build System Warning---------------------------------------
Predicted Execution mode automatically disabled:
Predicted Execution mode cannot be set together with DisableStdOutIdentify flag.
Please note the disabled predicted execution feature has no effect on build integrity.
-------------------------------------------------------------------------------
Active code page: 437
Microsoft Visual Studio 2015 Version 14.0.25420.1.
Copyright (C) Microsoft Corp. All rights reserved.
1>------ Build started: Project: LLVMSupport, Configuration: Release x64 ------
2>------ Build started: Project: LLVMTableGen, Configuration: Release x64 ------
3>------ Build started: Project: obj.llvm-tblgen, Configuration: Release x64 ------
4>------ Build started: Project: LLVMMC, Configuration: Release x64 ------
5>------ Build started: Project: LLVMMCDisassembler, Configuration: Release x64 ------
6>------ Build started: Project: LLVMMCParser, Configuration: Release x64 ------
7>------ Build started: Project: LLVMOption, Configuration: Release x64 ------
8>------ Build started: Project: LLVMDebugInfoDWARF, Configuration: Release x64 ------
9>------ Build started: Project: LLVMSymbolize, Configuration: Release x64 ------
10>------ Build started: Project: LTO_exports, Configuration: Release x64 ------
11>------ Build started: Project: LLVMDebugInfoPDB, Configuration: Release x64 ------
12>------ Build started: Project: LLVMLineEditor, Configuration: Release x64 ------
13>------ Build started: Project: count, Configuration: Release x64 ------
14>------ Build started: Project: gtest, Configuration: Release x64 ------
15>------ Build started: Project: gtest_main, Configuration: Release x64 ------
16>------ Build started: Project: llvm-PerfectShuffle, Configuration: Release x64 ------
My name is Yoni Davidson and I am from IncrediBuild support team.
Building the LLVM Solution using BuildConsoel shouldn't require profile.xml since it is a Visual Studio Solution and IncrediBuild should handle it.
Therefore, it is possible that either you dont have remote machines (Helpers) and/or perhaps you dont have enough parallel tasks so the performance is more or less as you have with Visual Studio since everything runs locally.
The "Maximum number of concurrent builds reached" means that you are trying to start another build with IncrediBuild while the previous one is still running. This is not allowed and therefore, you receive this message. In any case, this is not the reason for the build performance you have.
I will be happy to assist you with this problem so I suggest that you will contact us directly: support#incredibuild.com or simply right click on IncrediBuild tray icon -> contact support.
Looking forward hearing from you.

vs2012 doesn't pass /projectconfig to dependencies?

TLDR; devenv appears to build dependencies with whatever config/platform was last selected in the GUI, rather than what /projectconfig says. Ideas?
I have a Visual Studio 2012 solution that builds debug & release, win32 & x64. It has two projects
"common" produces a static library
"foo" produces a dll, and links with common.lib
Both projects output to $(SolutionDir)$(Configuration)_$(Platform), e.g. myTest/Release_Win32 so I can easily swap between configs.
The project foo depends on common, and when I explicitly build foo in the full GUI it properly builds common first, for whichever configuration/platform I'm currently targetting.
However, If I run the command line
devenv.exe myTest/myTest.sln /project foo /projectconfig "Release|x64" /build
Then it will fail because it can't find common.lib when linking. Indeed, there's no myTest/Release_x64/common.lib, but there IS myTest/Debug_Win32/common.lib. I can verify this is caused by that devenv command, it re-appears after removing all the directories.
It appears devenv is trying to build common as a dependency, but failing to specify the projectconfig and falling back to the default Debug & Win32.
I can work around this by manually building common before attempting to build foo, but I'd prefer it to happen automagically. Has anyone else encountered this, or have a workaround/solution?
Here's a solution that demonstrates the problem, and how I created it:
http://beanalby.net/stackExchange/vsDepends.zip
created "common" as Static Lib with new solution
created "foo" as Console App in that solution
added $(OutDir)common.lib as Additional Dependency under Linker/Input for all configurations on foo
marked "foo" depends on "common"
exited visual studio, saving projects & solution
running devenv myTest/myTest.sln /project foo /projectconfig "Release|x64" /build produces:
C:\Users\jason\Desktop>devenv myTest/myTest.sln /project foo /projectconfig "Release|x64" /build
Microsoft (R) Microsoft Visual Studio 2012 Version 11.0.60610.1.
Copyright (C) Microsoft Corp. All rights reserved.
1>------ Build started: Project: common, Configuration: Debug Win32 ------
1>Build started 11/15/2013 13:15:22.
1>PrepareForBuild:
1> Creating directory "C:\Users\jason\Desktop\myTest\Debug\".
1>InitializeBuildStatus:
1> Creating "Debug\common.unsuccessfulbuild" because "AlwaysCreate" was specified.
1>ClCompile:
1> stdafx.cpp
1>Lib:
1> common.vcxproj -> C:\Users\jason\Desktop\myTest\Debug\common.lib
1>FinalizeBuildStatus:
1> Deleting file "Debug\common.unsuccessfulbuild".
1> Touching "Debug\common.lastbuildstate".
1>
1>Build succeeded.
1>
1>Time Elapsed 00:00:00.52
2>------ Build started: Project: foo, Configuration: Release x64 ------
2>Build started 11/15/2013 13:15:22.
2>PrepareForBuild:
2> Creating directory "C:\Users\jason\Desktop\myTest\x64\Release\".
2>InitializeBuildStatus:
2> Creating "x64\Release\foo.unsuccessfulbuild" because "AlwaysCreate" was specified.
2>ClCompile:
2> stdafx.cpp
2> foo.cpp
2>LINK : fatal error LNK1181: cannot open input file 'C:\Users\jason\Desktop\myTest\x64\Release\comm
on.lib'
2>
2>Build FAILED.
2>
2>Time Elapsed 00:00:00.56
========== Build: 1 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
If you open Visual Studio, change the platform/config to anything else, and exit (it won't ask to save), then common will build as THAT platform/config.
This happens with both the VS2012 x64 Cross Tools Command Prompt and VS2012 x86 Native Tools Command Prompt.
Confirming Hans Passant's comment, The docs for devenv say:
Note
For build-related tasks, it is now recommended that you use MSBuild
instead of devenv. For more information, see MSBuild Command-Line Reference.
Using MSBuild instead as
MSBuild.exe myTest/myTest.sln /t:foo /p:Configuration=Release;Platform=x64
lets it get the platform & config properly. This Q/A shall serve as a warning to those still using devenv on the command line. Repent & switch!

Issues with Visual Studio 2010 project creation

I create a simple Win32 projects, edit the configuration and add new platform configurations (x64). I then batch rebuild my project and I get this output:
------ Rebuild All started: Project: Skribe, Configuration: Release x64 ------
main.c
Generating code
Finished generating code
Skribe.vcxproj -> D:\Dev\Skribe\Build\VS2010\Solutions\..\..\..\Output\Bin\x64\Release\Skribe.exe
------ Rebuild All started: Project: Skribe, Configuration: Debug x64 ------
main.c
Skribe.vcxproj -> D:\Dev\Skribe\Build\VS2010\Solutions\..\..\..\Output\Bin\x64\Debug\Skribe.exe
Skribe.vcxproj -> D:\Dev\Skribe\Build\VS2010\Solutions\..\..\..\Output\Bin\x64\Debug\Skribe.exe
------ Rebuild All started: Project: Skribe, Configuration: Release Win32 ------
main.c
Generating code
Finished generating code
Skribe.vcxproj -> D:\Dev\Skribe\Build\VS2010\Solutions\..\..\..\Output\Bin\Win32\Release\Skribe.exe
------ Rebuild All started: Project: Skribe, Configuration: Debug Win32 ------
main.c
Skribe.vcxproj -> D:\Dev\Skribe\Build\VS2010\Solutions\..\..\..\Output\Bin\Win32\Debug\Skribe.exe
========== Rebuild All: 4 succeeded, 0 failed, 0 skipped ==========
The debug x64 build outputs the exe creation message twice and I cannot figure out why. This worries because of a related question I asked where a rebuild actually fails but a clean/build succeeds.
Does anyone know why the extra message is shown? I've done nothing else other than create a solution, exe project, add x64 configuration and batch rebuild.

Output window VS2010 won't show any messages after builing solution

I am using Visual Studio 2010 Ultimate and suddenly the output window won't show any messages after building solution. For example:
1>------ Build started: Project: libdnet-stripped, Configuration:
Release Win32 ------
2>------ Build started: Project: tran_cli, Configuration: Release
Win32 ------
========== Build: 0 succeeded, 2 failed, 4 up-to-date, 0 skipped ==========
And Error List is empty. How can I fix it?

Resources