<div dir="ltr"><br><br><div class="gmail_quote">On Tue, Mar 24, 2015 at 11:31 PM Nick Lewycky <<a href="mailto:nicholas@mxc.ca">nicholas@mxc.ca</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Eric Christopher wrote:<br>
><br>
><br>
> On Tue, Mar 10, 2015 at 9:39 AM Jonathan Roelofs<br>
> <<a href="mailto:jonathan@codesourcery.com" target="_blank">jonathan@codesourcery.com</a> <mailto:<a href="mailto:jonathan@codesourcery.com" target="_blank">jonathan@codesourcery.<u></u>com</a>>> wrote:<br>
><br>
><br>
><br>
> On 2/28/15 11:01 PM, Nick Lewycky wrote:<br>
> > Eric Christopher wrote:<br>
> >><br>
> >><br>
> >> On Sat, Feb 28, 2015 at 11:45 AM Nick Lewycky <<a href="mailto:nicholas@mxc.ca" target="_blank">nicholas@mxc.ca</a><br>
> <mailto:<a href="mailto:nicholas@mxc.ca" target="_blank">nicholas@mxc.ca</a>><br>
> >> <mailto:<a href="mailto:nicholas@mxc.ca" target="_blank">nicholas@mxc.ca</a> <mailto:<a href="mailto:nicholas@mxc.ca" target="_blank">nicholas@mxc.ca</a>>>> wrote:<br>
> >><br>
> >> Jonathan Roelofs wrote:<br>
> >> > Author: jroelofs<br>
> >> > Date: Fri Feb 27 17:35:47 2015<br>
> >> > New Revision: 230812<br>
> >> ><br>
> >> > URL: <a href="http://llvm.org/viewvc/llvm-" target="_blank">http://llvm.org/viewvc/llvm-</a> project?rev=230812&view=rev<br>
> >> <<a href="http://llvm.org/viewvc/llvm-" target="_blank">http://llvm.org/viewvc/llvm-</a> project?rev=230812&view=rev<br>
> <<a href="http://llvm.org/viewvc/llvm-project?rev=230812&view=rev" target="_blank">http://llvm.org/viewvc/llvm-<u></u>project?rev=230812&view=rev</a>>><br>
> >> > Log:<br>
> >> > Discourage in-source autoconf builds (as we already do for the<br>
> >> cmake build)<br>
> >><br>
> >> I have reverted this patch. Please explain yourselves.<br>
> >><br>
> >><br>
> >> Pretty rude way of putting it but sure.<br>
> ><br>
> > Hey, sorry. I was upset, and neither of you deserved that sort of<br>
> tone.<br>
> > I'm truly sorry, and thank you for taking the time to write an<br>
> > explanation in spite of my poor attitude!<br>
> Sorry about my end of this too. I had assumed there was consensus on<br>
> this from discussing it on #llvm. I probably should have mailed the list<br>
> first explaining what I had intended to do.<br>
> ><br>
> >> Best practices.<br>
> >><br>
> >> <a href="https://www.sourceware.org/" target="_blank">https://www.sourceware.org/</a> autobook/autobook/autobook_14.<br>
> html#SEC14<br>
> <<a href="https://www.sourceware.org/autobook/autobook/autobook_14.html#SEC14" target="_blank">https://www.sourceware.org/<u></u>autobook/autobook/autobook_14.<u></u>html#SEC14</a>><br>
> >><br>
> >> In general you want to keep your source directory pristine<br>
> (readonly)<br>
> >> and configuring inside the source directory is fraught with<br>
> problems.<br>
> +1<br>
><br>
> This is a small step toward allowing the source dir to be kept readonly<br>
> during builds.<br>
> ><br>
> > Got it.<br>
> ><br>
> > If it matters, I've been using this configuration for a long<br>
> time, and I<br>
> > haven't seen any glitch for years, though I do remember a time<br>
> when that<br>
> > wasn't true. I understand why it risks continuing problems.<br>
> ><br>
> > The two main things I get from in-tree builds are that I can grep<br>
> > through the source including the generated source,<br>
> This one you can work around (somewhat) by doing a<br>
> subdirectory-of-source build, i.e.:<br>
><br>
> $ svn co <a href="http://llvm.org/svn/llvm-" target="_blank">http://llvm.org/svn/llvm-</a> project/llvm/trunk<br>
> <<a href="http://llvm.org/svn/llvm-project/llvm/trunk" target="_blank">http://llvm.org/svn/llvm-<u></u>project/llvm/trunk</a>> llvm<br>
> $ mkdir -p llvm/build && cd llvm/build<br>
> $ ../configure [options]<br>
><br>
> > and that I can rename<br>
> > the directory trees. Out of tree builds bake in a directory name.<br>
> Doesn't this just mean that renames have to happen in two steps (i.e.<br>
> rename the src version of the dir, then rename the build version of the<br>
> dir)? Or is there something fundamentally different here that I'm<br>
> missing?<br>
> > I can<br>
> > try this again and see whether it's still a problem, or if there's<br>
> > something we can fix here.<br>
> ><br>
> >> This also ensures that the occasional report I get of someone<br>
> not being<br>
> >> able to do a make distclean in the source directory will go<br>
> away. I will<br>
> >> also take a working make distclean if you'd like to do that instead<br>
> >> (though, obviously, I'd prefer the current patch).<br>
> ><br>
> > Reducing support burden is a perfectly reasonable reason. As<br>
> someone who<br>
> > uses this configuration, I find that I very rarely run make clean and<br>
> > don't think I've tried make distclean. I would not be surprised<br>
> to learn<br>
> > that I've accidentally learned to avoid the things that don't work.<br>
> ><br>
> > As you've probably already surmised, I'm not super interested in<br>
> writing<br>
> > a patch that fixes "make distclean". :) Which I guess means that<br>
> you can<br>
> :) Especially with the whole "autotools is going away once we have<br>
> feature parity with the cmake build" push.<br>
> > ignore me and un-revert? I do have one review comment though, please<br>
> > change the error message from "discouraged" to "are no longer<br>
> > supported". In part, I was confused by the combination of the term<br>
> > discouragement (in the error message and in the commit log) with<br>
> a hard<br>
> > error.<br>
> Sorry about that... how about "In-source builds are not allowed. Please<br>
> configure from a separate build directory."? This would better match the<br>
> message printed by the cmake build in this situation.<br>
><br>
><br>
> This works for me. Nick?<br>
<br>
That text is fine with me. I was thinking, there's three things we<br>
should do for this deprecation.<br>
<br>
We should make sure the documentation never shows an objdir==srcdir<br>
build. I just spent a while looking at this, and it looks like this is<br>
essentially done already. A couple places show "./configure".<br>
-<br>
<a href="http://llvm.org/docs/FAQ.html#the-configure-script-finds-the-right-c-compiler-but-it-uses-the-llvm-tools-from-a-previous-build-what-do-i-do" target="_blank">http://llvm.org/docs/FAQ.html#<u></u>the-configure-script-finds-<u></u>the-right-c-compiler-but-it-<u></u>uses-the-llvm-tools-from-a-<u></u>previous-build-what-do-i-do</a><br>
- <a href="http://llvm.org/docs/HowToBuildOnARM.html" target="_blank">http://llvm.org/docs/<u></u>HowToBuildOnARM.html</a> (the second time)<br>
Special mention to <a href="http://llvm.org/docs/GoldPlugin.html" target="_blank">http://llvm.org/docs/<u></u>GoldPlugin.html</a> which does show<br>
"./configure" but for building your autotooled project not for building<br>
llvm. (I also found <a href="http://llvm.org/docs/TestSuiteMakefileGuide.html" target="_blank">http://llvm.org/docs/<u></u>TestSuiteMakefileGuide.html</a><br>
which doesn't seem to have any links pointing to it, and still describes<br>
building and installing llvm-gcc ... yet it shows an objdir != srcdir<br>
build!)<br>
<br>
Second, if possible, it'd be nice to have some instructions for how to<br>
migrate from an in-tree build to an out of tree build. Realistically the<br>
answer may turn out to be "svn diff > tmp.patch", but I thought I'd ask<br>
in case you think this is doable.<br>
<br>
$ mv llvm-commit llvm-commit-src<br>
$ mkdir llvm-commit<br>
$ cd llvm-commit<br>
$ mv ../llvm-commit-src/ src<br>
$ mkdir build<br>
$ cd build<br>
$ ../src/configure<br>
configure: error: Already configured in ../src<br>
<br>
$ cd ../src/<br>
$ make distclean<br>
Makefile:151: /home/nicholas/llvm-commit/<u></u>Makefile.rules: No such file or<br>
directory<br>
make: *** No rule to make target<br>
'/home/nicholas/llvm-commit/<u></u>Makefile.rules'. Stop.<br>
<br>
Though honestly I think if I'm going to go through the effort to switch<br>
to out of tree builds, I'm going to switch to CMake while I'm at it.<br>
<br>
Finally, it'd be nice to let people know in advance on that this is<br>
going to be actively broken, just in case I'm not actually the last<br>
person using this configuration. I don't think it needs anything as<br>
large as the C++11 transition, just a post to llvm-dev and wait for<br>
feedback (screams) no longer than a week?<br>
<br></blockquote><div><br></div><div>SGTM. Jonathan?</div><div><br></div><div>-eric</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Nick<br>
<br>
><br>
> -eric<br>
><br>
><br>
> Cheers,<br>
><br>
> Jon<br>
> ><br>
> > Nick<br>
> ><br>
> >><br>
> >> -eric<br>
> >><br>
> >><br>
> >> ><br>
> >> > <a href="http://reviews.llvm.org/D7961" target="_blank">http://reviews.llvm.org/D7961</a><br>
> >> ><br>
> >> > Modified:<br>
> >> > llvm/trunk/autoconf/configure. ac <<a href="http://configure.ac" target="_blank">http://configure.ac</a>><br>
> >> > llvm/trunk/configure<br>
> >> ><br>
> >> > Modified: llvm/trunk/autoconf/configure. ac <<a href="http://configure.ac" target="_blank">http://configure.ac</a>><br>
> >> > URL: <a href="http://llvm.org/viewvc/llvm-" target="_blank">http://llvm.org/viewvc/llvm-</a> project/llvm/trunk/autoconf/<br>
> >> <a href="http://configure.ac?rev=230812&r1=" target="_blank">configure.ac?rev=230812&r1=</a> <<a href="http://configure.ac?rev=230812&r1=" target="_blank">http://configure.ac?rev=<u></u>230812&r1=</a>><br>
> 230811&r2=230812&view=diff<br>
> >><br>
> >> <<a href="http://llvm.org/viewvc/llvm-" target="_blank">http://llvm.org/viewvc/llvm-</a> project/llvm/trunk/autoconf/<br>
> <a href="http://configure.ac?rev=230812&r1=" target="_blank">configure.ac?rev=230812&r1=</a> 230811&r2=230812&view=diff<br>
> <<a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/autoconf/configure.ac?rev=230812&r1=230811&r2=230812&view=diff" target="_blank">http://llvm.org/viewvc/llvm-<u></u>project/llvm/trunk/autoconf/<u></u>configure.ac?rev=230812&r1=<u></u>230811&r2=230812&view=diff</a>>><br>
> >><br>
> >> > ============================== ==============================<br>
> >> ==================<br>
> >> > --- llvm/trunk/autoconf/configure. ac <<a href="http://configure.ac" target="_blank">http://configure.ac</a>><br>
> >> (original)<br>
> >> > +++ llvm/trunk/autoconf/configure. ac <<a href="http://configure.ac" target="_blank">http://configure.ac</a>> Fri<br>
> >> Feb 27 17:35:47 2015<br>
> >> > @@ -73,6 +73,11 @@ if test ${srcdir} != "." ; then<br>
> >> > fi<br>
> >> > fi<br>
> >> ><br>
> >> > +dnl Quit if it is an in-source build<br>
> >> > +if test ${srcdir} == "." ; then<br>
> >> > + AC_MSG_ERROR([In-source builds are discouraged. Configure from<br>
> >> a separate build directory.])<br>
> >> > +fi<br>
> >> > +<br>
> >> > dnl Default to empty (i.e. assigning the null string to) CFLAGS<br>
> >> and CXXFLAGS,<br>
> >> > dnl instead of the autoconf default (for example, '-g -O2' for<br>
> >> CC=gcc).<br>
> >> > : ${CFLAGS=}<br>
> >> ><br>
> >> > Modified: llvm/trunk/configure<br>
> >> > URL: <a href="http://llvm.org/viewvc/llvm-" target="_blank">http://llvm.org/viewvc/llvm-</a> project/llvm/trunk/configure?<br>
> >> rev=230812&r1=230811&r2= 230812&view=diff<br>
> >><br>
> >> <<a href="http://llvm.org/viewvc/llvm-" target="_blank">http://llvm.org/viewvc/llvm-</a> project/llvm/trunk/configure?<br>
> rev=230812&r1=230811&r2= 230812&view=diff<br>
> <<a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/configure?rev=230812&r1=230811&r2=230812&view=diff" target="_blank">http://llvm.org/viewvc/llvm-<u></u>project/llvm/trunk/configure?<u></u>rev=230812&r1=230811&r2=<u></u>230812&view=diff</a>>><br>
> >><br>
> >> > ============================== ==============================<br>
> >> ==================<br>
> >> > --- llvm/trunk/configure (original)<br>
> >> > +++ llvm/trunk/configure Fri Feb 27 17:35:47 2015<br>
> >> > @@ -1999,6 +1999,12 @@ echo "$as_me: error: Already configured<br>
> >> > fi<br>
> >> > fi<br>
> >> ><br>
> >> > +if test ${srcdir} == "." ; then<br>
> >> > + { { echo "$as_me:$LINENO: error: In-source builds are<br>
> >> discouraged. Configure from a separate build directory.">&5<br>
> >> > +echo "$as_me: error: In-source builds are discouraged. Configure<br>
> >> from a separate build directory.">&2;}<br>
> >> > + { (exit 1); exit 1; }; }<br>
> >> > +fi<br>
> >> > +<br>
> >> > : ${CFLAGS=}<br>
> >> > : ${CXXFLAGS=}<br>
> >> ><br>
> >> ><br>
> >> ><br>
> >> > ______________________________ _________________<br>
> >> > llvm-commits mailing list<br>
> >> > <a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a> <mailto:<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.<u></u>edu</a>><br>
> <mailto:<a href="mailto:llvm-commits@cs.uiuc" target="_blank">llvm-commits@cs.uiuc</a>. edu <mailto:<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.<u></u>edu</a>>><br>
> >> > <a href="http://lists.cs.uiuc.edu/" target="_blank">http://lists.cs.uiuc.edu/</a> mailman/listinfo/llvm-commits<br>
> >> <<a href="http://lists.cs.uiuc.edu/" target="_blank">http://lists.cs.uiuc.edu/</a> mailman/listinfo/llvm-commits<br>
> <<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/llvm-commits</a>><u></u>><br>
> >> ><br>
> >><br>
> ><br>
><br>
> --<br>
> Jon Roelofs<br>
> <a href="mailto:jonathan@codesourcery.com" target="_blank">jonathan@codesourcery.com</a> <mailto:<a href="mailto:jonathan@codesourcery.com" target="_blank">jonathan@codesourcery.<u></u>com</a>><br>
> CodeSourcery / Mentor Embedded<br>
><br>
<br>
</blockquote></div></div>