Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Alexandre Oliva <aoliva@redhat.com>
To: Daniel Jacobowitz <drow@mvista.com>
Cc: Nathanael Nerode <neroden@twcny.rr.com>,
	gcc-patches@gcc.gnu.org, gdb-patches@sources.redhat.com,
	binutils@sources.redhat.com, dj@redhat.com, autoconf@gnu.org
Subject: Re: (toplevel) introduce host subdir configuration in Makefile
Date: Mon, 02 Dec 2002 09:44:00 -0000	[thread overview]
Message-ID: <orvg2cl3ii.fsf@free.redhat.lsd.ic.unicamp.br> (raw)
In-Reply-To: <20021202165230.GA12234@nevyn.them.org>

On Dec  2, 2002, Daniel Jacobowitz <drow@mvista.com> wrote:

>> This was a bug in autoconf 2.13, that's fixed in autoconf 2.5x.

> What was?  The way files are generated from config.status?

Yup.  Each run of config.status uses a different temporary file name.

> Without atomic updates you will definitely lose some updates to the
> cache; since the cache is read once and written once.

Even with atomic updates, you lose some of them, unless the cache is
reread just before it's written back.  Currently, configure reads it
when it starts, and rewrites it when it finishes.  If you start
multiple configures using the same cache in parallel, the last one to
write its cache out wins, as long as you're not sufficiently unlucky
to have both of them doing it at the same time, in which case you may
end up with a corrupted cache file.

> I'm more worried about two configures writing to the cache at the same
> time.  Start both cat processes and you could end up with the two cache
> files interleaved at 1K blocks (or so, depending on FS/OS).  That makes
> me really uncomfortable...

Yup, this can be a problem.

The only safe solutions for this at the moment are to use separate
cache files per subdirectory (which defeats most of the purpose of the
cache) or prevent concurrent configure runs (which defeats the point
of making configure parallelizable)

FWIW, we've had target configures running in parallel for a long time,
and I don't know of any corruption caused by this.  Granted, there
aren't as many target libraries to be configured as there are host
packages, but still...

One way to try to overcome this limitation in autoconf that has just
occurred to me is to offload the updating of a shared config.cache to
the top-level Makefile.  E.g., the Makefile safely copies the
top-level config.cache to a subdirectory before it configures it, and
safely copies it back (or merges it) with the top-level config.cache
when configure finishes.  Safety can be accomplished with

cp ${cache_file} subdir/config.cache
run configure in subdir, with --config-cache=./config.cache
mv subdir/config.cache ${cache_file}

trying to merge the contents can get trickier, but I believe it can be
done too.

The one thing we'd have to be careful about is in case the user
specified a config.cache to the top-level, especially /dev/null.  We
may have to handle that especially, like autoconf does.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                 aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer


  reply	other threads:[~2002-12-02 17:44 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-28 14:13 Nathanael Nerode
2002-11-29  8:44 ` Andrew Cagney
2002-12-02  8:18 ` Daniel Jacobowitz
2002-12-02  8:40   ` Alexandre Oliva
2002-12-02  8:52     ` Daniel Jacobowitz
2002-12-02  9:44       ` Alexandre Oliva [this message]
2002-12-02 10:23         ` Daniel Jacobowitz
2002-12-02 12:48           ` Alexandre Oliva
2002-12-02 13:43             ` DJ Delorie
2002-12-02 14:03     ` Thomas Dickey
2002-12-04  0:42       ` Samuel Tardieu
2002-12-04  3:14         ` Thomas E. Dickey
2002-12-02 10:17   ` DJ Delorie
2002-11-29 13:51 Nathanael Nerode
2002-11-29 14:23 ` Andrew Cagney
2002-11-29 14:40 Nathanael Nerode
2002-11-29 15:16 ` Andrew Cagney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=orvg2cl3ii.fsf@free.redhat.lsd.ic.unicamp.br \
    --to=aoliva@redhat.com \
    --cc=autoconf@gnu.org \
    --cc=binutils@sources.redhat.com \
    --cc=dj@redhat.com \
    --cc=drow@mvista.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gdb-patches@sources.redhat.com \
    --cc=neroden@twcny.rr.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox