Re: race condition in writing lilypond-book filenames

2009-12-23 Thread John Mandereau
Le mercredi 23 décembre 2009 à 12:58 -0200, Haake care of both things later. > My take is that independent lp-book runs (by make -jX) share ly file > snippets. I've never seen any proof of this situation. I tried to make sure make doesn't call simultaneous lilypond-book instances, and AFAIK it ha

Re: race condition in writing lilypond-book filenames

2009-12-23 Thread Han-Wen Nienhuys
2009/12/23 John Mandereau : > Le vendredi 18 décembre 2009 à 00:38 -0200, Han-Wen Nienhuys a écrit : >> We already have a plausible explanation, and a fairly simple solution: >> use flock() in ly:parse-file on the .ly file. > > I think it's better to sanitize lilypond-book behaviour instead, namely

Re: race condition in writing lilypond-book filenames

2009-12-23 Thread John Mandereau
Le vendredi 18 décembre 2009 à 00:38 -0200, Han-Wen Nienhuys a écrit : > We already have a plausible explanation, and a fairly simple solution: > use flock() in ly:parse-file on the .ly file. I think it's better to sanitize lilypond-book behaviour instead, namely fixing relevant_contents and make

Re: race condition in writing lilypond-book filenames

2009-12-23 Thread John Mandereau
Le dimanche 13 décembre 2009 à 15:55 +, Graham Percival a écrit : > diff --git a/scripts/lilypond-book.py b/scripts/lilypond-book.py > index 392ddd0..b9731f1 100644 > --- a/scripts/lilypond-book.py > +++ b/scripts/lilypond-book.py > @@ -1273,7 +1273,11 @@ left-margin-default right-margin-defaul

Re: race condition in writing lilypond-book filenames

2009-12-17 Thread Han-Wen Nienhuys
On Thu, Dec 17, 2009 at 8:04 PM, Graham Percival wrote: > On Tue, Dec 15, 2009 at 10:00:20PM +0100, Matthias Kilian wrote: >> [sorry for mumbling to myself too much] >> >> On Sun, Dec 13, 2009 at 06:53:57PM +0100, Matthias Kilian wrote: >> [...] >> > -        out = file (path + '.ly', 'w') >> > +

Re: race condition in writing lilypond-book filenames

2009-12-17 Thread Graham Percival
On Tue, Dec 15, 2009 at 10:00:20PM +0100, Matthias Kilian wrote: > [sorry for mumbling to myself too much] > > On Sun, Dec 13, 2009 at 06:53:57PM +0100, Matthias Kilian wrote: > [...] > > -out = file (path + '.ly', 'w') > > +out = tempfile.NamedTemporaryFile(mode = 'w', suffix = '.

Re: race condition in writing lilypond-book filenames

2009-12-15 Thread Matthias Kilian
[sorry for mumbling to myself too much] On Sun, Dec 13, 2009 at 06:53:57PM +0100, Matthias Kilian wrote: [...] > -out = file (path + '.ly', 'w') > +out = tempfile.NamedTemporaryFile(mode = 'w', suffix = '.lytmp', > + dir = directory, delete

Re: race condition in writing lilypond-book filenames

2009-12-13 Thread Matthias Kilian
On Sun, Dec 13, 2009 at 05:49:13PM +0100, Matthias Kilian wrote: > If the a file with the same name always has the same content, > regardless from which document it has been generated, would something > like the following help (no real code, i'm not good at all if it > comes to python)? Don't laug

Re: race condition in writing lilypond-book filenames

2009-12-13 Thread Matthias Kilian
Hi, On Sun, Dec 13, 2009 at 03:55:00PM +, Graham Percival wrote: > diff --git a/scripts/lilypond-book.py b/scripts/lilypond-book.py > index 392ddd0..b9731f1 100644 > --- a/scripts/lilypond-book.py > +++ b/scripts/lilypond-book.py > @@ -1273,7 +1273,11 @@ left-margin-default right-margin-defaul

race condition in writing lilypond-book filenames

2009-12-13 Thread Graham Percival
diff --git a/scripts/lilypond-book.py b/scripts/lilypond-book.py index 392ddd0..b9731f1 100644 --- a/scripts/lilypond-book.py +++ b/scripts/lilypond-book.py @@ -1273,7 +1273,11 @@ left-margin-default right-margin-default)" directory = os.path.split(path)[0] if not os.path.isdir (d