Re: multi-threaded compiling

2024-03-12 Thread Mischa Baars
Oh, sorry. Without the -n that is. bash -c 'set +m; seconds=1; for (( i=0;i<32;i++ )); do exit ${i} & done; sleep ${seconds}; for (( i=0;i<32;i++ )); do wait -p pid; e=${?}; echo "$(printf %3u ${i}) pid ${pid} exit ${e}"; done;' bash -c 'set -m; seconds=1; for (( i=0;i<32;i++ )); do exit ${i} &

Re: multi-threaded compiling

2024-03-12 Thread Mischa Baars
On Mon, Mar 11, 2024 at 10:26 PM Chet Ramey wrote: > On 3/11/24 3:44 PM, Mischa Baars wrote: > > On Mon, 11 Mar 2024, 20:20 Chet Ramey, > > wrote: > > > > On 3/11/24 2:50 PM, Mischa Baars wrote: > > > Which sort of brings us back to the original question I

Re: multi-threaded compiling

2024-03-12 Thread alex xmb sw ratchev
On Tue, Mar 12, 2024, 09:26 Mischa Baars wrote: > On Mon, Mar 11, 2024 at 10:26 PM Chet Ramey wrote: > > > On 3/11/24 3:44 PM, Mischa Baars wrote: > > > On Mon, 11 Mar 2024, 20:20 Chet Ramey, > > > wrote: > > > > > > On 3/11/24 2:50 PM, Mischa Baars wrote: > > >

Re: multi-threaded compiling

2024-03-12 Thread Mischa Baars
Here's the script and the Makefile using "printf '<%s>'": On Tue, Mar 12, 2024 at 9:32 AM Martin D Kealey wrote: > In section one, the problem is that "wait -n" does not do what you think > it does. (Lots of us think this behaviour is broken, and it may be fixed in > an upcoming version of

Re: multi-threaded compiling

2024-03-12 Thread Mischa Baars
Hi Chet, The only thing I can find about this behavior is the set +m / set -m option, which disables / enables the notifications, but has no effect otherwise. The line from the script won't execute from the command line with either option, neither enclosed with a 'bash -c' as in: set +m; bash

Re: multi-threaded compiling

2024-03-12 Thread Mischa Baars
On Tue, Mar 12, 2024 at 9:32 AM Martin D Kealey wrote: > In section one, the problem is that "wait -n" does not do what you think > it does. (Lots of us think this behaviour is broken, and it may be fixed in > an upcoming version of Bash.) You don't need '-n' when you specify a PID; > the fix is

Re: multi-threaded compiling

2024-03-12 Thread Mischa Baars
Got it!!! bash -c 'set +m; seconds=5; for (( i=0;i<32;i++ )); do exit ${i} & pid[${i}]=${!}; done; sleep ${seconds}; for (( i=0;i<32;i++ )); do wait ${pid[${i}]}; e=${?}; echo "$(printf %3u ${i}) pid ${pid[${i}]} exit ${e}"; done;' One problem solved :) The problem was exactly the -n, and had

Re: multi-threaded compiling

2024-03-12 Thread alex xmb sw ratchev
On Tue, Mar 12, 2024, 12:49 Greg Wooledge wrote: > On Tue, Mar 12, 2024 at 09:42:22AM +0100, Mischa Baars wrote: > > Here's the script and the Makefile using "printf '<%s>'": > > Sadly, your mail user agent chose to attach "Makefile" with content-type > application/octet-stream, which my MUA

Re: multi-threaded compiling

2024-03-12 Thread Mischa Baars
On Tue, Mar 12, 2024 at 12:49 PM Greg Wooledge wrote: > On Tue, Mar 12, 2024 at 09:42:22AM +0100, Mischa Baars wrote: > > Here's the script and the Makefile using "printf '<%s>'": > > Sadly, your mail user agent chose to attach "Makefile" with content-type > application/octet-stream, which my

Re: multi-threaded compiling

2024-03-12 Thread Greg Wooledge
On Tue, Mar 12, 2024 at 09:42:22AM +0100, Mischa Baars wrote: > Here's the script and the Makefile using "printf '<%s>'": Sadly, your mail user agent chose to attach "Makefile" with content-type application/octet-stream, which my MUA (mutt) refuses to show inline, or to include in a reply as

Re: multi-threaded compiling

2024-03-12 Thread Martin D Kealey
In section one, the problem is that "wait -n" does not do what you think it does. (Lots of us think this behaviour is broken, and it may be fixed in an upcoming version of Bash.) You don't need '-n' when you specify a PID; the fix is simply to remove it. In section two, the problem is that quote

Re: bisecting gnu make

2024-03-12 Thread David Boyce
Thank you both for the replies. I've had little time to get back to this and little success when I tried but it's too early to draw any conclusions. I'll update on progress when I get back to it. Paul, I didn't know "make make" was an option but it doesn't seem to help. Actually I think there's a

Re: multi-threaded compiling

2024-03-12 Thread Martin D Kealey
> On Mon, Mar 11, 2024 at 8:20 PM Chet Ramey wrote: > > On 3/11/24 2:50 PM, Mischa Baars wrote: > > > Which sort of brings us back to the original question I suppose. Who > does > > > that line of code function from a script and why does it fail from the > > > command line? > > > > Job control

Re: multi-threaded compiling

2024-03-12 Thread Chet Ramey
On 3/12/24 4:23 AM, Mischa Baars wrote: So... how do I fix it? If you want double quotes in a variable expansion to have some meaning to the parser, you need to run the expanded value through the parser, using something like `eval'. Or you figure out a different way to glue the arguments

Re: multi-threaded compiling

2024-03-12 Thread Paul Smith
On Tue, 2024-03-12 at 13:37 +0100, Mischa Baars wrote: > > I'd still like to hear why you aren't simply using "make -j". > > That's because I don't want to define static compile and link targets > for every new project I start. The Makefile in question contains only > a few lines of code and some