[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] xen/build: Fix `make cscope` rune


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 16 Dec 2021 15:00:29 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=8UE9ysZnnZMtzNOvo68CEBc6e1obdUMxjlIfpT34rqQ=; b=ciKovPzCI8sk2RGEK/8yQ5PSWO8naF6bTwLm2YRX+0LHAI9WP/zG+fCtDNleHaOsYupDkdxxHMdZrqlCNU+C8M2D5FryvR805HOz8+i88IQ5bxCQLQJbALc51YiMGa6l2MJaCbDeBTnt2zL0buLYWERS2kRZjKOOFHq6fMPwg4hHCs5IgCcDjAENcrmCkXECLzuKd1+fSnaBG+9rMIolAFj9k3xLZojJPrLDdYU7rMSrRncxE/Qql/pgfbJUFWG6R648xGO3d5mxnkQbVTcHl9zmsMh9nt5M+/qhYzoQVCHhUhL1m6AZsuQPgEX1ABMvMc1v04KBwLznUhqPk5edcQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JxAA4Siv8aY9nK7C3eSJAvJfpcT78kPwYkJMch0XRiOwOi21eWoDwgYPIQ41xBL7zNyTcCcjQcxfZ36QaloQWEvX1dG3BlGIhcsxgD91na8qF7W9UKwMO/U0lGbQed3mEZEGSohILFgKNmzAyAQs1Gc3PDcaG18GovN8EWAIbRJgCGAikFBFzqV5J8DsoeboFp5Sjnm17IRn/xlpmYgSJAY47tLZILrNeBgNAKsskfk15v1N38lgIcUE2W6vP769XC06QZRUmLSB5O9CAvZ9pQbx2ZAT3Ah+5N9JbeDKv582yn9E2Qu4UUaCcu7oIbf4Nzog33zudxCq6FZDwT4f1w==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Anthony PERARD <anthony.perard@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 16 Dec 2021 14:00:53 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 16.12.2021 10:20, Andrew Cooper wrote:
> There are two problems, both in the all_sources definition.
> 
> First, everything in arch/*/include gets double hits with cscope queries,
> because they end up getting listed twice in cscope.files.
> 
> Drop the first `find` rune of the three, because it's redundant with the third
> rune following c/s 725381a5eab3 ("xen: move include/asm-* to
> arch/*/include/asm").

I'm certainly fine with this part.

> Second, and this way for a long time:
> 
>   $ make cscope
>   ( find arch/x86/include -name '*.h' -print; find include -name '*.h' -print;
>   find xsm arch/x86 common drivers lib test -name '*.[chS]' -print ) >
>   cscope.files
>   cscope -k -b -q
>   cscope: cannot find file arch/x86/efi/efi.h
>   cscope: cannot find file arch/x86/efi/ebmalloc.c
>   cscope: cannot find file arch/x86/efi/compat.c
>   cscope: cannot find file arch/x86/efi/pe.c
>   cscope: cannot find file arch/x86/efi/boot.c
>   cscope: cannot find file arch/x86/efi/runtime.c
> 
> This is caused by these being symlinks to common/efi.  Restrict all find runes
> to `-type f` to skip symlinks, because common/efi/*.c are already listed.

I have reservations here, albeit of theoretical nature as long as only
the csope target is affected (simply because I don't use it): Make
rules should really be independent of a dir entry being a real file or
a symlink. I did run into problems with that already years ago when
the shim was introduced. My arrangements heavily use symlinking, and
any assumption on files being "real" ones will break this. At the very
least symlink checks should be restricted to cover only relative ones;
ideally one would distinguish ones staying within the tree vs ones
reaching to the "outside".

> --- a/xen/Makefile
> +++ b/xen/Makefile
> @@ -468,9 +468,8 @@ arch/$(TARGET_ARCH)/include/asm/asm-offsets.h: 
> asm-offsets.s
>  
>  SUBDIRS = xsm arch/$(TARGET_ARCH) common drivers lib test
>  define all_sources
> -    ( find arch/$(TARGET_ARCH)/include -name '*.h' -print; \
> -      find include -name '*.h' -print; \
> -      find $(SUBDIRS) -name '*.[chS]' -print )
> +    ( find include -type f -name '*.h' -print; \
> +      find $(SUBDIRS) -type f -name '*.[chS]' -print )
>  endef

I further wonder how use of $(TARGET_ARCH) can be correct here. Why
would the enumeration of items here be limited to a particular arch?
When you edit files in the source tree, everything should be covered.
Restriction to a particular arch only makes sense in a build tree.

Jan




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.