bugmake - Bugs: bug #57896, Incorrect directory is printed in...

 
 

bug #57896: Incorrect directory is printed in "Entering directory" message when -j1 disables jobserver mode for a sub make

Submitter:  None
Submitted:  Tue 25 Feb 2020 05:09:22 PM UTC
   
 
Severity:  3 - Normal Item Group:  Bug
Status:  Fixed Privacy:  Public
Assigned to:  psmith Open/Closed:  Closed
Component Version:  4.2.1 Operating System:  Any
Fixed Release:  4.4 Triage Status:  Small Effort
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 31 Mar 2020 05:14:37 AM UTC, comment #2: 

I fixed this, but it also involved fixing some incorrect behavior when providing both -w and --no-print-directory.

Paul D. Smith <psmith>
Group administrator
Sun 29 Mar 2020 10:10:09 PM UTC, comment #1: 

Very strange.  If you don't use the -w option and allow the default setting (which is still to enable directory printing) then it works correctly:


$ make -j2
make -C /tmp/a/b/c
make[1]: Entering directory '/tmp/a/b/c'
echo /tmp/a/b/c
/tmp/a/b/c
make[1]: Leaving directory '/tmp/a/b/c'
make -C /tmp/a/b/d -j1
make[1]: warning: -jN forced in submake: disabling jobserver mode.
make[1]: Entering directory '/tmp/a/b/d'
echo /tmp/a/b/d
/tmp/a/b/d
make[1]: Leaving directory '/tmp/a/b/d'


Although interestingly, in this case the warning is printed before the "Entering" message.

It's only if you use both -w and -jN that you see the incorrect directory printed.

Paul D. Smith <psmith>
Group administrator
Tue 25 Feb 2020 05:09:22 PM UTC, original submission:  

gmake seems to be printing what the directory was prior to the launching of a sub make that disables jobserver mode with -j1. The submake is started in the correct directory, but the wrong one is printed in the "Entering directory" message.

This inconsistency in messages was not present in gmake 3.82 (Debian 7, 9, MacOS 10.10, Windows 7). I have reproduced the behavior with gmake 4.1 (on Debian 9) and with gmake 4.2.1 (on Debian 7, 9, 10, MacOS 10.10, Windows 7)

Simple makefiles attached to reproduce the behavior.

% gmake -v
GNU Make 4.2.1
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.


% pwd
/tmp/a

------------ All Correct ---------
% gmake -w
gmake: Entering directory '/tmp/a'
gmake -C /tmp/a/b/c
gmake[1]: Entering directory '/tmp/a/b/c'
echo /tmp/a/b/c
/tmp/a/b/c
gmake[1]: Leaving directory '/tmp/a/b/c'
gmake -C /tmp/a/b/d -j1
gmake[1]: Entering directory '/tmp/a/b/d'
echo /tmp/a/b/d
/tmp/a/b/d
gmake[1]: Leaving directory '/tmp/a/b/d'
gmake: Leaving directory '/tmp/a'

------------ Second submake incorrectly reports "Entering directory '/tmp/a'" instead of Entering directory '/tmp/a/b/d' ---------
% gmake -w -j2
gmake: Entering directory '/tmp/a'
gmake -C /tmp/a/b/c
gmake[1]: Entering directory '/tmp/a/b/c'
echo /tmp/a/b/c
/tmp/a/b/c
gmake[1]: Leaving directory '/tmp/a/b/c'
gmake -C /tmp/a/b/d -j1
gmake[1]: Entering directory '/tmp/a'
gmake[1]: warning: -jN forced in submake: disabling jobserver mode.
echo /tmp/a/b/d
/tmp/a/b/d
gmake[1]: Leaving directory '/tmp/a/b/d'
gmake: Leaving directory '/tmp/a'



Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #48498:  gmake.print-dir.tar added by None (10KiB - application/x-tar)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by psmith (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-03-31 psmith StatusNone Fixed
        Open/ClosedOpen Closed
        Fixed ReleaseNone 4.4
    2020-03-29 psmith Assigned toNone psmith
        Triage StatusNone Small Effort
    2020-02-25 None Attached File- Added gmake.print-dir.tar, #48498

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code