All of lore.kernel.org
 help / color / mirror / Atom feed
* [Cocci] Spatch fail on v1.0.2
@ 2015-09-09 18:57 Kieran Bingham
  2015-09-09 19:05 ` Julia Lawall
  2015-09-09 20:51 ` SF Markus Elfring
  0 siblings, 2 replies; 7+ messages in thread
From: Kieran Bingham @ 2015-09-09 18:57 UTC (permalink / raw)
  To: cocci

Having now updated using OPAM from earlier, my spatch no longer executes.

Has there been a change, whereby I need to adapt my patch? Or was
there a fault in the OPAM installation? or does this patch simply not
run on v.1.0.2?

Spatch available at: https://gist.github.com/kbingham/96477177dd20a72b1c2f

Run it on a linux kernel tree:

with spatch v.1.0.2 I get the following:

kbingham at CookieMonster:/opt/projects/linaro/hikey/kernel$ spatch
--linux-spacing --sp-file patches/i2c-dt.cocci . --in-place
init_defs_builtins: /home/kbingham/.opam/system/lib/coccinelle/standard.h
1115 1116
Fatal error: exception Failure("plus: parse error:
 = File "patches/i2c-dt.cocci", line 66, column 1,  charpos = 1115
    around = ')', whole content =       )
")
kbingham at CookieMonster:/opt/projects/linaro/hikey/kernel$ spatch --version
spatch version 1.0.2 with Python support and with PCRE support


However, re-installing v.1.0.0 executes fine:

kbingham at CookieMonster:/opt/projects/linaro/hikey/kernel$ spatch --version
spatch version 1.0.0-rc22 with Python support and with PCRE support

init_defs_builtins: /usr/share/coccinelle/standard.h
(ONCE) Expected tokens i2c_device_id
Skipping:./firmware/ihex2fw.c
Skipping:./arch/ia64/lib/checksum.c
... <continues>


--
Any thoughts?

Kieran

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Cocci] Spatch fail on v1.0.2
  2015-09-09 18:57 [Cocci] Spatch fail on v1.0.2 Kieran Bingham
@ 2015-09-09 19:05 ` Julia Lawall
  2015-09-09 19:11   ` Kieran Bingham
  2015-09-09 20:51 ` SF Markus Elfring
  1 sibling, 1 reply; 7+ messages in thread
From: Julia Lawall @ 2015-09-09 19:05 UTC (permalink / raw)
  To: cocci



On Wed, 9 Sep 2015, Kieran Bingham wrote:

> Having now updated using OPAM from earlier, my spatch no longer executes.
>
> Has there been a change, whereby I need to adapt my patch? Or was
> there a fault in the OPAM installation? or does this patch simply not
> run on v.1.0.2?

You have:

@ depends on driver @
identifier driver.probefunc;
identifier client;
identifier id;
@@
static int probefunc(
	struct i2c_client *client,
-	const struct i2c_device_id *id
	)
	{ ... }

You should move the trailing comma after client onto the - line.
Actually, I'm surprised that it worked in a previous version, but perhaps
Coccinelle got more strict about commas at some point.

julia

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Cocci] Spatch fail on v1.0.2
  2015-09-09 19:05 ` Julia Lawall
@ 2015-09-09 19:11   ` Kieran Bingham
  2015-09-09 19:14     ` Julia Lawall
  0 siblings, 1 reply; 7+ messages in thread
From: Kieran Bingham @ 2015-09-09 19:11 UTC (permalink / raw)
  To: cocci

On 9 September 2015 at 20:05, Julia Lawall <julia.lawall@lip6.fr> wrote:
>
>
> On Wed, 9 Sep 2015, Kieran Bingham wrote:
>
>> Having now updated using OPAM from earlier, my spatch no longer executes.
>>
>> Has there been a change, whereby I need to adapt my patch? Or was
>> there a fault in the OPAM installation? or does this patch simply not
>> run on v.1.0.2?
>
> You have:
>
> @ depends on driver @
> identifier driver.probefunc;
> identifier client;
> identifier id;
> @@
> static int probefunc(
>         struct i2c_client *client,
> -       const struct i2c_device_id *id
>         )
>         { ... }
>
> You should move the trailing comma after client onto the - line.
> Actually, I'm surprised that it worked in a previous version, but perhaps
> Coccinelle got more strict about commas at some point.

Yes, that was it, thank you.

And yes, it worked fine on the earlier version, and removed the comma
even thought I hadn't asked it to.

However, now on this version, Coccinelle is correctly moving those
lonely ) up to the probe function line  :)

Thanks again

Kieran

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Cocci] Spatch fail on v1.0.2
  2015-09-09 19:11   ` Kieran Bingham
@ 2015-09-09 19:14     ` Julia Lawall
  0 siblings, 0 replies; 7+ messages in thread
From: Julia Lawall @ 2015-09-09 19:14 UTC (permalink / raw)
  To: cocci



On Wed, 9 Sep 2015, Kieran Bingham wrote:

> On 9 September 2015 at 20:05, Julia Lawall <julia.lawall@lip6.fr> wrote:
> >
> >
> > On Wed, 9 Sep 2015, Kieran Bingham wrote:
> >
> >> Having now updated using OPAM from earlier, my spatch no longer executes.
> >>
> >> Has there been a change, whereby I need to adapt my patch? Or was
> >> there a fault in the OPAM installation? or does this patch simply not
> >> run on v.1.0.2?
> >
> > You have:
> >
> > @ depends on driver @
> > identifier driver.probefunc;
> > identifier client;
> > identifier id;
> > @@
> > static int probefunc(
> >         struct i2c_client *client,
> > -       const struct i2c_device_id *id
> >         )
> >         { ... }
> >
> > You should move the trailing comma after client onto the - line.
> > Actually, I'm surprised that it worked in a previous version, but perhaps
> > Coccinelle got more strict about commas at some point.
>
> Yes, that was it, thank you.
>
> And yes, it worked fine on the earlier version, and removed the comma
> even thought I hadn't asked it to.
>
> However, now on this version, Coccinelle is correctly moving those
> lonely ) up to the probe function line  :)

Great :)

julia

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Cocci] Spatch fail on v1.0.2
  2015-09-09 18:57 [Cocci] Spatch fail on v1.0.2 Kieran Bingham
  2015-09-09 19:05 ` Julia Lawall
@ 2015-09-09 20:51 ` SF Markus Elfring
  2015-09-11 10:47   ` Kieran Bingham
  1 sibling, 1 reply; 7+ messages in thread
From: SF Markus Elfring @ 2015-09-09 20:51 UTC (permalink / raw)
  To: cocci

> Spatch available at: https://gist.github.com/kbingham/96477177dd20a72b1c2f
> 
> Run it on a linux kernel tree:
> 
> with spatch v.1.0.2 I get the following:
> 
> kbingham at CookieMonster:/opt/projects/linaro/hikey/kernel$ spatch
> --linux-spacing --sp-file patches/i2c-dt.cocci . --in-place
> init_defs_builtins: /home/kbingham/.opam/system/lib/coccinelle/standard.h
> 1115 1116
> Fatal error: exception Failure("plus: parse error:
>  = File "patches/i2c-dt.cocci", line 66, column 1,  charpos = 1115
>     around = ')', whole content =       )
> ")
> kbingham at CookieMonster:/opt/projects/linaro/hikey/kernel$ spatch --version
> spatch version 1.0.2 with Python support and with PCRE support
> 
> 
> However, re-installing v.1.0.0 executes fine:
> 
> kbingham at CookieMonster:/opt/projects/linaro/hikey/kernel$ spatch --version
> spatch version 1.0.0-rc22 with Python support and with PCRE support

You show another interesting version comparison.

I suggest to be a bit more careful when you try this tool out installed
in a few directories in parallel.
I would expect that the command calls should reference a directory explicitly
so that potential misunderstanding can be avoided.

Do you eventually use separate test systems for the development
of semantic patch scripts?

Regards,
Markus

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Cocci] Spatch fail on v1.0.2
  2015-09-09 20:51 ` SF Markus Elfring
@ 2015-09-11 10:47   ` Kieran Bingham
  2015-09-11 10:56     ` SF Markus Elfring
  0 siblings, 1 reply; 7+ messages in thread
From: Kieran Bingham @ 2015-09-11 10:47 UTC (permalink / raw)
  To: cocci

Hi Markus,

On 9 September 2015 at 21:51, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:
>> Spatch available at: https://gist.github.com/kbingham/96477177dd20a72b1c2f
>>
>> Run it on a linux kernel tree:
>>
>> with spatch v.1.0.2 I get the following:
>>
>> kbingham at CookieMonster:/opt/projects/linaro/hikey/kernel$ spatch
>> --linux-spacing --sp-file patches/i2c-dt.cocci . --in-place
>> init_defs_builtins: /home/kbingham/.opam/system/lib/coccinelle/standard.h
>> 1115 1116
>> Fatal error: exception Failure("plus: parse error:
>>  = File "patches/i2c-dt.cocci", line 66, column 1,  charpos = 1115
>>     around = ')', whole content =       )
>> ")
>> kbingham at CookieMonster:/opt/projects/linaro/hikey/kernel$ spatch --version
>> spatch version 1.0.2 with Python support and with PCRE support
>>
>>
>> However, re-installing v.1.0.0 executes fine:
>>
>> kbingham at CookieMonster:/opt/projects/linaro/hikey/kernel$ spatch --version
>> spatch version 1.0.0-rc22 with Python support and with PCRE support
>
> You show another interesting version comparison.
>
> I suggest to be a bit more careful when you try this tool out installed
> in a few directories in parallel.
> I would expect that the command calls should reference a directory explicitly
> so that potential misunderstanding can be avoided.
>
> Do you eventually use separate test systems for the development
> of semantic patch scripts?

No, I'm simply running on my own personal development laptop.
Nothing fancy, I just did an apt-get install coccinelle to retest the
patch with the original version,
followed by an almost immediate apt-get remove coccinelle once I was
certain the patch still worked
on that version :)

I'm sticking with 1.0.2 now that Julia has highlighted that the fault
was mine in not removing the comma :)

--
Thanks for your help.

Regards

Kieran

>
> Regards,
> Markus

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Cocci] Spatch fail on v1.0.2
  2015-09-11 10:47   ` Kieran Bingham
@ 2015-09-11 10:56     ` SF Markus Elfring
  0 siblings, 0 replies; 7+ messages in thread
From: SF Markus Elfring @ 2015-09-11 10:56 UTC (permalink / raw)
  To: cocci

> I'm sticking with 1.0.2 now that Julia has highlighted that the fault
> was mine in not removing the comma :)

I find it just interesting that such a detail was discovered by your
version comparison.

There might further situations situations follow where it will be also
useful to experiment with some software versions by appropriate settings
of a few environment variables, won't it?

Regards,
Markus

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-09-11 10:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-09 18:57 [Cocci] Spatch fail on v1.0.2 Kieran Bingham
2015-09-09 19:05 ` Julia Lawall
2015-09-09 19:11   ` Kieran Bingham
2015-09-09 19:14     ` Julia Lawall
2015-09-09 20:51 ` SF Markus Elfring
2015-09-11 10:47   ` Kieran Bingham
2015-09-11 10:56     ` SF Markus Elfring

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.