[bug #60919] Communicating -j to sub-make not working properly after make 4.1

2021-07-15 Thread Paul D. Smith
Update of bug #60919 (project make):

  Status:None => Not A Bug  
 Open/Closed:Open => Closed 

___

Follow-up Comment #1:

Your parent makefile is incorrect.  By adding an explicit -j option to the
submake command line you are forcing the sub-make to run in a mode with no
restrictions on the amount of parallelism; see the documentation:

> If there is nothing looking like an integer after the ‘-j’ option, there
is no limit on the number of job slots.

If you want to have your sub-makes participate in the jobserver and obey the
limits provided by the make command line, you should remove the -j option from
the submake command line.  In other words, change:


test1:
sleep .1; echo start test1; sleep .1; cd child; $(MAKE) -j ;  echo end 
test1


to this:


test1:
sleep .1; echo start test1; sleep .1; cd child; $(MAKE) ;  echo end 
test1


And the same for all other sub-make invocations obviously.

In general you never want to add specific options to the command line of
sub-makes unless you're trying to modify or override the operations that the
user specified when they invoked the top-level make (which should be extremely
rare).

___

Reply to this item at:

  

___
  Message sent via Savannah
  https://savannah.gnu.org/




[bug #60919] Communicating -j to sub-make not working properly after make 4.1

2021-07-15 Thread Bahaa Hamza
Additional Item Attachment, bug #60919 (project make):

File name: testcase.tar.gzSize:0 KB




___

Reply to this item at:

  

___
  Message sent via Savannah
  https://savannah.gnu.org/




[bug #60919] Communicating -j to sub-make not working properly after make 4.1

2021-07-15 Thread Bahaa Hamza
URL:
  

 Summary: Communicating -j to sub-make not working properly
after make 4.1
 Project: make
Submitted by: bahaahamza
Submitted on: Thu 15 Jul 2021 07:56:37 AM UTC
Severity: 3 - Normal
  Item Group: Bug
  Status: None
 Privacy: Public
 Assigned to: None
 Open/Closed: Open
 Discussion Lock: Any
   Component Version: 4.1
Operating System: None
   Fixed Release: None
   Triage Status: None

___

Details:


Referring to make manual, in "Communicating Options to a Sub-make". The
following was mentioned:
"The ‘-j’ option is a special case (see Parallel Execution). If you set it
to some numeric value ‘N’ and your operating system supports it (most any
UNIX system will; others typically won’t), the parent make and all the
sub-makes will communicate to ensure that there are only ‘N’ jobs running
at the same time between them all."

Prior to make version 4.1 (4.0 and earlier), this was working fine. If parent
make was run with -jN, eventually make and sub-make will be running only N
jobs.

But since make 4.1 (till 4.3), it's not working as before.
sub-make will spawn several jobs and the total count is more than N.

I tried to check in Changelog if this was an intended change in behavior, but
i didn't find this change. 

** Testcase:
I've attached a testcase to this bug. 
For example, you can run "make -j 2" using make 3.8 and make 4.2. 
For v3.8, you will notice that only 2 jobs will be running at a time
(subtests).
While for v4.2, all chile subtests will be spawned (2 * 8).





___

Reply to this item at:

  

___
  Message sent via Savannah
  https://savannah.gnu.org/