bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: a saner bootstrap script


From: Gary V . Vaughan
Subject: Re: a saner bootstrap script
Date: Thu, 6 Oct 2011 07:18:31 +0700

Hi Jim,

On 5 Oct 2011, at 14:08, Gary V. Vaughan wrote:
> On 5 Oct 2011, at 00:16, Jim Meyering wrote:
>> Gary V. Vaughan wrote:
>>> I haven't had time yet to pick up the coreutils bootstrap.conf update, but
>>> I'll probably be able to get to it by the end of the week.  If you're in a
>>> hurry, then I think you might find writing your own updated bootstrap.conf
>>> would be instructive in the vast improvements I think the new bootstrap I've
>>> written brings to the table - and maybe help build enough confidence in it
>>> that you'd like to help me adopt it into upstream gnulib?
>> 
>> If I go with it, it will eventually gain at least 10 new client packages.
>> However, I don't have a lot of time to invest in the transition,
>> so anything you can do to make it easier may go a long way.
> 
> And that alone will be a big vote of confidence toward my goal of having it
> adopted into gnulib in place of the existing script. I'll ping this thread 
> when
> I've finished the update.

Please find attached my updated bootstrap.conf to work with the coreutils 
master.
I tested it alongside an upgraded bootstrap script from zile master:

  http://git.savannah.gnu.org/cgit/zile.git/plain/bootstrap

Both the original bootstrap and my script produce a configure script that throws
the following error when probing xgettext, even though I have homebrew's gettext
at the front of my PATH:

checking for xgettext...
../configure: line 60806: 82577 Trace/BPT trap: 5       $ac_dir/$ac_word 
--omit-header --copyright-holder= --msgid-bugs-address= /dev/null 1>&5 2>&1
/usr/local/Cellar/gettext/0.18.1.1/bin/xgettext

I'm sure this is not a problem with the either bootstrap script, but either a 
bug
in gettext-0.18.1.1 on Lion, or a coreutils configure.ac bug on Lion.

Here are some of the improvements and differences after upgrading coreutils to 
my
saner bootstrap.

1. A huge speed improvement;

I benchmarked after running both `git clean -f -x -d` and `git reset --hard 
HEAD`
between runs: I also checked that all of coreutils compiles in both cases, 
though
I didn't compare testsuite runs.

First the incumbent bootstrap:

  94.96s user 113.32s system 43% cpu 8:02.48 total

And after the upgrade:

  83.09s user 99.44s system 44% cpu 6:46.91 total

In both cases about 5 minutes are spent in gnulib-tool, and another 45 seconds 
or so
in autoreconf, which means the actual bootstrap code accounts for over 2 
minutes of
the run-time of the current gnulib bootstrap script, which is more than twice 
as long
as the time spent in my saner bootstrap script.

I expect a large proportion of that time is saved by having thrown out the 
slurp()
function, which was an inelegant workaround for gnulib-tool issues that have 
long
since been fixed.

2. Slurp() has gone;

The useful part of the incumbent slurp() function has been extracted to 
bootstrap.conf
as coreutils_inject_makefile_macro_assignments(), though there is probably an 
argument
that could be made to generalise this function and put it back in bootstrap - 
only
coreutils and one other project I upgraded (I think it was tar, but it was a 
year ago
so my memory is hazy) used that functionality, so I didn't try to generalise it 
at the
time.

3. buildreq errors are much more informative;

The buildreq variable is a table that now also includes a column for the 
homepage of
any requirements so that the error message can inform the user where to fetch 
any
missing prerequisites.

Note also that autoconf, automake, libtool and gettext are added automagically 
as long
as they are referenced in configure.ac, so they are not listed manually.  If 
you run
bootstrap with the verbose option, you can see them being detected and added.

4. gnulib_tool_options is self contained;

For some reason it was accumulated in a few parts in the original 
bootstrap.conf.

5. XGETTEXT_OPTIONS is hugely simplified;

gnulib-tool clearly states that the majority of the awkwardly \\\\n delimited 
options
added in the original bootstrap.conf are only necessary for gettext-0.16 or 
older,
and since our configure.ac requires version 0.18.1, I omitted them.  Even if you
want to add them back in, my saner bootstrap script takes care of setting up the
escaped newlines automatically, so you shouldn't try to put them back in 
manually
too, just do it like all the other option settings in bootstrap.conf:

  xgettext_options=$xgettext_options'
          --flag=xfprintf:2:c-format
          --flag=xvfprintf:2:c-format
  '

6. I've made use of the hook functions feature for the remaining bespoke work;

I've split bootstrap_epilogue() from the original bootstrap.conf into logical
chunks and hooked them into the execution tree for my saner bootstrap so there's
much less chance of adhoc code being naively added to the catch-all 'epilogue'
function in future revisions now.

7. Bootstrap up-to-date check;

Until gnulib adopts my saner bootstrap, you might like to add the following
additional setting to bootstrap.conf to prevent what is a bogus warning in the 
mean
time:

  # The not-synced with gnulib warning is bogus until upstream adopts
  # the saner bootstrap script.
  require_bootstrap_uptodate=:

8 thru' n. A ton of other niceties.

In addition to the much improved maintainability and sanity in the new 
bootstrap.conf
as well as the new bootstrap script proper, there are a ton of other 
improvements
that I won't bore you with, but you can easily find by reading the 
documentation and
code of bootstrap as posted here previously.

If I can do anything else to keep the forward momentum going, please do ask!

Cheers,
-- 
Gary V. Vaughan (gary AT gnu DOT org)

Attachment: bootstrap.conf
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]