Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSBuild verbosity level #2575

Closed
db4 opened this issue Mar 7, 2018 · 7 comments · Fixed by #4251
Closed

MSBuild verbosity level #2575

db4 opened this issue Mar 7, 2018 · 7 comments · Fixed by #4251
Assignees
Milestone

Comments

@db4
Copy link
Contributor

db4 commented Mar 7, 2018

When building Visual Studio projects via CMake.build() or build_sln_command() default MSBuild verbosity level (normal) is used. It's quite noisy and for big libraries quickly exceeds any CI log size limits. I would like to have a way to control it. Right now I use (not very elegant)

        if "Visual Studio" in cmake.command_line:
            # Make CI logs manageable
            args = ["--", "/verbosity:quiet"]
        else:
            args = []
        cmake.build(args=args)

but I think it's worth conan support. Something like cmake = CMake(self, verbosity="quiet") which adds -- /verbosity:quiet to cmake command line.

BTW, /verbosity:minimal seems to be more appropriate default value for CMake build helper (at least Visual Studio IDE thinks so)

@memsharded
Copy link
Member

I think this shouldn't go hardcoded in the recipe, if any, it should be something that could be configured in conan (maybe conan.conf?) so under different scenarios you can opt between different levels of verbosity. So in case something fails and you need to check, you don't need to modify the recipe, just the configuration.

Also, I suggest increasing the log limits, those logs might eventually be useful if something goes wrong. We haven't had much feedback regarding issues with the log size, lets see if someone else has some feedback.

@db4
Copy link
Contributor Author

db4 commented Mar 10, 2018

I think this shouldn't go hardcoded in the recipe, if any, it should be something that could be configured in conan (maybe conan.conf?) so under different scenarios you can opt between different levels of verbosity. So in case something fails and you need to check, you don't need to modify the recipe, just the configuration.

I agree in general, but in the same time I think that /verbosity:minimal as a default option would make logs much more readable not losing any valuable data. Look:

    55>PrepareForBuild:
         Creating directory "opencv_videostab.dir\Debug\".
         Creating directory "opencv_videostab.dir\Debug\opencv_videostab.tlog\".
       InitializeBuildStatus:
         Creating "opencv_videostab.dir\Debug\opencv_videostab.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
    55>CustomBuild:
         Building Custom Rule C:/.conan/3w28hhqj/1/opencv/modules/videostab/CMakeLists.txt
         CMake does not need to re-run because C:/.conan/esp9ccn8/1/modules/videostab/CMakeFiles/generate.stamp is up-to-date.
       ClCompile:
         C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.13.26128\bin\HostX86\x86\CL.exe /c /IC:\.conan\esp9ccn8\1\3rdparty\ippicv\ippicv_win\include /IC:\.conan\esp9ccn8\1\3rdparty\ippicv\ippiw_win\include /IC:\.conan\esp9ccn8\1 /IC:\.conan\3w28hhqj\1\opencv\modules\videostab\include /IC:\.conan\3w28hhqj\1\opencv\modules\videostab\src /IC:\.conan\esp9ccn8\1\modules\videostab /IC:\.conan\3w28hhqj\1\opencv\modules\core\include /IC:\.conan\3w28hhqj\1\opencv\modules\flann\include /IC:\.conan\3w28hhqj\1\opencv\modules\imgproc\include /IC:\.conan\3w28hhqj\1\opencv\modules\photo\include /IC:\.conan\3w28hhqj\1\opencv\modules\video\include /IC:\.conan\3w28hhqj\1\opencv\modules\imgcodecs\include /IC:\.conan\3w28hhqj\1\opencv\modules\videoio\include /IC:\.conan\3w28hhqj\1\opencv\modules\highgui\include /IC:\.conan\3w28hhqj\1\opencv\modules\features2d\include /IC:\.conan\3w28hhqj\1\opencv\modules\calib3d\include /IC:\Users\Administrator\.conan\data\TBB\4.4.4\conan\testing\package\2c3ed620f02d73526549b31cf660e3e1dc5cd3b1\include /Zi /nologo /W4 /WX- /diagnostics:classic /MP2 /Od /Ob0 /Oi /Oy- /D WIN32 /D _WINDOWS /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /D _VARIADIC_MAX=10 /D __OPENCV_BUILD=1 /D _USE_MATH_DEFINES /D __STDC_CONSTANT_MACROS /D __STDC_LIMIT_MACROS /D __STDC_FORMAT_MACROS /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /EHa /RTC1 /MDd /GS /Gy /arch:SSE2 /fp:fast /Zc:wchar_t /Zc:forScope /Zc:inline /GR /Yc"C:/.conan/3w28hhqj/1/opencv/modules/videostab/src/precomp.hpp" /Fp"opencv_videostab.dir\Debug\opencv_videostab340d.pch" /Fo"opencv_videostab.dir\Debug\\" /Fd"C:\.conan\esp9ccn8\1\lib\Debug\opencv_videostab340d.pdb" /Gd /TP /wd4127 /wd4251 /wd4324 /wd4275 /wd4512 /wd4589 /analyze- /FC /errorReport:queue  /bigobj C:\.conan\esp9ccn8\1\modules\videostab\opencv_videostab_pch.cpp

You actually never need this. That's why Visual Studio IDE uses verbosity:minimal by default - all compiler warning and errors are there without useless MSBuild self-diagnostic.

Also, I suggest increasing the log limits, those logs might eventually be useful if something goes wrong. We haven't had much feedback regarding issues with the log size, lets see if someone else has some feedback.

Well, you cannot control it - it's CI responsibility. I use Gitlab and it have 4Mb log size limit by default - quite enough, I think. If logs getting bigger (with normal verbosity/multiple builds they do), it should be fixed on the build level.

@memsharded
Copy link
Member

Yes I agree, verbosity minimal could be a good default, and I think it is not breaking at all.

What do you think that should be the user interface @lasote? An argument in conan.conf? Or maybe a --verbose argument?

@lasote
Copy link
Contributor

lasote commented Mar 11, 2018

I think it's a classic conan.conf/env var stuff. I think I'm ok reducing the default verbosity if you can increase it anytime to check something. I usually look the CL invocations to see if the flags are the expected ones.

@memsharded
Copy link
Member

Yes, exactly, this is what I am thinking: I also inspect those messages often, so I would like an idiomatic way to set the verbose flag. Typically conan.conf is not very convenient for something that is switched on/off often, so the syntax then would be?

$ conan ... -e BUILD_VERBOSE=True

Maybe also it should be left as-is (verbose) as default, so users can easily inspect output, and being less verbose can be always easily set in CI. Not sure what would be the preferred approached by users.

@kkass
Copy link

kkass commented Apr 12, 2018

I like the ability to pass it as a command line arg. My only concern with what you have above is that this is not accepted by the conan build command.

@memsharded
Copy link
Member

Hi @kkas,

It is not accepted by conan build, but it is stored at conan install and later used at conan build, without needing to specify it. Basically, conan build recovers state from the previous conan install to execute, so the env-var should be there. Could you please try it?

@ghost ghost removed the stage: review label Jan 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants