[bug #64259] Regression in master: make ignores statements it should not ignore.

2023-12-18 Thread Martin Dorey
Follow-up Comment #3, bug#64259 (group make):

Paul did pretty much explicitly say in the introducer, bug #64185, that he
wasn't interested in being told about:

> people indenting their conditionals with the recipe prefix

... and yet here I am, sorry, pointing at the tab still at
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Makefile?h=v6.7-rc6#n902
since 2010-10-13 17:12:30 -0400 rost...@goodmis.org
(72441cb1fd77d092f09ddfac748955703884c9a7). There are others but that's the
one that's just cost me a few hours to hack out on our driver build
installation for 11 kernels of varying ages. I know the Linux build system's
compatibility with Gnu Make has been important to a number of other posters
over the years. I wonder that we haven't heard from Yamada-san, who we did
hear from in bug #64288 after the introducer went in.


___

Reply to this item at:

  

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




[bug #64259] Regression in master: make ignores statements it should not ignore.

2023-12-17 Thread Martin Dorey
Follow-up Comment #2, bug#64259 (group make):

The change suggested here doesn't treat these two cases quite symmetrically:

martind@stormy:~/tmp/make-missing-endif$ printf 'ifeq "a"
"a"\n\tendif\ndefault:;\n' > Makefile; ~/download/make/make
Makefile:2: *** recipe commences before first target.  Stop.
martind@stormy:~/tmp/make-missing-endif$ printf 'ifeq "a"
"b"\n\tendif\ndefault:;\n' > Makefile; ~/download/make/make
Makefile:4: *** missing 'endif'.  Stop.
martind@stormy:~/tmp/make-missing-endif$ 

I'd say that's only a minor code smell.  I consider it an advance on the
pushed code, which accepts the first, while rejecting the second.  It better
fulfills the NEWS entry by rejecting:

martind@stormy:~/tmp/make-missing-endif$ printf '\tifeq ""
""\nendif\ndefault:;\n' > Makefile; ~/download/make/make
Makefile:1: *** recipe commences before first target.  Stop.
martind@stormy:~/tmp/make-missing-endif$ 

... which the pushed code accepts:

martind@stormy:~/tmp/make-missing-endif$ printf '\tifeq ""
""\nendif\ndefault:;\n' > Makefile; ~/bin/make-4.4.90
make-4.4.90: 'default' is up to date.
martind@stormy:~/tmp/make-missing-endif$ 


I'd like to also suggest this correction to the introducer:

martind@stormy:~/download/make$ git diff tests/scripts/features/conditionals 
diff --git a/tests/scripts/features/conditionals
b/tests/scripts/features/conditionals
index c1eee95c..27417623 100644
--- a/tests/scripts/features/conditionals
+++ b/tests/scripts/features/conditionals
@@ -153,7 +153,7 @@ endif
 ',
   '', "one\n");
 
-# SV 64085: Ensure recipe prefixed conditionals are never considered
+# SV 64185: Ensure recipe prefixed conditionals are never considered
 run_make_test(q!
 blah=1
 ifdef blah
martind@stormy:~/download/make$ 

I struggled to find the right bug, hence to find my way here.


___

Reply to this item at:

  

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




[bug #64259] Regression in master: make ignores statements it should not ignore.

2023-05-27 Thread Dmitry Goncharov
Follow-up Comment #1, bug #64259 (project make):

Commit 07fcee35f058a876447c8a021f9eb1943f902534 introduced a regression.

The text in NEWS clarifies that the idea was to never consider a line starting
with the recipe prefix as a conditional, to ensure make does not confuse
recipe lines with conditionals as described in sv 64185.

However, there are cases where the fix 
1. Still considers lines starting with the recipe prefix as conditionals.
2. Ignores lines which it should not ignore.

In this makefile both 'ifdef blah' and 'else' are intended with tabs.


$ ls
makefile
$ cat makefile 
ifdef blah
$(info true)
else
$(info false)
endif
all:
$ make-4.4
false
make-4.4: Nothing to be done for 'all'.
$ # this is the latest make from master
$ ~/src/gmake/make/m64/make 
make: Nothing to be done for 'all'.


We can see the latest make
1. honored 'ifdef blah', even though it is intended with a tab.
2. failed to run '$(info false)'.

The patch in the attachment causes make to fail with a syntax error here.
The patch keeps NEWS intact.


___

Reply to this item at:

  

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




[bug #64259] Regression in master: make ignores statements it should not ignore.

2023-05-27 Thread Dmitry Goncharov
Additional Item Attachment, bug #64259 (project make):

File name: sv64259_fix.diff   Size:2 KB


File name: sv64259_test.diff  Size:1 KB




___

Reply to this item at:

  

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




[bug #64259] Regression in master: make ignores statements it should not ignore.

2023-05-27 Thread Dmitry Goncharov
URL:
  

 Summary: Regression in master: make ignores statements it
should not ignore.
   Group: make
   Submitter: dgoncharov
   Submitted: Sat 27 May 2023 03:33:14 PM UTC
Severity: 3 - Normal
  Item Group: Bug
  Status: None
 Privacy: Public
 Assigned to: None
 Open/Closed: Open
 Discussion Lock: Any
   Component Version: SCM
Operating System: None
   Fixed Release: None
   Triage Status: None


___

Follow-up Comments:


---
Date: Sat 27 May 2023 03:33:14 PM UTC By: Dmitry Goncharov 
.







___

Reply to this item at:

  

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