Automatic checkout to agent with Perforce

Is the ability to checkout to an agent available using Perforce available in TeamCity 3.0? Based on a Jira issue that I filed 10 months ago (TW-2103) it appears that it is not. This is becoming increasingly a problem that I must work around both on Linux & Windows build agents.
My workaround for this is:
1) Write a teamcity-build.xml that:
a) Does a forced Perforce sync before every build
b) Write ant targets to run the actual build that use the build.xml for each project.
2) In TeamCity, set VCS checkout mode to Do not checkout files automatically.

This is becoming cumbersome and difficult to maintain. I would prefer to simply setup TeamCity to use the project build.xml and have TeamCity checkout the source code.

The reason that this must be done is because the file permissions on a Linux build agent are incorrect when the build is set to Automatically checkout on the server. In particular, the executable bit is not set for executables. But, I am seeing odd behavior even on a Windows agent the first time I run a build. Rather than using the mapping specified in the build's client spec, it uses the build config's "build working directory" as the workspace root to checkout. If I manually run "p4 -c <client-spec> sync -f" on the build agent, then it seems to work after that.

But, I'm actually not certain that TeamCity's automated checkout is working properly with Perforce. I suspect that by manually doing a forced sync on the build agent, the files are read-only and are not over-written (clobbered) by new files when TeamCity's automatic server checkout happens. I had seen some evidence of this problem in the past (TW-2419). Despite TeamCity logging being set to debug, there is no evidence that checkouts are successful or not either in the TeamCity UI or in the agent logs.

Has Perforce checkout behavior changed in TeamCity 3.0?

Thanks,
-Dave

3 comments

Dave,

The reason that this must be done is because the file
permissions on a Linux build agent are incorrect when
the build is set to Automatically checkout on the
server. In particular, the executable bit is not set
for executables.


This bug should have been fixed some time ago.

But, I'm actually not certain that TeamCity's
automated checkout is working properly with Perforce.
I suspect that by manually doing a forced sync on the
build agent, the files are read-only and are not
over-written (clobbered) by new files when TeamCity's
automatic server checkout happens. I had seen some
evidence of this problem in the past (TW-2419).
Despite TeamCity logging being set to debug, there is
no evidence that checkouts are successful or not
either in the TeamCity UI or in the agent logs.

Has Perforce checkout behavior changed in TeamCity
3.0?


We did multiple fixes in all VCS support because of generic checkout rules support, as well as some bugfixing.
I think it worth trying if TeamCity 3.0 will work for your project. TeamCity and IntelliJ IDEA both use perforce as main VCS and server-side checkout works nicely (both for Windows and Linux build agents).

Kind regards,
KIR

0

Has Perforce checkout behavior changed in TeamCity
3.0?


We did multiple fixes in all VCS support because of
generic checkout rules support, as well as some
bugfixing.
I think it worth trying if TeamCity 3.0 will work
for your project. TeamCity and IntelliJ IDEA both
use perforce as main VCS and server-side checkout
works nicely (both for Windows and Linux build
agents).


I will try TeamCity 3.0 (actually more likely TeamCity 3.1
because it fixes TW-2847). But, will Perforce checkouts
to build agents be available by the time 3.1 is released?

Thanks,
-Dave

0


  TeamCity 6.0 will support checkout on agent mode, and it will create real Perforce workspaces for each build agent.
  You can try TeamCity 6.0 eap build and see if it works for you.

0

Please sign in to leave a comment.