Re: [PATCH v5 10/13] Makefile: copy contrib/coccinelle/*.cocci to build/

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

 



On Wed, Nov 09 2022, SZEDER Gábor wrote:

> On Tue, Nov 01, 2022 at 11:35:52PM +0100, Ævar Arnfjörð Bjarmason wrote:
>> Change the "coccinelle" rule so that we first copy the *.cocci source
>> in e.g. "contrib/coccinelle/strbuf.cocci" to
>> ".build/contrib/coccinelle/strbuf.cocci" before operating on it.
>
> After this patch the output of 'make coccicheck' looks like this:
>
>     CP contrib/coccinelle/hashmap.cocci .build/contrib/coccinelle/hashmap.cocci
>     MKDIR -p .build/.build/contrib/coccinelle/hashmap.cocci.patch
>     SPATCH .build/.build/contrib/coccinelle/hashmap.cocci.patch/upload-pack.c
>     SPATCH .build/.build/contrib/coccinelle/hashmap.cocci.patch/merge-ort-wrappers.c
>     SPATCH .build/.build/contrib/coccinelle/hashmap.cocci.patch/unpack-trees.c
>     SPATCH .build/.build/contrib/coccinelle/hashmap.cocci.patch/gpg-interface.c
>     SPATCH .build/.build/contrib/coccinelle/hashmap.cocci.patch/linear-assignment.c
>
> Notice how there is not one but two leading '.build' path components.
> Surely one would be enough :)

Oops, well spotted, I'll submit a patch on top soon to fix that...

> This also breaks 'make cocciclean':
>
>   $ make cocciclean
>   rm -f GIT-SPATCH-DEFINES
>   rm -f -r .build/contrib/coccinelle
>   rm -f contrib/coccinelle/*.cocci.patch
>   $ find .build/
>   .build/
>   .build/contrib
>   .build/.build
>   .build/.build/contrib
>   .build/.build/contrib/coccinelle
>   .build/.build/contrib/coccinelle/hashmap.cocci.patch
>   .build/.build/contrib/coccinelle/hashmap.cocci.patch/upload-pack.c
>   .build/.build/contrib/coccinelle/hashmap.cocci.patch/merge-ort-wrappers.c
>   .build/.build/contrib/coccinelle/hashmap.cocci.patch/unpack-trees.c
>   .build/.build/contrib/coccinelle/hashmap.cocci.patch/gpg-interface.c
>   .build/.build/contrib/coccinelle/hashmap.cocci.patch/linear-assignment.c

...and that, i.e. the nested .build is clearly unintended...

Aside: Now that "coccicheck" is a well-behaved (well, mostly, sans the
above) target that knows its deps etc. I wonder if it makes sense to
have it clean this at all, and just leave it for "make clean". I.e. it
should clean the worktree litter, but we could just leave the
".build/contrib/coccinelle".

Anyway, that's just a thought, and something to leave for some later
"what should we clean in .build" topic, if any. I'll make sure it rm
-rf's the right .build/ dir, and that we put stuff in it...




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux