From: David Howells <dhowells@redhat.com>
To: Masahiro Yamada <masahiroy@kernel.org>,
Nathan Chancellor <nathan@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
Nicolas Schier <nicolas@fjasle.eu>
Cc: dhowells@redhat.com, linux-kbuild@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [RFC][PATCH] build: Deal with change in "make --no-print-directory" behaviour change
Date: Thu, 08 Jun 2023 16:14:58 +0100 [thread overview]
Message-ID: <2427604.1686237298@warthog.procyon.org.uk> (raw)
Hi Masahiro & the kbuild crew,
Here's a patch to fix a change in make behaviour in make-4.4. It's almost
certainly the wrong solution, but it works for me for now.
Note that I tried just adding "--print-directory" to the $(MAKE) line after
the line I added, and that does seem to work - but it then prints a lot of
additional "entering directory" lines (though they all seem to be the same).
David
---
Emacs (and probably other IDEs) parse the "make: Entering directory" lines
in the build output so that they can correctly resolve relative pathnames
in messages from the compiler. However, a change in make has broken this.
I think it might be:
[/usr/share/doc/make/NEWS]
...
Version 4.4 (31 Oct 2022)
...
* WARNING: Backward-incompatibility!
Previously if --no-print-directory was seen anywhere in the environment or
command line it would take precedence over any --print-directory. Now, the
last setting of directory printing options seen will be used, so a command
line such as "--no-print-directory -w" _will_ show directory entry/exits.
Doing a kernel build now only prints the directory passed to the "-C" flag
if present and no other directories. This includes any build directory
indicated with "O=". So if I do:
make -C /my/data/linux O=build
I see:
make: Entering directory '/my/data/linux'
and all the path in messages emitted by the compiler are prefixed with ".."
- but then doing "M-x next-error" in emacs will prompt emacs to ask where
the file is rather than jumping to it because it can't find it.
On the previous version of Fedora with make-4.3, an extra line is emitted
by make:
make[1]: Entering directory '/my/data/linux/build'
and that was sufficient for emacs to be able to resolve paths.
Fix this by manually printing the missing line.
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Masahiro Yamada <masahiroy@kernel.org>
cc: Nathan Chancellor <nathan@kernel.org>
cc: Nick Desaulniers <ndesaulniers@google.com>
cc: Nicolas Schier <nicolas@fjasle.eu>
cc: linux-kbuild@vger.kernel.org
---
Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/Makefile b/Makefile
index 836643eaefee..7f7c75087626 100644
--- a/Makefile
+++ b/Makefile
@@ -223,6 +223,7 @@ $(filter-out $(this-makefile), $(MAKECMDGOALS)) __all: __sub-make
# Invoke a second make in the output directory, passing relevant variables
__sub-make:
+ @echo "make[1]: Entering directory '$(abs_objtree)'"
$(Q)$(MAKE) -C $(abs_objtree) -f $(abs_srctree)/Makefile $(MAKECMDGOALS)
endif # need-sub-make
next reply other threads:[~2023-06-08 15:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-08 15:14 David Howells [this message]
2023-06-09 8:03 ` Masahiro Yamada
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2427604.1686237298@warthog.procyon.org.uk \
--to=dhowells@redhat.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=masahiroy@kernel.org \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=nicolas@fjasle.eu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®