See complete log of command line build?

Go To Last Post
16 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hey guys,

 

I would like to see the complete build log when doing a build from command line. I want to use this in Jenkins.

 

The command that I run to perform the build:

set ATMEL_PATH="C:\Program Files (x86)\Atmel\Studio\7.0\AtmelStudio.exe"
%ATMEL_PATH% MySolution.atsln /out Output.txt /build Debug /project MyProject

But then in the Output.txt file only this is shown:

------ Build started: Project: MyProject, Configuration: Debug ARM ------
========== Build: 0 succeeded or up-to-date, 1 failed, 0 skipped ==========

While on my other PC when using the full IDE it shows all kind of information in between these two lines... What setting am I missing?

 

Thanks in advance.

This topic has a solution.

Last Edited: Mon. Oct 29, 2018 - 09:11 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

AFAIK they are using MSBuild so google the options for that to set verbosity.

 

In the real VS2015 (on which AS7 is based) Tools-options has entry for setting MSBuild options, maybe this carries over into AS7.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well, for the normal Visual Studio's MSbuild command it works with adding -verbosity:normal. But the Atmel Studio command line is different. There is more going on than just MSbuild, and unfortunately the interface is quite limited.

 

When adding the argument -verbosity:normal to the command line Atmel Studio gives me this error:

Invalid Command Line. Unknown Switch : verbosity:normal.

Use:
appenv  [solutionfile | projectfile | anyfile.ext]  [switches]

The first argument for Microsoft Visual Studio 2015 Shell (Isolated) is usually a solution file or project file.
You can also use any other file as the first argument if you want to have the
file open automatically in an editor. When you enter a project file, the IDE
looks for an .sln file with the same base name as the project file in the
parent directory for the project file. If no such .sln file exists, then the
IDE looks for a single .sln file that references the project. If no such single .sln file exists, then the IDE creates an unsaved solution with a default .sln
file name that has the same base name as the project file.

Command line builds:
appenv solutionfile.sln /build [ solutionconfig ] [ /project projectnameorfile [ /projectconfig name ] ]

Available command line switches:

/build	Builds the solution or project with the specified
	configuration.
/project	Specifies the project to build, clean, or deploy.
	Must be used with /build, /rebuild, /clean, or /deploy
/projectconfig	Specifies the project configuration to build or deploy.
	Must be used with /project
/out	Specifies the file to write build errors.
/rebuild	Cleans and then builds the solution or project with the
	specified configuration.
/clean	Deletes build outputs.
/deploy	Builds and then deploys the specified build configuration.
/run	Compiles and runs the specified solution.
/runexit	Compiles and runs the specified solution and then
	closes the IDE.
/command	Starts the IDE and executes the command.
/mditabs	Opens the IDE with tabbed documents selected.
/mdi	Opens the IDE in multiple-document interface mode.
/LCID	Sets the default language in the IDE for the UI.
/noVSIP	Disables the VSIP developer's license key for VSIP testing.
/safemode	Launches the IDE in safe mode, loading minimal windows.
/resetskippkgs	Clears all SkipLoading tags added to VSPackages.
/Edit	Opens the specified files in a running instance of this
	application. If there are no running instances, it will
	start a new instance with a simplified window layout.

Product-specific switches:

/debugexe	Open the specified executable to be debugged. The remainder of 
	the command line is passed to this executable as its arguments.
/diff	Compares two files.  Takes four parameters:
	SourceFile, TargetFile, SourceDisplayName(optional),
	TargetDisplayName(optional)

To attach the debugger from the command line, use:
	VsJITDebugger.exe -p <pid>

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Short way to fix this is to open Studio in the machine once. This sets the reg keys that controll build verbosity.

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hey yeah you're right. I had never started the IDE even once at my build server. Once I did that and just retried it with the same command it was generating the proper information in the output file. Thanks! But to be honest the limited command line interface is still quite stupid from Atmel Studio...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Jupp, can't disagree on that :-)

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hmm unfortunately I am not yet where I want to be. Turns out when I do the command myself in a Windows cmd window it works as expected. But the same command done by Jenkins gives me a different result. How is that possible?

 

See here the contents of Output.txt once again:

------ Build started: Project: MyProject, Configuration: Debug ARM ------
Build started.
Project "MyProject.cppproj" (default targets):
Target "PreBuildEvent" skipped, due to false condition; ('$(PreBuildEvent)'!='') was evaluated as (''!='').
Target "CoreBuild" in file "C:\Program Files (x86)\Atmel\Studio\7.0\Vs\Compiler.targets" from project "C:\Program Files (x86)\Jenkins\workspace\MyProject\MyProject.cppproj" (target "Build" depends on it):
	Using "RunCompilerTask" task from assembly "C:\Program Files (x86)\Atmel\Studio\7.0\Extensions\Application\AvrGCC.dll".
	Task "RunCompilerTask"
		Shell Utils Path C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils
		C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils\make.exe all --jobs 2 --output-sync
		make: Nothing to be done for 'all'.
	Done executing task "RunCompilerTask".
	Using "RunOutputFileVerifyTask" task from assembly "C:\Program Files (x86)\Atmel\Studio\7.0\Extensions\Application\AvrGCC.dll".
	Task "RunOutputFileVerifyTask"
				Program Memory Usage 	:	10424 bytes   4,0 % Full
				Data Memory Usage 		:	9640 bytes   29,4 % Full
	Done executing task "RunOutputFileVerifyTask".
Done building target "CoreBuild" in project "MyProject.cppproj".
Target "PostBuildEvent" skipped, due to false condition; ('$(PostBuildEvent)' != '') was evaluated as ('' != '').
Target "Build" in file "C:\Program Files (x86)\Atmel\Studio\7.0\Vs\Avr.common.targets" from project "C:\Program Files (x86)\Jenkins\workspace\MyProject\MyProject.cppproj" (entry point):
Done building target "Build" in project "MyProject.cppproj".
Done building project "MyProject.cppproj".

Build succeeded.
========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========

------ Build started: Project: MyProject, Configuration: Debug ARM ------
========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========

As you can see, first it gives a lot of info as expected, second after the Jenkins build it appends to the Output.txt file; no info again. I have no idea how Jenkins could change the way it behaves.

 

Can you explain this behavior?

Last Edited: Sun. Oct 28, 2018 - 07:44 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I've had the same experience with Jenkins+MSBuild trying to setup autobuilding of sln/vcxproj projects. Triggered from Jenkins it behaves differently to invocation on a command line. In the end I  just handed it over to our CI team so I'm not sure what the eventual resolution was.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What user is running the jenkins agent?

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

meolsen wrote:
What user is running the jenkins agent?

 

Good question. It seems Jenkins is run by the user "SYSTEM":

 

Jenkins is run by user "SYSTEM".

 

Is this the cause of the problem? Because I opened the IDE with my local user and probably it set only set the log verbosity registries for that user. So how to "fix" it?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Then, you need to somehow run studio under that user. I would however suggest to run the agent under a local user if possible...

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

meolsen wrote:
Then, you need to somehow run studio under that user. I would however suggest to run the agent under a local user if possible...

 

Moved from problem to problem to problem! But I fixed it by doing this to run Jenkins under a local user account:

 

http://antagonisticpleiotropy.bl...

 

Thanks again meolsen!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you for helping me figure out this!

 

If anyone else faces this problem in the future, there is another solution if you can't change the user of your build agent: You can add the relevant registry key for the log verbosity from your build agent.

 

Just add the following command as build step before your Atmel Studio compilation and you will get the full log output:

reg add HKEY_CURRENT_USER\SOFTWARE\Atmel\AtmelStudio\7.0\General /v MSBuildLoggerVerbosity /t REG_DWORD /d 4

 

Cheers,

Bart

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Why is a registry hack required? Surely that's something that can be set in GUI or CLI ?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I would not consider this a hack. As per the thread above, it is not possible to set this as a command-line argument. Setting it from the GUI is possible, but requires you to be able to run the GUI with the same user as your build agent, which may not be possible in CI environments.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

BSteinmayr wrote:
I would not consider this a hack.
Anything that invites a user to make any kind of direct editing access to the registry is a "hack".