Re: [cocci] spatch #include statements and include search path

Julia Lawall
2025-01-14T17:50:55Z

On Mon, 13 Jan 2025, Jani Nikula wrote:

> On Mon, 13 Jan 2025, Julia Lawall <julia.lawall@inria.fr> wrote:
> > On Mon, 13 Jan 2025, Jani Nikula wrote:
> >
> >> On Mon, 13 Jan 2025, Julia Lawall <julia.lawall@inria.fr> wrote:
> >> > I don't think there is any search path for .cocci files.
> >>
> >> Oh, so it's always relative to the current working directory? That's a
> >> bit of a bummer.
> >
> > It's not a well developed feature. If an include path for it would be
> > useful, we can add that.
>
> It might be. Or do you have any other ideas for reusing match rules or,
> say, "iterator name" lists, without duplicating them into all .cocci
> files?
>
> So I guess I can try working around not having include search path by
> running spatch outside of my kernel repo. Does spatch otherwise handle
> that scenario well, or any caveats there?

It should be fine. I always have my semantic patches in another place.

spatch sp.cocci linuxpath

Not sure about make coccicheck though.

julia

>
>
> BR,
> Jani.
>
>
> --
> Jani Nikula, Intel
>