[Cocci] Fwd: [~npalix/ubuntu/coccinelle/focal] coccinelle 1.0.8~20.04npalix1 (Accepted)
Hi, I released the 1.0.8 version ported to 20.04 focal on the coccinelle PPA. Regards, De: "Launchpad PPA" À: "Nicolas Palix" Envoyé: Jeudi 18 Juin 2020 20:55:16 Objet: [~npalix/ubuntu/coccinelle/focal] coccinelle 1.0.8~20.04npalix1 (Accepted) Accepted: OK: coccinelle_1.0.8~20.04npalix1.tar.xz OK: coccinelle_1.0.8~20.04npalix1.dsc -> Component: main Section: devel coccinelle (1.0.8~20.04npalix1) focal; urgency=medium * New release 1.0.8 -- https://launchpad.net/~npalix/+archive/ubuntu/coccinelle You are receiving this email because you made this upload. ___ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci
Re: [Cocci] 1.0.8 on Ubuntu
Le 05/05/2020 à 11:16, Kaspar Schleiser a écrit : Hi Nicolas, thanks for the quick reply! You're welcome. Julia, maybe it worth recording the sequence of commands somewhere, in the README or the website. On 5/5/20 10:50 AM, Nicolas Palix wrote: I think you could try the following version (intended for 20.10). https://launchpad.net/ubuntu/+source/coccinelle/1.0.8.deb-2 I managed to compile the 19.04 version (coccinelle_1.0.8~19.04npalix1.dsc, coccinelle_1.0.8~19.04npalix1.tar.xz). Somehow I missed that there's a 20.10 version. The commands were roughly: $ apt install debhelper devscripts equivs $ dpkg-source -x coccinelle_1.0.8~19.04npalix1.dsc $ cd coccinelle-1.0.8 $ mk-build-deps -i $ dpkg-buildpackage -rfakeroot -b $ apt install ../coccinelle_1.0.8~19.04npalix1_amd64.deb The resulting .deb can be installed on an otherwise clean focal:latest container. The spatch binary starts (prints help), did not do further testing. Kaspar -- Nicolas Palix http://lig-membres.imag.fr/palix/ ___ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci
Re: [Cocci] 1.0.8 on Ubuntu
Hi Kaspar, I think you could try the following version (intended for 20.10). https://launchpad.net/ubuntu/+source/coccinelle/1.0.8.deb-2 Note that there is no official Ubuntu release for 20.04. I think it due to an issue with the Python and GTK migration to newer version fixed then. Alternatively, you can also try the following commands: apt-get build-dep coccinelle apt-get source coccinelle with the PPA version or the source. Le 05/05/2020 à 10:16, Kaspar Schleiser a écrit : Hi, I'm having issues getting coccinelle into an Ubuntu container. On 9/30/19 9:43 PM, Julia Lawall wrote: For those who use Ubuntu, a PPA is available: https://launchpad.net/~npalix/+archive/ubuntu/coccinelle/+packages How can I help getting this built for Ubuntu 20.04 (Focal Fossa)? The precompiled binary links in [1] point to nonexisting files. opam seems to have issues when run within containers: [ERROR] The compilation of ocaml-system failed at "/root/.opam/opam-init/hooks/sandbox.sh build ocaml gen_ocaml_config.ml". ... # bwrap: Creating new namespace failed: Operation not permitted Kaspar [1] http://coccinelle.lip6.fr/download.php ___ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci -- Nicolas Palix http://lig-membres.imag.fr/palix/ ___ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci
Re: [Cocci] coccinelle depends on unmaintained pygtk
Le 27/02/2020 à 10:45, Julia Lawall a écrit : On Thu, 27 Feb 2020, Nicolas Palix wrote: Hi Emmanuel, Instead of porting to GObject directly, can we use PyGTKCompat ? https://wiki.gnome.org/Projects/PyGObject/PyGTKCompat The problem is resolved by removing the python file that relied on the unavailable library. I don't think that that python file is useful. It looks like python/coccilib/coccigui contains the offending files: coccigui.py, pygui.glade and pygui.gradep. But according to vimcom.py and vimembed.py, these laters also depend of GTK. Should the coccigui folder be entirely removed ? julia Regards, Le 04/02/2020 à 16:25, eamanu a écrit : Hi! On 04/02/2020 11:59, Julia Lawall wrote: On Tue, 4 Feb 2020, eamanu wrote: Hi everybody, Sorry if this issues is duplicated, I am new in the mailing list and in a very quickly searching I didn't found about this issue. I am working on Coccinelle package on Debian Thanks! and currently exist the next bug [1]. There is any plan to port to use GObject Instrospection? [1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=885267 I think we should just drop the code that depends on it. It was added for a MS thesis more than 10 years ago, and I don't think anyone has used it since. I will look into it. Great, if you need help, I can help :-) I will wait for any news. Thanks eamanu julia ___ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci -- Nicolas Palix http://lig-membres.imag.fr/palix/ -- Nicolas Palix http://lig-membres.imag.fr/palix/ ___ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci
Re: [Cocci] coccinelle depends on unmaintained pygtk
Hi Emmanuel, Instead of porting to GObject directly, can we use PyGTKCompat ? https://wiki.gnome.org/Projects/PyGObject/PyGTKCompat Regards, Le 04/02/2020 à 16:25, eamanu a écrit : Hi! On 04/02/2020 11:59, Julia Lawall wrote: On Tue, 4 Feb 2020, eamanu wrote: Hi everybody, Sorry if this issues is duplicated, I am new in the mailing list and in a very quickly searching I didn't found about this issue. I am working on Coccinelle package on Debian Thanks! and currently exist the next bug [1]. There is any plan to port to use GObject Instrospection? [1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=885267 I think we should just drop the code that depends on it. It was added for a MS thesis more than 10 years ago, and I don't think anyone has used it since. I will look into it. Great, if you need help, I can help :-) I will wait for any news. Thanks eamanu julia ___ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci -- Nicolas Palix http://lig-membres.imag.fr/palix/ ___ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci
Re: [Cocci] splitting and fingerprinting findings
Hi, Le 05/06/2019 à 21:56, Julia Lawall a écrit : On Wed, 5 Jun 2019, Enrico Weigelt, metux IT consult wrote: Hi folks, I'd like to hack up some scripts that automatically scan and report findings on a daily basis, eg. on the linux-next tree. Obviously, nobody can seriously read this all at once, especially not on a daily basis. Therefore I need to: * split the findings (eg. by ruleset or affected files / subsystems) * filter out findings that already have been reported. The second part seems to be trickiest one, as the code might slightly change in the meantime, laeding to different patch outputs. Ignoring the @@ lines should at least drop a large portion of the duplicates, but I'll yet have to see how well that works ... Did anyone else already working on that topic ? The 0-day people do something. The tool Herodotos addressed this, but seems to be hard to get working. Still maintained. ;) I have someone currently working on it to make optional a set of features that are useless for your purpose. However, I never used it on linux-next... You may also take a look at cgum/gumtree to track changes in a more finer way than diff. In general, you need to just interpret the report line numbers and the diff hunks to figure out whether the report lines are or are not in the changed lines of code. For example, if the report was on line 69 and is now on line 70, and the only change was to replace line 2-3 by lines 2-4, ie add a new line, then the report on line 70 is the same as the report on line 69. julia ___ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci -- Nicolas Palix http://lig-membres.imag.fr/palix/ ___ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci
Re: [Cocci] [PATCH] coccinelle: grep Options and Requires fields more precisely
Le 26/10/17 à 06:59, Julia Lawall a écrit : On Thu, 26 Oct 2017, Masahiro Yamada wrote: Currently, the required version for badzero.cocci is picked up from its "Comments:" line since it contains the word "Requires". Surprisingly, ld-version.sh can extract the version number from the string "Requires Coccinelle version 1.0.0-rc20 or later", but this expectation is fragile. Fix the .cocci file. I removed "-rc20" because ld-version.sh cannot handle it. OK. Make the coccicheck script to see exact patterns for "Options:" and "Requires:" in order to avoid accidental matching to what just happens to appear in comment lines. Signed-off-by: Masahiro Yamada <yamada.masah...@socionext.com> Thanks for checking on this! Acked-by: Julia Lawall <julia.law...@lip6.fr> Acked-by: Nicolas Palix <nicolas.pa...@imag.fr> --- scripts/coccicheck| 4 ++-- scripts/coccinelle/null/badzero.cocci | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/coccicheck b/scripts/coccicheck index 3e21a1b..1bfa2d2 100755 --- a/scripts/coccicheck +++ b/scripts/coccicheck @@ -168,8 +168,8 @@ OPTIONS="$OPTIONS $SPFLAGS" coccinelle () { COCCI="$1" -OPT=`grep "Option" $COCCI | cut -d':' -f2` -REQ=`grep "Requires" $COCCI | cut -d':' -f2 | sed "s| ||"` +OPT=`grep "Options:" $COCCI | cut -d':' -f2` +REQ=`grep "Requires:" $COCCI | cut -d':' -f2 | sed "s| ||"` REQ_NUM=$(echo $REQ | ${DIR}/scripts/ld-version.sh) if [ "$REQ_NUM" != "0" ] ; then if [ "$SPATCH_VERSION_NUM" -lt "$REQ_NUM" ] ; then diff --git a/scripts/coccinelle/null/badzero.cocci b/scripts/coccinelle/null/badzero.cocci index 5551da2..f597c80 100644 --- a/scripts/coccinelle/null/badzero.cocci +++ b/scripts/coccinelle/null/badzero.cocci @@ -10,7 +10,7 @@ // Copyright: (C) 2012 Julia Lawall, INRIA/LIP6. GPLv2. // Copyright: (C) 2012 Gilles Muller, INRIA/LiP6. GPLv2. // URL: http://coccinelle.lip6.fr/ -// Comments: Requires Coccinelle version 1.0.0-rc20 or later +// Requires: 1.0.0 // Options: virtual patch -- 2.7.4 -- Nicolas Palix http://lig-membres.imag.fr/palix/ smime.p7s Description: Signature cryptographique S/MIME ___ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci
Re: [Cocci] [PATCH] coccinelle: fix verbose message about .cocci file being run
Le 26/10/17 à 06:55, Masahiro Yamada a écrit : If you run coccicheck with V=1 and COCCI=, you will see a strange path to the semantic patch file. For example, run the following: $ make V=1 COCCI=scripts/coccinelle/free/kfree.cocci coccicheck [ snip ] The semantic patch that makes this report is available in scriptcoccinelle/free/kfree.cocci. Notice "s/" was dropped from "scripts/coccinelle/free/kfree.cocci". When running coccicheck without O=, $srctree is expanded to ".", which represents one arbitrary character in the regular expression. Using sed is not a good choice here. Strip $srctree/ simply without sed. Signed-off-by: Masahiro Yamada <yamada.masah...@socionext.com> Acked-by: Nicolas Palix <nicolas.pa...@imag.fr> --- scripts/coccicheck | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/coccicheck b/scripts/coccicheck index 1bfa2d2..9d18662 100755 --- a/scripts/coccicheck +++ b/scripts/coccicheck @@ -186,7 +186,7 @@ coccinelle () { if [ $VERBOSE -ne 0 -a $ONLINE -eq 0 ] ; then - FILE=`echo $COCCI | sed "s|$srctree/||"` + FILE=${COCCI#$srctree/} echo "Processing `basename $COCCI`" echo "with option(s) \"$OPT\"" -- Nicolas Palix http://lig-membres.imag.fr/palix/ smime.p7s Description: Signature cryptographique S/MIME ___ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci
Re: [Cocci] [PATCH] coccicheck: improve pattern for getting relative path
Le 10/08/17 à 19:40, Cihangir Akturk a écrit : When invoked with V=1, coccicheck script prints the information about which semantic patch (*.cocci file) used for this operation. Actually, it prints out the relative path of the related semantic patch. The script uses sed to remove the source tree part from cocci file path like so: FILE=`echo $COCCI | sed "s|$srctree/||"` This pattern works well most of the time. But in cases where $COCCI doesn't start with "./" characters, it doesn't remove the right part. Consider the following scenario: $ make coccicheck COCCI=scripts/coccinelle/api/drm-get-put.cocci \ MODE=patch M=drivers/staging V=1 where COCCI=scripts/coccinelle/api/drm-get-put.cocci and srctree=. In this case, out pattern matches the first "s/", and we end up assigning "scriptcoccinelle/api/drm-get-put.cocci" to $FILE. Fix this by adding a caret ^ at the beginning of regex pattern, so that it matches only start of the path. Signed-off-by: Cihangir Akturk <cakt...@gmail.com> Acked-by: nicolas.pa...@univ-grenoble-alpes.fr --- > scripts/coccicheck | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/coccicheck b/scripts/coccicheck index ec487b8..8de4245 100755 --- a/scripts/coccicheck +++ b/scripts/coccicheck @@ -193,7 +193,7 @@ coccinelle () { if [ $VERBOSE -ne 0 -a $ONLINE -eq 0 ] ; then - FILE=`echo $COCCI | sed "s|$srctree/||"` + FILE=`echo $COCCI | sed "s|^$srctree/||"` echo "Processing `basename $COCCI`" echo "with option(s) \"$OPT\"" -- Nicolas Palix http://lig-membres.imag.fr/palix/ smime.p7s Description: Signature cryptographique S/MIME ___ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci
Re: [Cocci] [PATCH v3 7/8] coccicheck: refer to coccicheck bottest wiki for documentation
Hi, Le 21/06/16 à 21:21, Luis R. Rodriguez a écrit : Sprinkling *tons* of documentation on the script is not a good idea, instead refer to a wiki for further coccicheck documentation: https://bottest.wiki.kernel.org/coccicheck This page shall always refer to the linux-next iteration of scripts/coccicheck. Can you say a word about Documentation/coccinelle.txt too ? And update it according to the script changes. Signed-off-by: Luis R. Rodriguez <mcg...@kernel.org> --- scripts/coccicheck | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/coccicheck b/scripts/coccicheck index 01b6716ea931..adbcbbd1aad6 100755 --- a/scripts/coccicheck +++ b/scripts/coccicheck @@ -1,9 +1,14 @@ #!/bin/bash - +# Linux kernel coccicheck +# +# For more detailed documentation refer to: +# +# https://bottest.wiki.kernel.org/coccicheck +# +# This documentation always refers to the linux-next version of the script. # # This script requires at least spatch # version 1.0.0-rc11. -# DIR="$(dirname $(readlink -f $0))/.." SPATCH="`which ${SPATCH:=spatch}`" -- Nicolas Palix http://lig-membres.imag.fr/palix/ smime.p7s Description: Signature cryptographique S/MIME ___ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci
Re: [Cocci] [PATCH v3 8/8] scripts/coccinelle: require coccinelle >= 1.0.4 on device_node_continue.cocci
Le 21/06/16 à 22:36, Julia Lawall a écrit : On Tue, 21 Jun 2016, Luis R. Rodriguez wrote: Make use of the new Requires: tag to be able to specify coccinelle binary version requirements. The cocci file device_node_continue.cocci requires at least coccinelle 1.0.4. Signed-off-by: Luis R. Rodriguez <mcg...@kernel.org> Acked-by: Julia Lawall <julia.law...@lip6.fr> Acked-by: Nicolas Palix <nicolas.pa...@imag.fr> --- scripts/coccinelle/iterators/device_node_continue.cocci | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/coccinelle/iterators/device_node_continue.cocci b/scripts/coccinelle/iterators/device_node_continue.cocci index 38ab744a4037..a36c16db171b 100644 --- a/scripts/coccinelle/iterators/device_node_continue.cocci +++ b/scripts/coccinelle/iterators/device_node_continue.cocci @@ -5,8 +5,11 @@ // Copyright: (C) 2015 Julia Lawall, Inria. GPLv2. // URL: http://coccinelle.lip6.fr/ // Options: --no-includes --include-headers +// Requires: 1.0.4 // Keywords: for_each_child_of_node, etc. +// This uses a conjunction, which requires at least coccinelle >= 1.0.4 + virtual patch virtual context virtual org -- 2.8.2 -- Nicolas Palix http://lig-membres.imag.fr/palix/ smime.p7s Description: Signature cryptographique S/MIME ___ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci
Re: [Cocci] [PATCH v3 5/8] scripts: add Linux .cocciconfig for coccinelle
Le 21/06/16 à 21:21, Luis R. Rodriguez a écrit : Help Coccinelle when used against Linux with a set of sensible defaults options for Linux. This hints to coccinelle git can be used for 'git grep' queries over coccigrep. A timeout of 200 seconds should suffice for now. If you use idutils you can override for 'make coccicheck' by using the SPFLAGS option as follows: First build the index, for example: mkid -s Pick the cocci file you wnat to work with: export COCCI=scripts/coccinelle/misc/irqf_oneshot.cocci Then run coccicheck: $ make coccicheck V=1 MODE=report SPFLAGS="--use-idutils ID" Coccinelle supports reading .cocciconfig from different directories, the later one overriding the previous reads in the following order: o Your current user's home directory is processed first o Your directory from which spatch is called is processed next o The directory provided with the --dir option is processed last, if used Signed-off-by: Luis R. Rodriguez <mcg...@kernel.org> Acked-by: Nicolas Palix <nicolas.pa...@imag.fr> --- .cocciconfig | 3 +++ .gitignore | 1 + 2 files changed, 4 insertions(+) create mode 100644 .cocciconfig diff --git a/.cocciconfig b/.cocciconfig new file mode 100644 index ..43967c6b2015 --- /dev/null +++ b/.cocciconfig @@ -0,0 +1,3 @@ +[spatch] + options = --timeout 200 + options = --use-gitgrep diff --git a/.gitignore b/.gitignore index 2be25f771bd8..c2ed4ecb0acd 100644 --- a/.gitignore +++ b/.gitignore @@ -67,6 +67,7 @@ Module.symvers # !.gitignore !.mailmap +!.cocciconfig # # Generated include files -- Nicolas Palix http://lig-membres.imag.fr/palix/ smime.p7s Description: Signature cryptographique S/MIME ___ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci
Re: [Cocci] [PATCH v3 6/8] coccicheck: add support for requring a coccinelle version
Le 21/06/16 à 21:21, Luis R. Rodriguez a écrit : Enable Coccinelle SmPL patches to require a specific version of Coccinelle. In the event that the version does not match we just inform the user, if the user asked to go through all SmPL patches we just inform them of the need for a new version of coccinelle for the SmPL patch and continue on with the rest. This uses the simple kernel scripts/ld-version.sh to create a weight on the version provided by spatch. The -dirty attribute is ignored if supplied, the benefit of scripts/ld-version.sh is it has a long history and well tested. Signed-off-by: Luis R. Rodriguez <mcg...@kernel.org> Acked-by: Nicolas Palix <nicolas.pa...@imag.fr> --- scripts/coccicheck | 14 ++ 1 file changed, 14 insertions(+) diff --git a/scripts/coccicheck b/scripts/coccicheck index 998d764636e0..01b6716ea931 100755 --- a/scripts/coccicheck +++ b/scripts/coccicheck @@ -5,6 +5,7 @@ # version 1.0.0-rc11. # +DIR="$(dirname $(readlink -f $0))/.." SPATCH="`which ${SPATCH:=spatch}`" if [ ! -x "$SPATCH" ]; then @@ -12,6 +13,9 @@ if [ ! -x "$SPATCH" ]; then exit 1 fi +SPATCH_VERSION=$($SPATCH --version | head -1 | awk '{print $3}') +SPATCH_VERSION_NUM=$(echo $SPATCH_VERSION | ${DIR}/scripts/ld-version.sh) + USE_JOBS="no" $SPATCH --help | grep "\-\-jobs" > /dev/null && USE_JOBS="yes" @@ -171,6 +175,16 @@ coccinelle () { COCCI="$1" OPT=`grep "Option" $COCCI | cut -d':' -f2` +REQ=`grep "Requires" $COCCI | cut -d':' -f2 | sed "s| ||"` +REQ_NUM=$(echo $REQ | ${DIR}/scripts/ld-version.sh) +if [ "$REQ_NUM" != "0" ] ; then + if [ "$SPATCH_VERSION_NUM" -lt "$REQ_NUM" ] ; then + echo "Skipping coccinele SmPL patch: $COCCI" + echo "You have coccinelle: $SPATCH_VERSION" + echo "This SmPL patch requires: $REQ" + return + fi +fi # The option '--parse-cocci' can be used to syntactically check the SmPL files. # -- Nicolas Palix http://lig-membres.imag.fr/palix/ smime.p7s Description: Signature cryptographique S/MIME ___ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci
Re: [Cocci] 1.0.0-rc22
Hi all, The PPA have been updated with this release. Regards, On Mon, Sep 29, 2014 at 8:04 PM, Julia Lawall julia.law...@lip6.fr wrote: Version 1.0.0-rc22 is now available. I will post a list of changes tomorrow. julia ___ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci -- Nicolas Palix Tel: +33 4 76 51 46 27 http://lig-membres.imag.fr/palix/ ___ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci
Re: [Cocci] upcoming coccinelle-related events
Hi, The early registration for LPC has been extended to August 15, 2014. Regards, On Thu, Jul 31, 2014 at 4:50 PM, Julia Lawall julia.law...@lip6.fr wrote: Linux Plumbers Conference, October 15-17, Dusseldorf Germany There will be a microconference on Development Tools. The early registration ends August 1, at a rate of $350. Regular registration is available until September 12, at a rate of $475. Student registration, available until October 14, is only $150. The conference schedule is not fixed yet, so I don't know on exactly what day the microconference will take place. http://www.linuxplumbersconf.org/2014/attend/ Tutorial on Coccinelle at SPLASH 2014, October 20-24, Portland Oregon The exact date and the registration information are not yet available. julia ___ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci -- Nicolas Palix Tel: +33 4 76 51 46 27 http://lig-membres.imag.fr/palix/ ___ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci
Re: [Cocci] Fatal error: exception Failure(no python)
Hi, On Fri, Feb 14, 2014 at 8:57 AM, 林嘉(程二 福州) lin...@ruijie.com.cn wrote: Then I found cocc can not work, it reports: Fatal error: exception Failure(no python) You get is error when spatch has not been compiled with Python support but you are still using cocci file with Python snippet. Does ' spatch --version' report python support ? Such as spatch version 1.0.0-rc15 with Python support and with PCRE support Regards, -- Nicolas Palix Tel: +33 4 76 51 46 27 http://lig-membres.imag.fr/palix/ ___ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci
Re: [Cocci] virtual rule patch not supported
Alternatively, you could use 'make coccicheck MODE=report' as every cocci file currently provide at least this mode or we could swap patch and report for the chain mode. linux $ find scripts/coccinelle -name *.cocci | wc -l 42 npalix@lig-yttrium linux $ find scripts/coccinelle -name *.cocci -exec grep -H 'virtual context' \{} \; | wc -l 36 npalix@lig-yttrium linux $ find scripts/coccinelle -name *.cocci -exec grep -H 'virtual report' \{} \; | wc -l 42 npalix@lig-yttrium linux $ find scripts/coccinelle -name *.cocci -exec grep -H 'virtual org' \{} \; | wc -l 40 npalix@lig-yttrium linux $ find scripts/coccinelle -name *.cocci -exec grep -H 'virtual patch' \{} \; | wc -l 24 On Fri, Mar 15, 2013 at 4:11 PM, Nicolas Palix nicolas.pa...@imag.fr wrote: On Fri, Mar 15, 2013 at 4:03 PM, Brice Goglin brice.gog...@inria.fr wrote: Le 15/03/2013 15:49, Nicolas Palix a écrit : Hi, On Wed, Mar 13, 2013 at 9:47 AM, Julia Lawall julia.law...@lip6.fr wrote: On Mon, 11 Mar 2013, Brice Goglin wrote: Hello, I am running the kernel 3.9-rc2 coccicheck script on some of my module, and I get the following message: virtual rule patch not supported I guess it doesn't crash? It is possible that some semantic patch just doesn't support the patch option. I don't remember if it is possible to specify several options, and to have them tried in order? That could be a nice feature. If not, I think that there is an option that tries all of the options in a fixed order. Nicolas? According to the cocci files, every coccicheck mode could not be proposed. It is indeed some time impossible to propose a bug correction because several options are available for a single bug report and the semantic patch is not designed to choose one. The current basic modes are: patch, report, context, org The 'chain' mode tries the following mode is order: patch || report || context || org. Recently, the 'rep+ctxt' mode have been added for report and context modes. If you haven't specify the mode, it defaults to chain. The patch mode is thus tried first. If it fails, coccicheck falls back to the report mode. In short, this warning is harmless ? Indeed. But you will have various kind of output. Should it be disabled in the kernel by default ? Most people that uses coccicheck in the kernel don't know much about it, and they don't write the rules directly, so they may be afraid by the warning just like me. One may improve the handling of the chain mode, and skip unavailable modes instead of falling back to the next one in case of error... Do you volunteer ? By the way, thank you for the report. Brice -- Nicolas Palix -- Nicolas Palix ___ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci
Re: [Cocci] [PATCH 2 2/2] coccicheck: Allow to show the executed command line
On Tue, Jan 29, 2013 at 5:03 PM, Bernd Schubert bernd.schub...@itwm.fraunhofer.de wrote: On my system one of the tests failed with Fatal error: exception Failure(No OCaml compiler found! Install either ocamlopt or ocamlopt.opt). Investigating such issues is easier if the executed command line is being shown. Signed-off-by: Bernd Schubert bernd.schub...@itwm.fraunhofer.de CC: Julia Lawall julia.law...@lip6.fr CC: Nicolas Palix nicolas.pa...@imag.fr Acked-by: Nicolas Palix nicolas.pa...@imag.fr CC: cocci@systeme.lip6.fr CC: Michal Marek mma...@suse.cz --- scripts/coccicheck | 28 +--- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/scripts/coccicheck b/scripts/coccicheck index f8f15a2..85d3189 100755 --- a/scripts/coccicheck +++ b/scripts/coccicheck @@ -55,6 +55,14 @@ if [ $ONLINE = 0 ] ; then echo '' fi +run_cmd() { + if [ $VERBOSE -ne 0 ] ; then + echo Running: $@ + fi + eval $@ +} + + coccinelle () { COCCI=$1 @@ -100,15 +108,21 @@ coccinelle () { fi if [ $MODE = chain ] ; then - $SPATCH -D patch $FLAGS -sp_file $COCCI $OPT $OPTIONS || \ - $SPATCH -D report $FLAGS -sp_file $COCCI $OPT $OPTIONS -no_show_diff || \ - $SPATCH -D context $FLAGS -sp_file $COCCI $OPT $OPTIONS || \ - $SPATCH -D org $FLAGS -sp_file $COCCI $OPT $OPTIONS -no_show_diff || exit 1 + run_cmd $SPATCH -D patch \ + $FLAGS -sp_file $COCCI $OPT $OPTIONS || \ + run_cmd $SPATCH -D report \ + $FLAGS -sp_file $COCCI $OPT $OPTIONS -no_show_diff || \ + run_cmd $SPATCH -D context \ + $FLAGS -sp_file $COCCI $OPT $OPTIONS || \ + run_cmd $SPATCH -D org \ + $FLAGS -sp_file $COCCI $OPT $OPTIONS -no_show_diff || exit 1 elif [ $MODE = rep+ctxt ] ; then - $SPATCH -D report $FLAGS -sp_file $COCCI $OPT $OPTIONS -no_show_diff \ - $SPATCH -D context $FLAGS -sp_file $COCCI $OPT $OPTIONS || exit 1 + run_cmd $SPATCH -D report \ + $FLAGS -sp_file $COCCI $OPT $OPTIONS -no_show_diff \ + run_cmd $SPATCH -D context \ + $FLAGS -sp_file $COCCI $OPT $OPTIONS || exit 1 else - $SPATCH -D $MODE $FLAGS -sp_file $COCCI $OPT $OPTIONS || exit 1 + run_cmd $SPATCH -D $MODE $FLAGS -sp_file $COCCI $OPT $OPTIONS || exit 1 fi } -- Nicolas Palix ___ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci