From patchwork Thu Jun 8 15:14:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13272462 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D3F6AC83003 for ; Thu, 8 Jun 2023 15:16:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236822AbjFHPQB (ORCPT ); Thu, 8 Jun 2023 11:16:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236750AbjFHPQA (ORCPT ); Thu, 8 Jun 2023 11:16:00 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AAC98E2 for ; Thu, 8 Jun 2023 08:15:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686237312; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/3w9oyHcHeuXmqT1TkLSNVHo+F4uoLMw3KpXpP7tVL8=; b=eJz9M6jp0IVFHpA//yyLi2K98+f1zJf2Hu1i+n8AFwn4q7DD9er3GiRPzRc5Ul7sq3OYJZ vUZrjv/YLpAapZMjs7hD0pxw6XEPUBhQJoCtmp+iqCSlaOvtWnpLrsXBfbCy4YBgSD/4wp N+Ql+UNHDST28OT0mxLSoY/6HVd9ePU= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-398-1LtaMsEfNDKBOh9S0kPYgA-1; Thu, 08 Jun 2023 11:15:03 -0400 X-MC-Unique: 1LtaMsEfNDKBOh9S0kPYgA-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4282C3C0F424; Thu, 8 Jun 2023 15:15:00 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.182]) by smtp.corp.redhat.com (Postfix) with ESMTP id 36EF0492B00; Thu, 8 Jun 2023 15:14:59 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells To: Masahiro Yamada , Nathan Chancellor , Nick Desaulniers , Nicolas Schier 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 MIME-Version: 1.0 Content-ID: <2427603.1686237298.1@warthog.procyon.org.uk> Date: Thu, 08 Jun 2023 16:14:58 +0100 Message-ID: <2427604.1686237298@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org 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 cc: Masahiro Yamada cc: Nathan Chancellor cc: Nick Desaulniers cc: Nicolas Schier 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