[llvm] r230812 - Discourage in-source autoconf builds (as we already do for the cmake build)

Nick Lewycky nicholas at mxc.ca
Tue Mar 24 23:31:47 PDT 2015


Eric Christopher wrote:
>
>
> On Tue, Mar 10, 2015 at 9:39 AM Jonathan Roelofs
> <jonathan at codesourcery.com <mailto:jonathan at codesourcery.com>> wrote:
>
>
>
>     On 2/28/15 11:01 PM, Nick Lewycky wrote:
>      > Eric Christopher wrote:
>      >>
>      >>
>      >> On Sat, Feb 28, 2015 at 11:45 AM Nick Lewycky <nicholas at mxc.ca
>     <mailto:nicholas at mxc.ca>
>      >> <mailto:nicholas at mxc.ca <mailto:nicholas at mxc.ca>>> wrote:
>      >>
>      >>     Jonathan Roelofs wrote:
>      >> > Author: jroelofs
>      >> > Date: Fri Feb 27 17:35:47 2015
>      >> > New Revision: 230812
>      >> >
>      >> > URL: http://llvm.org/viewvc/llvm- project?rev=230812&view=rev
>      >> <http://llvm.org/viewvc/llvm- project?rev=230812&view=rev
>     <http://llvm.org/viewvc/llvm-project?rev=230812&view=rev>>
>      >> > Log:
>      >> > Discourage in-source autoconf builds (as we already do for the
>      >>     cmake build)
>      >>
>      >>     I have reverted this patch. Please explain yourselves.
>      >>
>      >>
>      >> Pretty rude way of putting it but sure.
>      >
>      > Hey, sorry. I was upset, and neither of you deserved that sort of
>     tone.
>      > I'm truly sorry, and thank you for taking the time to write an
>      > explanation in spite of my poor attitude!
>     Sorry about my end of this too. I had assumed there was consensus on
>     this from discussing it on #llvm. I probably should have mailed the list
>     first explaining what I had intended to do.
>      >
>      >> Best practices.
>      >>
>      >> https://www.sourceware.org/ autobook/autobook/autobook_14.
>     html#SEC14
>     <https://www.sourceware.org/autobook/autobook/autobook_14.html#SEC14>
>      >>
>      >> In general you want to keep your source directory pristine
>     (readonly)
>      >> and configuring inside the source directory is fraught with
>     problems.
>     +1
>
>     This is a small step toward allowing the source dir to be kept readonly
>     during builds.
>      >
>      > Got it.
>      >
>      > If it matters, I've been using this configuration for a long
>     time, and I
>      > haven't seen any glitch for years, though I do remember a time
>     when that
>      > wasn't true. I understand why it risks continuing problems.
>      >
>      > The two main things I get from in-tree builds are that I can grep
>      > through the source including the generated source,
>     This one you can work around (somewhat) by doing a
>     subdirectory-of-source build, i.e.:
>
>         $ svn co http://llvm.org/svn/llvm- project/llvm/trunk
>     <http://llvm.org/svn/llvm-project/llvm/trunk> llvm
>         $ mkdir -p llvm/build && cd llvm/build
>         $ ../configure [options]
>
>      > and that I can rename
>      > the directory trees. Out of tree builds bake in a directory name.
>     Doesn't this just mean that renames have to happen in two steps (i.e.
>     rename the src version of the dir, then rename the build version of the
>     dir)? Or is there something fundamentally different here that I'm
>     missing?
>      > I can
>      > try this again and see whether it's still a problem, or if there's
>      > something we can fix here.
>      >
>      >> This also ensures that the occasional report I get of someone
>     not being
>      >> able to do a make distclean in the source directory will go
>     away. I will
>      >> also take a working make distclean if you'd like to do that instead
>      >> (though, obviously, I'd prefer the current patch).
>      >
>      > Reducing support burden is a perfectly reasonable reason. As
>     someone who
>      > uses this configuration, I find that I very rarely run make clean and
>      > don't think I've tried make distclean. I would not be surprised
>     to learn
>      > that I've accidentally learned to avoid the things that don't work.
>      >
>      > As you've probably already surmised, I'm not super interested in
>     writing
>      > a patch that fixes "make distclean". :) Which I guess means that
>     you can
>     :) Especially with the whole "autotools is going away once we have
>     feature parity with the cmake build" push.
>      > ignore me and un-revert? I do have one review comment though, please
>      > change the error message from "discouraged" to "are no longer
>      > supported". In part, I was confused by the combination of the term
>      > discouragement (in the error message and in the commit log) with
>     a hard
>      > error.
>     Sorry about that... how about "In-source builds are not allowed. Please
>     configure from a separate build directory."? This would better match the
>     message printed by the cmake build in this situation.
>
>
> This works for me. Nick?

That text is fine with me. I was thinking, there's three things we 
should do for this deprecation.

We should make sure the documentation never shows an objdir==srcdir 
build. I just spent a while looking at this, and it looks like this is 
essentially done already. A couple places show "./configure".
   - 
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
   - http://llvm.org/docs/HowToBuildOnARM.html (the second time)
Special mention to http://llvm.org/docs/GoldPlugin.html which does show 
"./configure" but for building your autotooled project not for building 
llvm. (I also found http://llvm.org/docs/TestSuiteMakefileGuide.html 
which doesn't seem to have any links pointing to it, and still describes 
building and installing llvm-gcc ... yet it shows an objdir != srcdir 
build!)

Second, if possible, it'd be nice to have some instructions for how to 
migrate from an in-tree build to an out of tree build. Realistically the 
answer may turn out to be "svn diff > tmp.patch", but I thought I'd ask 
in case you think this is doable.

$ mv llvm-commit llvm-commit-src
$ mkdir llvm-commit
$ cd llvm-commit
$ mv ../llvm-commit-src/ src
$ mkdir build
$ cd build
$ ../src/configure
configure: error: Already configured in ../src

$ cd ../src/
$ make distclean
Makefile:151: /home/nicholas/llvm-commit/Makefile.rules: No such file or 
directory
make: *** No rule to make target 
'/home/nicholas/llvm-commit/Makefile.rules'.  Stop.

Though honestly I think if I'm going to go through the effort to switch 
to out of tree builds, I'm going to switch to CMake while I'm at it.

Finally, it'd be nice to let people know in advance on that this is 
going to be actively broken, just in case I'm not actually the last 
person using this configuration. I don't think it needs anything as 
large as the C++11 transition, just a post to llvm-dev and wait for 
feedback (screams) no longer than a week?

Nick

>
> -eric
>
>
>     Cheers,
>
>     Jon
>      >
>      > Nick
>      >
>      >>
>      >> -eric
>      >>
>      >>
>      >> >
>      >> > http://reviews.llvm.org/D7961
>      >> >
>      >> > Modified:
>      >> >      llvm/trunk/autoconf/configure. ac <http://configure.ac>
>      >> >      llvm/trunk/configure
>      >> >
>      >> > Modified: llvm/trunk/autoconf/configure. ac <http://configure.ac>
>      >> > URL: http://llvm.org/viewvc/llvm- project/llvm/trunk/autoconf/
>      >> configure.ac?rev=230812&r1= <http://configure.ac?rev=230812&r1=>
>     230811&r2=230812&view=diff
>      >>
>      >> <http://llvm.org/viewvc/llvm- project/llvm/trunk/autoconf/
>     configure.ac?rev=230812&r1= 230811&r2=230812&view=diff
>     <http://llvm.org/viewvc/llvm-project/llvm/trunk/autoconf/configure.ac?rev=230812&r1=230811&r2=230812&view=diff>>
>      >>
>      >> > ============================== ==============================
>      >>     ==================
>      >> > --- llvm/trunk/autoconf/configure. ac <http://configure.ac>
>      >>     (original)
>      >> > +++ llvm/trunk/autoconf/configure. ac <http://configure.ac> Fri
>      >>     Feb 27 17:35:47 2015
>      >> > @@ -73,6 +73,11 @@ if test ${srcdir} != "." ; then
>      >> >     fi
>      >> >   fi
>      >> >
>      >> > +dnl Quit if it is an in-source build
>      >> > +if test ${srcdir} == "." ; then
>      >> > +  AC_MSG_ERROR([In-source builds are discouraged. Configure from
>      >>     a separate build directory.])
>      >> > +fi
>      >> > +
>      >> >   dnl Default to empty (i.e. assigning the null string to) CFLAGS
>      >>     and CXXFLAGS,
>      >> >   dnl instead of the autoconf default (for example, '-g -O2' for
>      >>     CC=gcc).
>      >> >   : ${CFLAGS=}
>      >> >
>      >> > Modified: llvm/trunk/configure
>      >> > URL: http://llvm.org/viewvc/llvm- project/llvm/trunk/configure?
>      >>     rev=230812&r1=230811&r2= 230812&view=diff
>      >>
>      >> <http://llvm.org/viewvc/llvm- project/llvm/trunk/configure?
>     rev=230812&r1=230811&r2= 230812&view=diff
>     <http://llvm.org/viewvc/llvm-project/llvm/trunk/configure?rev=230812&r1=230811&r2=230812&view=diff>>
>      >>
>      >> > ============================== ==============================
>      >>     ==================
>      >> > --- llvm/trunk/configure (original)
>      >> > +++ llvm/trunk/configure Fri Feb 27 17:35:47 2015
>      >> > @@ -1999,6 +1999,12 @@ echo "$as_me: error: Already configured
>      >> >     fi
>      >> >   fi
>      >> >
>      >> > +if test ${srcdir} == "." ; then
>      >> > +  { { echo "$as_me:$LINENO: error: In-source builds are
>      >>     discouraged. Configure from a separate build directory.">&5
>      >> > +echo "$as_me: error: In-source builds are discouraged. Configure
>      >>     from a separate build directory.">&2;}
>      >> > +   { (exit 1); exit 1; }; }
>      >> > +fi
>      >> > +
>      >> >   : ${CFLAGS=}
>      >> >   : ${CXXFLAGS=}
>      >> >
>      >> >
>      >> >
>      >> > ______________________________ _________________
>      >> > llvm-commits mailing list
>      >> > llvm-commits at cs.uiuc.edu <mailto:llvm-commits at cs.uiuc.edu>
>     <mailto:llvm-commits at cs.uiuc. edu <mailto:llvm-commits at cs.uiuc.edu>>
>      >> > http://lists.cs.uiuc.edu/ mailman/listinfo/llvm-commits
>      >> <http://lists.cs.uiuc.edu/ mailman/listinfo/llvm-commits
>     <http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits>>
>      >> >
>      >>
>      >
>
>     --
>     Jon Roelofs
>     jonathan at codesourcery.com <mailto:jonathan at codesourcery.com>
>     CodeSourcery / Mentor Embedded
>




More information about the llvm-commits mailing list