Viewing log file after appveyor script fails - build-error

I am trying to diagnose an error during the build of a project with appveyor. This same project is also built with travis-ci, without any problems. I assume it is windows related.
The script produces some log files, but I have no clue on how these can be viewed after appveyor is done trying to build.
As a specific example: See the log of this build. At line 11706 it says:
Logs have been written to: C:\stack.stack-work\logs\yaml-0.8.28.log
How can I view the contents of that file?

You can push this file as artifact at on_finish stage, or simple RDP to the build worker and explore it interactively.
Side note: you can also try to debug your build in RDP, but note that environment variables from the build session are not available in the RDP session, so you need to re-create all or part of them.

Related

TFS file modification and Server workspace

We are trying to modify some files on the server and then check them back in, before continuing the build.
We do msbuild /t:updateuid to update the XAML files and then I'm thinking using a tf checkin command for checking the files back in.
Problem A: TFS won't recognize file changes. We are using a "Server" workspace - is this preventing TFS from finding the changed files?
If I issue a "tf status" from command prompt, TFS won't find the changed files.
Problem B: Since the tf command will check files in. It might just trigger another build. Probably a minor issue, since the loop hopefully ends there...
Problem A:
As it is a server workspace, you need to perform a tf checkout on the files before changing them. They will then show up in the workspace as a pending change.
Problem B:
End your check in comment with ***NO_CI*** - this will stop any CI builds from triggering.
e.g. Modified by Build ***NO_CI***
If this is a gated build you may need to do other things.

Erratic file naming of *.dacpac files when building a *.sqlproj SSDT project on a TeamCity 7 build server

We have an MSBuild task that builds our *.sqlproj file, the output of which is loaded back into TeamCity as an artifact for subsequent deployment.
Similar to this user, we are having some unpredictable output file naming happen:
Invalid file names when trying to deploy SSDT project with TeamCity 8
It appears that sometimes, it produces this output file under /bin/Release:
MyProj.sqlproj.dacpac
Then subsequent builds produce this file in the same folder:
MyProj.dacpac
We haven't done indepth testing yet - I was wondering if anyone else has seen similar or has a suggested troubleshooting path?
To be clear, it's the same task, running the same command against the same project - just run repeatedly overtime as new checkins happen.
Sounds like you have conflicting .sqlproj files being checked in.
I'd start by checking the history.
Well, after looking more closely at the build log I could see that the TeamCity MSBuild runner appears to be creating some temporary virtual project files (or something, I don't know for sure because they get deleted) with names like:
MyProj.sqlproj.teamcity
I theorized that this may be confusing MSBuild or one of the targets related to building dacpacs, so I replaced the TeamCity MSBuild build step with a Command Line build step that calls MSBuild on the original project file itself, and this appeared to solve the problem. It now produces the dacpac with the file I'm expecting.
I don't have time to dig further now, but I could believe that there's some logic in the chain somewhere that is deriving the name for the final *.dacpac from the name of the project file being used. My guess is that it just strips off everything after the last "." and attaches the ".dacpac" suffix.
I don't fully know why it would occasionally create a *.dacpac file with the correct name, but I was at times doing a manual build in the TeamCity agent work folder from the commandline on the build server itself, so this may have just been a file leftover from previous executions.

Build server fails to load custom code analysis ruleset

We are using Code Analysis on our projects. As part of this we have Code Analysis enabled on the build server allowing for continious checks.
Now we are receiving this error:
CA0063 : * Failed to load rule set file '[name].ruleset' or one of its
dependent rule set files.
[name] being a ruleset on our internal network, available for everyone.
Code Analysis runs perfectly fine on each local machine, but not on the build server. How can we fix this issue?
Notes:
We use a custom made ruleset
We are not using any custom rules (yet)
I was having this issue as well. How I solved it was to add my custom ruleset into version control (Git) as a new directory within my project files. We are using Jenkins for our CI, so in my Jenkins.build I then made sure to specify the absolute file path to my ruleset on the Jenkins server, which you can get by looking at your Workspace on Jenkins. For example the path may look like :
e:\Jenkins\workspace\SampleProj-Dev\Rulesets\CustomRules.ruleset
In Jenkins.build file, I added an argument to the msbuild.exe program execution with:
<arg line="/p:RunCodeAnalysis=true;CodeAnalysisRuleSet=e:\Jenkins\workspace\SampleProject-Dev\Rulesets\CustomRules.ruleset"/>
Before I had tried using a relative path but with a build containing many sub-projects, Jenkins tried to append the path onto a changing path. This path was based on the currently building sub-project, resulting in the same error you received.
I stumbled onto a fix for this tonight for a project that has been suffering from it for ages. I created a new configuration CHECKED and the problem disappeared. Then by:
Deleting the existing configurations from Configuration Manger;
Exiting and saving (this step might not be necessary); and finally
Recreating the dropped configurations from the newly created one, CHECKED
the problem has now disappeared completely in all configurations.
This was all in Visual Studio 2013.

SpecFlow error on build server

I am getting a strange error on the build server, this does NOT happen locally.
Error during file generation. The target file 'C:...\AcceptanceTest\Features\HelloWorld.feature.cs'
is read-only, but different from the transformation result. This
problem can be a sign of an inconsistent source code package. Compile
and check-in the current version of the file from the development
environment or remove the read-only flag from the generation result.
To compile a solution that contains messaging project on a build
server, you can also exclude the messaging project from the
build-server solution or set the msbuild
project parameter to 'true' in the messaging project file.
I'm not sure what to do to fix this, I don't have a "messaging" project (or know what is being referred too). And the code is the latest
This is the full message (some folder names have been obfuscated):
13>C:\Builds\2\Services\PService\src\packages\SpecRun.Excel.1.1.0\tools\TechTalk.SpecFlow-buildfix.targets(47,5):
error : Error during file generation. The target file
'C:\Builds\2\Services\PService\src\PService\Test\PService.AcceptanceTest\Features\HelloWorld.feature.cs'
is read-only, but different from the transformation result. This
problem can be a sign of an inconsistent source code package. Compile
and check-in the current version of the file from the development
environment or remove the read-only flag from the generation result.
To compile a solution that contains messaging project on a build
server, you can also exclude the messaging project from the
build-server solution or set the msbuild
project parameter to 'true' in the messaging project file.
[C:\Builds\2\Services\PService\src\PService\Test\PService.AcceptanceTest\PService.AcceptanceTest.csproj]
13>C:\Builds\2\Services\PService\src\packages\SpecRun.Excel.1.1.0\tools\TechTalk.SpecFlow-buildfix.targets(47,5):
error : Could not find file
'C:\Users\tfsbuild\AppData\Local\Temp\tmpPWithData.feature.xlsx.cs'.
[C:\Builds\2\Services\PService\src\PService\Test\PService.AcceptanceTest\PService.AcceptanceTest.csproj]
13>C:\Builds\2\Services\PService\src\PService\Test\PService.AcceptanceTest\Features\PWithData.feature.xlsx
: error : Generation error: Could not find file
'C:\Users\tfsbuild\AppData\Local\Temp\tmpPWithData.feature.xlsx.cs'.
[C:\Builds\2\Services\PService\src\PService\Test\PService.AcceptanceTest\PService.AcceptanceTest.csproj]
Delete HelloWorld.feature.cs from source control.
TFS will checkout files as read-only during a build and so SpecFlow fails to re-generate the file because it already exists and SpecFlow doesn't overwrite read-only files.
I created a new request for SpecFlow to not automatically add the file to source control here: https://github.com/techtalk/SpecFlow/issues/592
I'm not sure what the messaging project refers to, that's something I haven't seen before.
However the error reads as if the problem is due to an issue with the generation of the *.feature.cs from the *.feature file, but I am confused as to why this should be happening on the build server. Normally the generation of *.feature.cs occurs in the IDE when you save the *.feature file. This gets checked in and with some version control systems (VCS) you may end up with a read-only file status.
Your error reads as the build server is trying to re-generate the *.feature.cs file and cannot overwrite it.
Some things to check;
What VCS are you running? Does it leave checked-in files as read-only?
How are you building the files on the build server? Is there a custom step involved, or is it just a simple compile?
Can you replicate this error on your machine by setting the *.feature.cs to read-only and running the same build script on your local machine?
Good luck.

Weblogic Workshop 9.2: _pageflow directory is not generated

At some point our WebLogic's Portal web project in Workshop stopped generating the WEB-INF/classes/_pageflow directory and all files in that. There are no visible changes in the project structure, but because of that all the Beehive page flow portlets are not working anymore saying they cannot find files from that directory. Any ideas?
After a week of troubles we have found a workaround. Export ANT build script for given web project, execute its clean target, execute its build target and then it works again.