[PATCH] Fix Windows build

Robinson, Paul Paul_Robinson at playstation.sony.com
Mon Dec 1 14:12:57 PST 2014


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'll try to get a revised patch out in the next day or so.
Thanks,
--paulr

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

Thanks, Paul. I figured the situation would be no worse on Windows than it currently is, but this is obviously better. I am wondering why you decided to use "git svn log" to find the revision number followed by "git svn info" to get the repository, since the GetSourceVersion script uses "git svn info" for the revision already. I also think it's worth not regressing what GetRepositoryPath supports for the pure git case—that's the configuration a lot of people use for internal branches (including Apple).

After this change, I would actually delete the GetSourceVersion and GetRepositoryPath scripts. They're not being used by LLVM itself for anything else, and they're not cross-platform.

I don't mind changing the macro names (in a separate patch). I didn't like them either. :-)

Jordan


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

+Jordan as he's the last one to muck with GetSVN.cmake.

From: llvm-commits-bounces at cs.uiuc.edu<mailto:llvm-commits-bounces at cs.uiuc.edu> [mailto:llvm-commits-bounces at cs.uiuc.edu] On Behalf Of Robinson, Paul
Sent: Sunday, November 30, 2014 1:58 PM
To: Sean Silva
Cc: llvm-commits at cs.uiuc.edu<mailto:llvm-commits at cs.uiuc.edu>
Subject: RE: [PATCH] Fix Windows build

I have attached the output with a git-svn repo on Mac. Looks fine
Thanks for testing it!  (But you didn't actually say LGTM so leaving this open.)
(except for the awkwardness of calling the macros SVN_REVISION and SVN_REPOSITORY; could you change the name of those in a follow-on patch?).
The GetSVN.cmake script doesn't decide on those names; they're determined by the caller.
In this case the generated header is private to clang/lib/Basic and IIRC is used by only one module within Basic; so I don’t see any value in changing the names.
They refer to "our (i.e. clang's) SVN revision, and that other project's (i.e. LLVM's) SVN revision."  Seems clear enough to me in context.
--paulr

From: Sean Silva [mailto:chisophugis at gmail.com]
Sent: Wednesday, November 26, 2014 5:47 PM
To: Robinson, Paul
Cc: llvm-commits at cs.uiuc.edu<mailto:llvm-commits at cs.uiuc.edu>
Subject: Re: [PATCH] Fix Windows build

I have attached the output with a git-svn repo on Mac. Looks fine (except for the awkwardness of calling the macros SVN_REVISION and SVN_REPOSITORY; could you change the name of those in a follow-on patch?).

-- Sean Silva

On Wed, Nov 26, 2014 at 5:09 PM, Robinson, Paul <Paul_Robinson at playstation.sony.com<mailto:Paul_Robinson at playstation.sony.com>> wrote:
Revised patch that I'm pretty sure will handle straight git.
I'd appreciate somebody trying it with a git-svn clone, though.
Thanks,
--paulr

> -----Original Message-----
> From: Robinson, Paul
> Sent: Wednesday, November 26, 2014 4:15 PM
> To: Robinson, Paul; llvm-commits at cs.uiuc.edu<mailto:llvm-commits at cs.uiuc.edu>
> Subject: RE: [PATCH] Fix Windows build
>
> With patch...
>
> > -----Original Message-----
> > From: llvm-commits-bounces at cs.uiuc.edu<mailto:llvm-commits-bounces at cs.uiuc.edu> [mailto:llvm-commits-<mailto:llvm-commits->
> > bounces at cs.uiuc.edu<mailto:bounces at cs.uiuc.edu>] On Behalf Of Robinson, Paul
> > Sent: Wednesday, November 26, 2014 4:12 PM
> > To: llvm-commits at cs.uiuc.edu<mailto:llvm-commits at cs.uiuc.edu>
> > Subject: [PATCH] Fix Windows build
> >
> > r222391 updated GetSVN.cmake to run the LLVM helper scripts
> > GetSourceVersion
> > and GetRepositoryPath.  However, being shell scripts, they work only on
> > Unix-y hosts; on Windows they don't work, you end up with an
> > SVNVersion.inc
> > that looks like this:
> >
> > #define LLVM_REVISION ""
> > #define LLVM_REPOSITORY ""
> > #define SVN_REVISION ""
> > #define SVN_REPOSITORY ""
> >
> > I've rewritten the scripts as best I can into CMake so they will work on
> > Windows as well.  Now I get a better-looking SVNVersion.inc:
> >
> > #define LLVM_REVISION "222770"
> > #define LLVM_REPOSITORY "http://llvm.org/svn/llvm-project/llvm/trunk"
> > #define SVN_REVISION "222770"
> > #define SVN_REPOSITORY "http://llvm.org/svn/llvm-project/cfe/trunk"
> >
> > I can only test it on SVN, but I was able to clone code from another
> > CMake script so I'm pretty hopeful that it works for Git as well.
> >
> > Thanks,
> > --paulr
> >
> >
> > _______________________________________________
> > llvm-commits mailing list
> > llvm-commits at cs.uiuc.edu<mailto:llvm-commits at cs.uiuc.edu>
> > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

_______________________________________________
llvm-commits mailing list
llvm-commits at cs.uiuc.edu<mailto:llvm-commits at cs.uiuc.edu>
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141201/73269b45/attachment.html>


More information about the llvm-commits mailing list