Avoiding file rename behaviour on build agent

Hello Group,

I have a teamcity build agent to which I am attempting to migrate some of our Embarcadero Delphi XE6 projects. The version control system is SVN

When the source is extracted, the build log indicates it is adding a ".teamcity" extension to the project files

For example, one of my projects is called src\tests\delphiloggerTests.dproj in SVN but the build log lists src\tests\delphiloggerTests.dproj.teamcity

When I inspect the relevant work directory on the build agent, I can see that it has compiled a resource file delphiloggerTests.dproj.res instead of the expected delphiloggerTests.res, and consequently the build fails (it can't see the missing res file as it has the wrong name).

Any suggestions on what button I have not ticked?

Thanks
Adam G

6 comments
Comment actions Permalink

Hi Adam,

TeamCity does not rename checked out files. Could you please describe how you run the project, which build runner do you use? Please attach build log.

0
Comment actions Permalink

Hello Alina,

Thanks for your reply. I have attached a copy of the build log showing the problem. I needed to redact some server and SVN URLs, but the redacted text is all nice characters (A-Z). The rename happens in both steps 2 and 4, but the executable built in step 2 doesn't link in that resource so is not effected. Step 4 shows the problem.

The build runner is MSBuild
MSBuild version:  Microsoft .NET Framework 3.5
MSBuild ToolsVersion: 3.5
Run Platform: x86
Targets: Rebuild
Command line parameters /property:Config=Release

Line 110 of the log file shows:
[11:32:42]:     [Step 4/6] src\delphilogger.dproj.teamcity: Build target: ReBuild (1s)
and so on with the following lines.
Line 139 shows the target resource file filename in the -fo parameter
Line 161 then cantlocate delphilogger.res

I am not sure where it is getting this .teamcity extension because this is not in SVN, and it builds locally to the expected name.

Any assistance is appreciated.

Thanks
Adam



Attachment(s):
RedactedLog.txt.zip
0
Comment actions Permalink

Hi Adam,

MSBuild runner generates a teamporary (...).teamcity file. It's a wrapping msbuld script, which should not affect your build.

How do you generate target resource file name "-fodelphilogger.dproj.res", which property do you use?

0
Comment actions Permalink

Hello Alina,

Thanks for your further feedback. I understand it should not affect my build but it unfortunately does.

Delphi creates a resource file with the same name as the project for most types of project. If I have a project named project1.dproj, Delphi will create a resource file named project1.res. By default, this contains the icons and any versioninfo strings.

The following is the project file created with a standard project. I have made no modification to this at all.

program Project1;

uses
  Vcl.Forms,
  Unit1 in 'Unit1.pas' {Form1};

{$R *.res}

begin
  Application.Initialize;
  Application.MainFormOnTaskbar := True;
  Application.CreateForm(TForm1, Form1);
  Application.Run;
end.


The compiler directive {$R *.res} is put in by Delphi itself and tells it to look for a resource file with the same name as the project (in this case project1.res). The compiler itself seems to be changing the extension of the project file to .res when it looks for it, but because the project file has been renamed by this process the generated resource file is called delphiloggerTests.dproj.res rather than delphiloggerTests.res. I could check in the prebuilt res file but that kinda defeats the purpose of a build agent :)

I am looking for the setting where the project was changed to have .teamcity during this temporary step because this is causing the problem. MSBuild seems to know that this is being done by teamcity and not some other build system. Do you know where this is specified? I think if this can be switched off then the problem will be fixed.

Thanks
Adam

0
Comment actions Permalink

Hello Adam,

To disable MSBuild wrapping script generation use can set teamcity.msbuild.generateWrappingScript= false as a configuration parameter for the build configuration or globally as internal property. On the other hand this script is used to add TeamCity provided msbuild tasks.
We have the related issue in our tracker https://youtrack.jetbrains.com/issue/TW-20930, please watch/vote for it.

0
Comment actions Permalink

Hi Alina,

That was the cause. I have worked around it with the mentioned configuration parameter.

Thanks for your assistance.

Adam

0

Please sign in to leave a comment.