[PATCH] Fix Windows build

Robinson, Paul Paul_Robinson at playstation.sony.com
Thu Dec 4 16:15:10 PST 2014


Hi Jordan,
Sorry for the delay, here's a revised patch.

-        git-svn path uses a single 'git svn info' to extract info; this also lets me  steal regexes from FindSubversion.cmake so it really should work exactly like the SVN case.

-        git path doesn't assume the name of the remote. That regex might be more paranoid than it needs to be, but it works.
I've now tried this with git, git-svn, and svn.

I am more than happy to let you deal with the non-svn-git-branch-inside-git-svn-clone problem!  But it's probably easy to handle by having get_source_info fall back to the git path if git-svn produces no result.
Thanks,
--paulr

From: Jordan Rose [mailto:jordan_rose at apple.com]
Sent: Monday, December 01, 2014 7:21 PM
To: Robinson, Paul
Cc: Sean Silva; llvm-commits at cs.uiuc.edu; Mark Lacey
Subject: Re: [PATCH] Fix Windows build

Oh right, the Makefile build still exists. :-)

On Dec 1, 2014, at 14:12 , Robinson, Paul <Paul_Robinson at playstation.sony.com<mailto:Paul_Robinson at playstation.sony.com>> wrote:

Hi Jordan,
GetSourceVersion and GetRepositoryPath are still used by clang/lib/Basic/Makefile, so we should not delete them.  Your original thought--have make and CMake use the same scripts—was laudable, but we'd have to do something like rewrite this stuff in Python to make it both multi-platform and multi-build-tools compatible.  I don't have the Python chops for that, but if somebody else wants to do it, I'm happy to throw away my stuff.

So, I used separate git-svn commands because I was first adapting code from VersionFromVCS.cmake (which uses git svn log) and then translating GetRepositoryPath into CMake (which uses git svn info) and finally filling in the holes regarding getting both bits of info for the 3 source-control options.
But of course 'git svn info' has both the URL and the revision, so rejiggering the regex stuff to extract it all from one git command would be preferable.

How does the pure git case "regress" from what GetRepositoryPath does?  GetRepositoryPath looks for the "git remote –v" line with "fetch" in it, then prints the URL from that line.  I thought my CMake code would do the same.  Or should I not be looking for the text "origin"?  I was seeing that in my git repo, but I'm not exactly a sophisticated git user.  Maybe I should have that match any non-whitespace string?

I just saw this:

+    # FIXME: Extract URL from 'git remote -v'

But maybe I was looking at the wrong version of the patch. Regardless, I would do the same thing GetRepositoryPath does, which doesn't assume the name of the remote.

On a related note, Mark mentioned an issue using the git-svn code path when the current git branch isn't based on SVN, but I'll look into that later—no need to block this patch on it.

Thanks, Paul,
Jordan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141205/fb79e658/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: GetSVN3.diff
Type: application/octet-stream
Size: 3117 bytes
Desc: GetSVN3.diff
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141205/fb79e658/attachment.obj>


More information about the llvm-commits mailing list