bugmake - Bugs: bug #63484, make 4.4 incorrectly thinks target...

 
 

bug #63484: make 4.4 incorrectly thinks target does not exist

Submitter:  Patrick Oppenlander <pattop>
Submitted:  Wed 07 Dec 2022 11:19:38 PM UTC
   
 
Severity:  3 - Normal Item Group:  Bug
Status:  Fixed Privacy:  Public
Assigned to:  psmith Open/Closed:  Closed
Component Version:  4.4 Operating System:  Any
Fixed Release:  4.4.1 Triage Status:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 20 Dec 2022 07:30:02 AM UTC, comment #3: 

Pushed these changes, thanks Dmitry!

Paul D. Smith <psmith>
Group administrator
Sun 11 Dec 2022 10:40:33 PM UTC, comment #2: 




comment #1:

> Thanks for your report.
>
> > test.x exists but make 4.4 says it doesn't
> This is an old issue, that keeps causing questions. I think, we should open a dedicated bug report about this.
>


Okay. Makes sense: https://savannah.gnu.org/bugs/index.php?63510.

> > test.foo is older than test.x therefore test.x does not need to be updated
> This is indeed a regression.
>
> The fix for sv 60435 introduced a piece of code in implicit.c.
> Specifically,


> +                  if (f && !f->is_explicit && !d->is_explicit)
> +                    f->intermediate = 1;


>
> Same fix also introduced code in file.c and read.c to set file->is_explicit for all explicitly mentioned prerequisites and targets.
> to prevent explicitly mentioned files from being treated as intermediate.
> In this example test.foo is not a prerequisite and not a target.
> This patch in the attachment marks all makefiles as explicit.
>


I've tested the patch and can confirm that it resolves the issue, thanks.

Patrick Oppenlander <pattop>
Fri 09 Dec 2022 05:29:57 PM UTC, comment #1: 

Thanks for your report.

> test.x exists but make 4.4 says it doesn't

This is an old issue, that keeps causing questions. I think, we should open a dedicated bug report about this.


> test.foo is older than test.x therefore test.x does not need to be updated

This is indeed a regression.

The fix for sv 60435 introduced a piece of code in implicit.c.
Specifically,

+                  if (f && !f->is_explicit && !d->is_explicit)
+                    f->intermediate = 1;


Same fix also introduced code in file.c and read.c to set file->is_explicit for all explicitly mentioned prerequisites and targets.
to prevent explicitly mentioned files from being treated as intermediate.
In this example test.foo is not a prerequisite and not a target.
This patch in the attachment marks all makefiles as explicit.





(file #54077, file #54078)

Dmitry Goncharov <dgoncharov>
Wed 07 Dec 2022 11:19:38 PM UTC, original submission:  

Here's a test case reduced from a much larger build system demonstrating a behavioural change between 4.3 and 4.4 which caught me by surprise:


.SECONDARY:
.PHONY: force
-include test.foo
%.foo: force
        touch -a $@
%.x: %.foo
        touch $@
test: test.x
        touch $@


with 4.3
% ls
Makefile
% make
touch -a test.foo
touch -a test.foo
touch test.x
touch test
% ls
Makefile  test  test.foo  test.x
% make
touch -a test.foo
make: 'test' is up to date.

with 4.4
% ls
Makefile
% make
touch -a test.foo
touch -a test.foo
touch test.x
touch test
% ls
Makefile  test  test.foo  test.x
% make
touch -a test.foo
touch test.x
touch test

with --trace
% ls
Makefile  test  test.foo  test.x
% make --trace
touch -a test.foo
Makefile:7: update target 'test.x' due to: target does not exist
touch test.x
Makefile:9: update target 'test' due to: test.x
touch test

I've reported this a bug because:

  • test.x exists but make 4.4 says it doesn't
  • test.foo is older than test.x therefore test.x does not need to be updated
Patrick Oppenlander <pattop>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #54077:  sv63484_fix.diff added by dgoncharov (850B - text/x-patch)
file #54078:  sv63484_test.diff added by dgoncharov (1KiB - text/x-patch)

 

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)
  • -email is unavailable- added by dgoncharov (Updated the item)
  • -email is unavailable- added by pattop (Submitted the item)
  •  

    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 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-12-20 psmith StatusNone Fixed
        Assigned toNone psmith
        Open/ClosedOpen Closed
        Operating SystemNone Any
        Fixed ReleaseNone 4.4.1
    2022-12-09 dgoncharov Attached File- Added sv63484_fix.diff, #54077
        Attached File- Added sv63484_test.diff, #54078

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code