How are Perforce client name and checkout directory generated?

I'm using TeamCity 9.0.2 with agent-side Perforce checkout. I have a build config template where a VCS root has p4 mappings specified in TC. TC then creates a p4 client during the build and syncs code to the checkout directory. The build shows the client name and the checkout directory. It seems like the client name follows this pattern:

TC_p4_[agent name]_[build config name]_92275c20adc9d046

The default checkout directory is something like this:
[agent work directory]/1d27c2beb4cf17e1

How are both alpha-numeric patterns at the end generated?
Are there controls that can influence those patterns?

I am asking because I am using a build config template with many derived build configs, and the checkout directory is reused between those builds. I haven't had a chance to test what happens if these builds run on the same machine. Does checkout directory get reused? Cleaned?

I have seen those alpha-numeric patterns change if I change the mapping in the VCS root, but perhaps there are other ways to control it. I realize that a workaround is to use a custom path for checkout directory setting like %teamcity.build.default.checkoutDir%\MyBuildConfigName, but I'm hoping there are other, better ways for this.

Thanks,
Oleg

2 comments
Comment actions Permalink

Hi Oleg,


The numeric patterns at the end of checkout dirctory is a VCS settings hash code. The VCS settings hash code is calculated based on the set of VCS roots, their checkout rules and VCS settings used by the build configuration (checkout mode). When you change any of the settings the hash code is recalculated. Effectively, this means that the directory is shared between all the build configurations with the same VCS settings.

> I am haven't had a chance to test what happens if these builds run on the same machine. Does checkout directory get reused? Cleaned?
Checkout directory is reused in this case.

If you want to use different checkout directories for different build configurations then the solution is to use custom checkout directory.

Do I correctly understand that you want checkout directory to be re-used when mapping is changed? If yes, then please try to use

teamcity.perforce.enable-no-clean-checkout
internal property, for more details please see this comment.
0
Comment actions Permalink

Hi Alina,

Thank you for a very detailed explanation. It's exactly what I was looking for. It would be great if these details made its way to https://confluence.jetbrains.com/display/TCD9/Perforce#Perforce-OtherSettings.

0

Please sign in to leave a comment.