all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#68996: [PATCH] Respect warnings added in GNU Make 4.4.90
@ 2024-02-09  3:00 Collin Funk
  2024-02-09  6:25 ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: Collin Funk @ 2024-02-09  3:00 UTC (permalink / raw)
  To: 68996

[-- Attachment #1: Type: text/plain, Size: 1640 bytes --]

Tags: patch

Tags: patch

When building Emacs with recent versions of GNU Make every object file
built will result in a warning like so:

../src/verbose.mk:58: warning: invalid variable reference ' '
  CC       emacs-module.o

This doesn't prevent Emacs from building but makes it slightly harder
to see any build output. I attached a patch that should work for all
versions of GNU Make, both before and after the change. However it
also causes the indentation to disappear in-front of CC and ELC which
looks a bit strange. It doesn't seem like there is a valid way to do
this at the moment. More discussion about this change can be seen
here: https://savannah.gnu.org/bugs/?65273

Feel free to change my patch if you see a better way to solve these
warnings.

Also, I have never committed to Emacs. This change feels trivial but
results in 34 lines changed. Therefore I was unsure if this patch
could be Copyright-paperwork-exempt tagged. Feel free to email me off
list if I must fill them out. Thanks

Collin

In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
 3.24.38, cairo version 1.16.0) of 2024-02-07 built on debian
Repository revision: ed2450e79b597e0306f14b542e934a90dfd9786f
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101007
System Description: Debian GNU/Linux 12 (bookworm)

Configured using:
 'configure --prefix=/home/collin/.local --with-sound=no
 --with-libsystemd --without-gconf --without-compress-install
 --with-native-compilation=yes --with-cairo --with-x=yes
 --with-x-toolkit=gtk3 --with-harfbuzz --with-tree-sitter --with-json
 --with-imagemagick'


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Respect-warnings-added-in-GNU-Make-4.4.90.patch --]
[-- Type: text/patch, Size: 2545 bytes --]

From dee15de965a10f3cc9816c0e177b9a3208f367a8 Mon Sep 17 00:00:00 2001
From: Collin Funk <collin.funk1@gmail.com>
Date: Thu, 8 Feb 2024 18:19:45 -0800
Subject: [PATCH] Respect warnings added in GNU Make 4.4.90

* src/verbose.mk.in: Get rid of invalid variable references in
the info function. These were used to indent messages in build
output but cause warning spam in GNU Make 4.4.90 and later.
More information about this can be found here:
https://savannah.gnu.org/bugs/?65273
---
 src/verbose.mk.in | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/src/verbose.mk.in b/src/verbose.mk.in
index e72c182f276..d2c28909436 100644
--- a/src/verbose.mk.in
+++ b/src/verbose.mk.in
@@ -53,38 +53,38 @@ have_working_info = $(filter notintermediate,$(value .FEATURES))
 # The workaround is done only for AM_V_ELC and AM_V_ELN,
 # since the bug is not annoying elsewhere.
 
-AM_V_AR      = @$(info $   AR       $@)
+AM_V_AR      = @$(info AR       $@)
 AM_V_at = @
-AM_V_CC      = @$(info $   CC       $@)
-AM_V_CXX     = @$(info $   CXX      $@)
-AM_V_CCLD    = @$(info $   CCLD     $@)
-AM_V_CXXLD   = @$(info $   CXXLD    $@)
+AM_V_CC      = @$(info CC       $@)
+AM_V_CXX     = @$(info CXX      $@)
+AM_V_CCLD    = @$(info CCLD     $@)
+AM_V_CXXLD   = @$(info CXXLD    $@)
 
 ifeq ($(HAVE_NATIVE_COMP)-$(NATIVE_DISABLED)-$(ANCIENT),yes--)
 ifneq (,$(have_working_info))
-AM_V_ELC     = @$(info $   ELC+ELN  $@)
-AM_V_ELN     = @$(info $   ELN      $@)
+AM_V_ELC     = @$(info ELC+ELN  $@)
+AM_V_ELN     = @$(info ELN      $@)
 else
-AM_V_ELC     = @echo "  ELC+ELN " $@;
-AM_V_ELN     = @echo "  ELN     " $@;
+AM_V_ELC     = @echo "ELC+ELN " $@;
+AM_V_ELN     = @echo "ELN     " $@;
 endif
 else
 ifneq (,$(have_working_info))
-AM_V_ELC     = @$(info $   ELC      $@)
+AM_V_ELC     = @$(info ELC      $@)
 else
-AM_V_ELC     = @echo "  ELC     " $@;
+AM_V_ELC     = @echo "ELC     " $@;
 endif
 AM_V_ELN =
 endif
 
-AM_V_GEN     = @$(info $   GEN      $@)
-AM_V_GLOBALS = @$(info $   GEN      globals.h)
+AM_V_GEN     = @$(info GEN      $@)
+AM_V_GLOBALS = @$(info GEN      globals.h)
 AM_V_NO_PD = --no-print-directory
-AM_V_RC      = @$(info $   RC       $@)
+AM_V_RC      = @$(info RC       $@)
 
 # These are used for the Android port.
-AM_V_JAVAC	= @$(info $   JAVAC    $@)
-AM_V_D8		= @$(info $   D8       $@)
-AM_V_AAPT	= @$(info $   AAPT     $@)
+AM_V_JAVAC	= @$(info JAVAC    $@)
+AM_V_D8		= @$(info D8       $@)
+AM_V_AAPT	= @$(info AAPT     $@)
 AM_V_SILENT	= @
 endif
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* bug#68996: [PATCH] Respect warnings added in GNU Make 4.4.90
  2024-02-09  3:00 bug#68996: [PATCH] Respect warnings added in GNU Make 4.4.90 Collin Funk
@ 2024-02-09  6:25 ` Eli Zaretskii
  2024-02-09  7:27   ` Paul Eggert
  0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2024-02-09  6:25 UTC (permalink / raw)
  To: Collin Funk, Paul Eggert; +Cc: 68996

> From: Collin Funk <collinfunk38@gmail.com>
> Date: Thu, 08 Feb 2024 19:00:02 -0800
> 
> When building Emacs with recent versions of GNU Make every object file
> built will result in a warning like so:
> 
> ../src/verbose.mk:58: warning: invalid variable reference ' '
>   CC       emacs-module.o

Why did Make have to break Makefiles that depend on this "feature"?

> This doesn't prevent Emacs from building but makes it slightly harder
> to see any build output. I attached a patch that should work for all
> versions of GNU Make, both before and after the change. However it
> also causes the indentation to disappear in-front of CC and ELC which
> looks a bit strange. It doesn't seem like there is a valid way to do
> this at the moment. More discussion about this change can be seen
> here: https://savannah.gnu.org/bugs/?65273
> 
> Feel free to change my patch if you see a better way to solve these
> warnings.

My vote is for GNU Make to support this feature, since there's no good
way of having it otherwise (given what Paul Smith says in that
discussion).  Adding Paul Eggert in case he has ideas.  Paul, how do
other project produce the same indented "CC foo.o"? do they also use
this trick? or something else?

> Also, I have never committed to Emacs. This change feels trivial but
> results in 34 lines changed. Therefore I was unsure if this patch
> could be Copyright-paperwork-exempt tagged. Feel free to email me off
> list if I must fill them out. Thanks

Let's see if we want to install this.  I'm not sure.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#68996: [PATCH] Respect warnings added in GNU Make 4.4.90
  2024-02-09  6:25 ` Eli Zaretskii
@ 2024-02-09  7:27   ` Paul Eggert
  2024-02-09 11:43     ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: Paul Eggert @ 2024-02-09  7:27 UTC (permalink / raw)
  To: Eli Zaretskii, Collin Funk; +Cc: 68996-done

[-- Attachment #1: Type: text/plain, Size: 584 bytes --]

On 2024-02-08 22:25, Eli Zaretskii wrote:
> Paul, how do
> other project produce the same indented "CC foo.o"? do they also use
> this trick? or something else?

Nobody else does it as far as I know. It was my invention, just for Emacs.

I expect the new GNU 'make' behavior will be better for most software 
projects, as it's likely to catch typos that cause bugs. So let's port 
to it; it's not hard. To do that, I installed the attached patch into 
Emacs master. It uses Paul Smith's suggestion, so that 'make' still 
outputs nicely-indented info.

Boldly marking this bug as done.

[-- Attachment #2: 0001-Port-to-GNU-Make-03ecd94488b85adc38746ec3e7c2a297a52.patch --]
[-- Type: text/x-patch, Size: 8492 bytes --]

From 8d09e1def55e57a8c627ba704289f796c48a085d Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Thu, 8 Feb 2024 23:17:04 -0800
Subject: [PATCH] Port to GNU Make 03ecd94488b85adc38746ec3e7c2a297a522598e
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Problem reported by Collin Funk (Bug#68996).
* GNUmakefile (.): New macro.
(help): Use ‘$.’ instead of ‘$ ’.
* cross/verbose.mk.android, src/verbose.mk.in (.): New macro.
(AM_V_AR, AM_V_CC, AM_V_CXX, AM_V_CCLD, AM_V_CXXLD, AM_V_GEN):
Use ‘$.’ instead of ‘$ ’.
* lib-src/Makefile.in (install): Use ‘$.’ instead of ‘$ ’.
---
 GNUmakefile              | 50 +++++++++++++++++++++-------------------
 cross/verbose.mk.android | 13 ++++++-----
 lib-src/Makefile.in      |  4 ++--
 src/verbose.mk.in        | 29 ++++++++++++-----------
 4 files changed, 50 insertions(+), 46 deletions(-)

diff --git a/GNUmakefile b/GNUmakefile
index 16064672c65..58c0281e895 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -27,6 +27,8 @@
 # newly-built Makefile.  If the source tree is already configured,
 # this file defers to the existing Makefile.
 
+. :=
+
 # If you want non-default build options, or if you want to build in an
 # out-of-source tree, you should run 'configure' before running 'make'.
 # But run 'autogen.sh' first, if the source was checked out directly
@@ -36,30 +38,30 @@
 
 ifeq (help,$(filter help,$(MAKECMDGOALS)))
 help:
-	$(info $ NOTE:  This is a brief summary of some common make targets.)
-	$(info $ For more detailed information, please read the files INSTALL,)
-	$(info $ INSTALL.REPO, Makefile or visit this URL:)
-	$(info $ https://www.gnu.org/prep/standards/html_node/Standard-Targets.html)
-	$(info $ )
-	$(info $ make all              -- compile and build Emacs)
-	$(info $ make install          -- install Emacs)
-	$(info $ make TAGS             -- update tags tables)
-	$(info $ make clean            -- delete built files but preserve configuration)
-	$(info $ make mostlyclean      -- like 'make clean', but leave those files that)
-	$(info $                          usually do not need to be recompiled)
-	$(info $ make distclean        -- delete all build and configuration files,)
-	$(info $                          leave only files included in source distribution)
-	$(info $ make maintainer-clean -- delete almost everything that can be regenerated)
-	$(info $ make extraclean       -- like maintainer-clean, and also delete)
-	$(info $                          backup and autosave files)
-	$(info $ make bootstrap        -- delete all compiled files to force a new bootstrap)
-	$(info $                          from a clean slate, then build in the normal way)
-	$(info $ make uninstall        -- remove files installed by 'make install')
-	$(info $ make check            -- run the Emacs test suite)
-	$(info $ make docs             -- generate Emacs documentation in info format)
-	$(info $ make html             -- generate documentation in html format)
-	$(info $ make ps               -- generate documentation in ps format)
-	$(info $ make pdf              -- generate documentation in pdf format )
+	$(info $.NOTE:  This is a brief summary of some common make targets.)
+	$(info $.For more detailed information, please read the files INSTALL,)
+	$(info $.INSTALL.REPO, Makefile or visit this URL:)
+	$(info $.https://www.gnu.org/prep/standards/html_node/Standard-Targets.html)
+	$(info $.)
+	$(info $.make all              -- compile and build Emacs)
+	$(info $.make install          -- install Emacs)
+	$(info $.make TAGS             -- update tags tables)
+	$(info $.make clean            -- delete built files but preserve configuration)
+	$(info $.make mostlyclean      -- like 'make clean', but leave those files that)
+	$(info $.                         usually do not need to be recompiled)
+	$(info $.make distclean        -- delete all build and configuration files,)
+	$(info $.                         leave only files included in source distribution)
+	$(info $.make maintainer-clean -- delete almost everything that can be regenerated)
+	$(info $.make extraclean       -- like maintainer-clean, and also delete)
+	$(info $.                         backup and autosave files)
+	$(info $.make bootstrap        -- delete all compiled files to force a new bootstrap)
+	$(info $.                         from a clean slate, then build in the normal way)
+	$(info $.make uninstall        -- remove files installed by 'make install')
+	$(info $.make check            -- run the Emacs test suite)
+	$(info $.make docs             -- generate Emacs documentation in info format)
+	$(info $.make html             -- generate documentation in html format)
+	$(info $.make ps               -- generate documentation in ps format)
+	$(info $.make pdf              -- generate documentation in pdf format )
 	@:
 
 .PHONY: help
diff --git a/cross/verbose.mk.android b/cross/verbose.mk.android
index 958cf237c58..7b9af76404b 100644
--- a/cross/verbose.mk.android
+++ b/cross/verbose.mk.android
@@ -44,12 +44,13 @@ have_working_info = $(filter notintermediate,$(value .FEATURES))
 # The workaround is done only for AM_V_ELC and AM_V_ELN,
 # since the bug is not annoying elsewhere.
 
-AM_V_AR      = @$(info $   AR       $@)
+. :=
+AM_V_AR      = @$(info $.  AR       $@)
 AM_V_at	     = @
-AM_V_CC      = @$(info $   CC       $@)
-AM_V_CXX     = @$(info $   CXX      $@)
-AM_V_CCLD    = @$(info $   CCLD     $@)
-AM_V_CXXLD   = @$(info $   CXXLD    $@)
-AM_V_GEN     = @$(info $   GEN      $@)
+AM_V_CC      = @$(info $.  CC       $@)
+AM_V_CXX     = @$(info $.  CXX      $@)
+AM_V_CCLD    = @$(info $.  CCLD     $@)
+AM_V_CXXLD   = @$(info $.  CXXLD    $@)
+AM_V_GEN     = @$(info $.  GEN      $@)
 AM_V_NO_PD = --no-print-directory
 endif
diff --git a/lib-src/Makefile.in b/lib-src/Makefile.in
index 7c059640862..3cdf1620781 100644
--- a/lib-src/Makefile.in
+++ b/lib-src/Makefile.in
@@ -319,7 +319,7 @@ maybe-blessmail:
 ## up if chown or chgrp fails, as the package responsible for
 ## installing Emacs can fix this problem later.
 $(DESTDIR)${archlibdir}: all
-	$(info $ )
+	$(info $.)
 	$(info Installing utilities run internally by Emacs.)
 	umask 022 && ${MKDIR_P} "$(DESTDIR)${archlibdir}"
 	exp_archlibdir=`cd "$(DESTDIR)${archlibdir}" && pwd -P` && \
@@ -361,7 +361,7 @@ .PHONY:
 .PHONY: bootstrap-clean check tags
 
 install: $(DESTDIR)${archlibdir}
-	$(info $ )
+	$(info $.)
 	$(info Installing utilities for users to run.)
 	umask 022 && ${MKDIR_P} "$(DESTDIR)${bindir}"
 	for file in ${INSTALLABLES} ; do \
diff --git a/src/verbose.mk.in b/src/verbose.mk.in
index e72c182f276..6efb6b9416b 100644
--- a/src/verbose.mk.in
+++ b/src/verbose.mk.in
@@ -53,38 +53,39 @@ have_working_info = $(filter notintermediate,$(value .FEATURES))
 # The workaround is done only for AM_V_ELC and AM_V_ELN,
 # since the bug is not annoying elsewhere.
 
-AM_V_AR      = @$(info $   AR       $@)
+. :=
+AM_V_AR      = @$(info $.  AR       $@)
 AM_V_at = @
-AM_V_CC      = @$(info $   CC       $@)
-AM_V_CXX     = @$(info $   CXX      $@)
-AM_V_CCLD    = @$(info $   CCLD     $@)
-AM_V_CXXLD   = @$(info $   CXXLD    $@)
+AM_V_CC      = @$(info $.  CC       $@)
+AM_V_CXX     = @$(info $.  CXX      $@)
+AM_V_CCLD    = @$(info $.  CCLD     $@)
+AM_V_CXXLD   = @$(info $.  CXXLD    $@)
 
 ifeq ($(HAVE_NATIVE_COMP)-$(NATIVE_DISABLED)-$(ANCIENT),yes--)
 ifneq (,$(have_working_info))
-AM_V_ELC     = @$(info $   ELC+ELN  $@)
-AM_V_ELN     = @$(info $   ELN      $@)
+AM_V_ELC     = @$(info $.  ELC+ELN  $@)
+AM_V_ELN     = @$(info $.  ELN      $@)
 else
 AM_V_ELC     = @echo "  ELC+ELN " $@;
 AM_V_ELN     = @echo "  ELN     " $@;
 endif
 else
 ifneq (,$(have_working_info))
-AM_V_ELC     = @$(info $   ELC      $@)
+AM_V_ELC     = @$(info $.  ELC      $@)
 else
 AM_V_ELC     = @echo "  ELC     " $@;
 endif
 AM_V_ELN =
 endif
 
-AM_V_GEN     = @$(info $   GEN      $@)
-AM_V_GLOBALS = @$(info $   GEN      globals.h)
+AM_V_GEN     = @$(info $.  GEN      $@)
+AM_V_GLOBALS = @$(info $.  GEN      globals.h)
 AM_V_NO_PD = --no-print-directory
-AM_V_RC      = @$(info $   RC       $@)
+AM_V_RC      = @$(info $.  RC       $@)
 
 # These are used for the Android port.
-AM_V_JAVAC	= @$(info $   JAVAC    $@)
-AM_V_D8		= @$(info $   D8       $@)
-AM_V_AAPT	= @$(info $   AAPT     $@)
+AM_V_JAVAC	= @$(info $.  JAVAC    $@)
+AM_V_D8		= @$(info $.  D8       $@)
+AM_V_AAPT	= @$(info $.  AAPT     $@)
 AM_V_SILENT	= @
 endif
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* bug#68996: [PATCH] Respect warnings added in GNU Make 4.4.90
  2024-02-09  7:27   ` Paul Eggert
@ 2024-02-09 11:43     ` Eli Zaretskii
  2024-02-09 12:18       ` Collin Funk
  0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2024-02-09 11:43 UTC (permalink / raw)
  To: Paul Eggert; +Cc: collinfunk38, 68996

> Date: Thu, 8 Feb 2024 23:27:47 -0800
> Cc: 68996-done@debbugs.gnu.org
> From: Paul Eggert <eggert@cs.ucla.edu>
> 
> I expect the new GNU 'make' behavior will be better for most software 
> projects, as it's likely to catch typos that cause bugs. So let's port 
> to it; it's not hard. To do that, I installed the attached patch into 
> Emacs master. It uses Paul Smith's suggestion, so that 'make' still 
> outputs nicely-indented info.

Thanks, the results look good here.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#68996: [PATCH] Respect warnings added in GNU Make 4.4.90
  2024-02-09 11:43     ` Eli Zaretskii
@ 2024-02-09 12:18       ` Collin Funk
  0 siblings, 0 replies; 5+ messages in thread
From: Collin Funk @ 2024-02-09 12:18 UTC (permalink / raw)
  To: Eli Zaretskii, Paul Eggert; +Cc: 68996

On 2/9/24 3:43 AM, Eli Zaretskii wrote:
> Thanks, the results look good here.

Works for me with GNU Make 4.3 and 4.4.90 as well.
Hopefully nothing breaks the $. workaround in the future. :)





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-02-09 12:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-09  3:00 bug#68996: [PATCH] Respect warnings added in GNU Make 4.4.90 Collin Funk
2024-02-09  6:25 ` Eli Zaretskii
2024-02-09  7:27   ` Paul Eggert
2024-02-09 11:43     ` Eli Zaretskii
2024-02-09 12:18       ` Collin Funk

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.