3

We've just updated our TFS to TFS 2013 update 4 (TFS2013.4), and we're using GIT submodules in our repositories (that we updated with some custom MSBUILD magic on the build server).

However now with the latest update, our builds all fail with this message:

Cannot set unknown member 'Microsoft.TeamFoundation.Build.Activities.Git.GitPull.CheckoutSubmodules'.

Seems like Microsoft has added some kind of support for GIT submodules, however it does fail on our build server.

Any ideas on how to fix this?

Wiebe Tijsma
  • 10,173
  • 5
  • 52
  • 68
  • The custom msbuild magic you are referring to... would you say part of the effort there was similar to this? http://stackoverflow.com/questions/19246151/git-submodule-fails-on-tfs-build?lq=1 – dtmland Jan 21 '15 at 21:57

2 Answers2

3

Well this was caused by my own stupidity (as most of the time).

I figured just installing Visual Studio Update 4 (VS2013.4) would install the same required client libraries for the build server that TFS used, however I was wrong.

Just updating the TFS Build servers to TFS2013.4 solved the problem.

EDIT: The only problem solved is that the 'hackety MSBUILD magic' of updating submodules works again, no native suppport.

Seems like differing versions between TFS2013.4 on the TFS server and TFS2013.2 on the build servers caused the problem that the repo's couldn't be fetched at all, whether it had submodules or not.

As the error in the question leads to believe, it looks like the build server started to support submodules natively, but I haven't been able to make this work.

EDIT 2:

For the ones asking for the hackety solution, I've ended up using a plain text _netrc file in the profile folder of the build service user, like this:

machine <hostname1>
login <login1>

Git - How to use .netrc file on windows to save user and password

I've also ran into the problem that when the TFS build service account runs under the context of TFS build, the HOME environment variable isn't set, so I had to set that manually:

under System Properties > Environment Variables

Set the System Variable HOME to %PROFILE%

Community
  • 1
  • 1
Wiebe Tijsma
  • 10,173
  • 5
  • 52
  • 68
  • 2
    When you say "solved your problem" - do you mean that TFS2013.4 now updates your submodules for you? Or do you mean that the build error goes away - and therefore you were able to continue using your script that manually updates the submodules? – dtmland Jan 21 '15 at 21:56
  • @giulio No TFS2013.4 doesn't automatically update submodules yet, so it's the hacky 'run git commands from MSBUILD' way – Wiebe Tijsma Jan 28 '15 at 10:45
  • Can you elaborate on your hacky solution? We're trying to implement something similar at my work, and are running into permission issues during the clone. We don't want to hard code someone's credentials into the script, so we're somewhat at a loss. – Quantumplation Mar 06 '15 at 23:42
  • 1
    @Quantumplation Yes it can be a bit tricky. I've updated the answer, see Edit 2 – Wiebe Tijsma Mar 07 '15 at 10:31
  • 2
    @Zilad Thanks so much for the updated info! I finally got a chance to give it a try, and it seems to be working! The only issue I have now is that, for some reason, TFS is registering the clone as a failure (as so: http://i.imgur.com/euDcqwM.png), even though it successfully checks out the submodule and continues on with the build. Did you run into this as well? – Quantumplation Mar 27 '15 at 18:09
  • 1
    For now I solved it by piping the output of the submodule update command into nul. – Quantumplation Mar 27 '15 at 18:31
  • 1
    @Quantumplation Great! yes I ran into that too, however I now run the git commands from msbuild, so I no longer have that problem. – Wiebe Tijsma Mar 27 '15 at 21:56
  • 1
    @Zidad Ah! That's a much better solution in the long run! It keeps the configuration of this stuff in source control, instead of being some arcane knowledge about a deploy script on the build server somewhere. Thanks for the tip! – Quantumplation Mar 30 '15 at 14:36
  • Hi @WiebeTijsma, I have the same issue to update a submodule. I tried to set up a bat field to `git submodule update --init --recursive` but it did not work. Just wondering how did you run git commands from msbuild? – seanbun Jun 05 '18 at 06:51
1

FYI, It seems that submodule checkout is for TFS2015... Have a look at the image to configure a git build, there is a checkbox to update submodules..

Philippe
  • 28,207
  • 6
  • 54
  • 78