All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Brivio <sbrivio@redhat.com>
To: Lourdes Pedrajas <lu@pplo.net>, Julia Lawall <julia.lawall@inria.fr>
Cc: outreachy-kernel@googlegroups.com
Subject: Re: [Outreachy kernel] Trying to use Coccinelle
Date: Mon, 16 Mar 2020 15:08:29 +0100	[thread overview]
Message-ID: <20200316150829.370975f2@elisabeth> (raw)
In-Reply-To: <20200313094046.GB3844@supernova>

On Fri, 13 Mar 2020 10:40:46 +0100
Lourdes Pedrajas <lu@pplo.net> wrote:

> [...]
>
> Indeed, this is all the output: (this command is run in the sources root
> directory)
> 
> make coccicheck MODE=patch J=8 M=drivers/staging/android/
> 
> Please check for false positives in the output before submitting a patch.
> When using "patch" mode, carefully review the patch before submitting it.
> 
> coccicheck failed
> Makefile:1740: recipe for target 'coccicheck' failed
> make: *** [coccicheck] Error 255

Hah, I think I got the same issue on Debian. I installed coccinelle via
opam, then:

---
$ make coccicheck MODE=report M=drivers/staging/android/

Please check for false positives in the output before submitting a patch.
When using "patch" mode, carefully review the patch before submitting it.

coccicheck failed
make: *** [Makefile:1740: coccicheck] Error 255
---

Debugging: looking at makefiles, I thought about using V=1:

---
$ make V=1 coccicheck MODE=report M=drivers/staging/android/
bash ./scripts/coccicheck

Please check for false positives in the output before submitting a patch.
When using "patch" mode, carefully review the patch before submitting it.

Processing alloc_cast.cocci
with option(s) " --no-includes --include-headers"

Message example to submit a patch:
 Remove casting the values returned by memory allocation functions
 like kmalloc, kzalloc, kmem_cache_alloc, kmem_cache_zalloc etc.

 The semantic patch that makes this report is available
 in scripts/coccinelle/api/alloc/alloc_cast.cocci.

 More information about semantic patching is available at
 http://coccinelle.lip6.fr/

Semantic patch information:
 This makes an effort to find cases of casting of values returned by
 kmalloc, kzalloc, kcalloc, kmem_cache_alloc, kmem_cache_zalloc,
 kmem_cache_alloc_node, kmalloc_node and kzalloc_node and removes
 the casting as it is not required. The result in the patch case may
 need some reformatting.

Running (4 in parallel): /home/sbrivio/.opam/default/bin/spatch -D report --no-show-diff --very-quiet --cocci-file ./scripts/coccinelle/api/alloc/alloc_cast.cocci --no-includes --include-headers --patch . --dir drivers/staging/android/ -I ./arch/x86/include -I ./arch/x86/include/generated -I ./include -I ./arch/x86/include/uapi -I ./arch/x86/include/generated/uapi -I ./include/uapi -I ./include/generated/uapi --include ./include/linux/kconfig.h --jobs 4 --chunksize 1
coccicheck failed
make: *** [Makefile:1740: coccicheck] Error 255
---

so, yeah, spatch fails, but no error (see below) isn't propagated (even
with V=1)

Julia, do you think it's worth trying to fix this? Any quick idea?

Anyway, running the spatch command by itself:

---
$ /home/sbrivio/.opam/default/bin/spatch -D report --no-show-diff --very-quiet --cocci-file ./scripts/coccinelle/api/alloc/alloc_cast.cocci --no-includes --include-headers --patch . --dir drivers/staging/android/ -I ./arch/x86/include -I ./arch/x86/include/generated -I ./include -I ./arch/x86/include/uapi -I ./arch/x86/include/generated/uapi -I ./include/uapi -I ./include/generated/uapi --include ./include/linux/kconfig.h
Py.find_library: unable to find the Python library [libpython2.7m.so returned Library not found] [/usr/bin/../lib/libpython2.7m.so returned Library not found] [libpython2.7.so returned Library not found] [/usr/bin/../lib/libpython2.7.so returned Library not found]
---

I installed libpython2.7-dev, and everything works now.

-- 
Stefano



  reply	other threads:[~2020-03-16 14:08 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-11 18:11 Trying to use Coccinelle Lourdes Pedrajas
2020-03-11 23:23 ` [Outreachy kernel] " Stefano Brivio
2020-03-13  9:40   ` Lourdes Pedrajas
2020-03-16 14:08     ` Stefano Brivio [this message]
2020-03-16 14:27       ` Julia Lawall
2020-03-16 14:36         ` Stefano Brivio
2020-03-16 14:44           ` Julia Lawall
2020-03-16 15:23             ` Stefano Brivio
2020-03-16 15:32               ` Julia Lawall
2020-03-16 15:44                 ` Stefano Brivio
2020-03-19 20:15                   ` Lourdes Pedrajas
2020-03-19 20:25                     ` Julia Lawall
2020-03-19 20:43                     ` Stefano Brivio
2020-03-19 21:30                       ` Lourdes Pedrajas
2020-03-19 21:38                         ` Julia Lawall
2020-03-19 21:47                           ` Lourdes Pedrajas
2020-03-19 21:50                             ` Julia Lawall
2020-03-19 22:06                               ` Lourdes Pedrajas
2020-03-23  0:00                                 ` Stefano Brivio

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=20200316150829.370975f2@elisabeth \
    --to=sbrivio@redhat.com \
    --cc=julia.lawall@inria.fr \
    --cc=lu@pplo.net \
    --cc=outreachy-kernel@googlegroups.com \
    /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 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.