[PATCH] pidl/Python: don't assume presence of client header

Jelmer Vernooij jelmer at samba.org
Thu Mar 12 05:28:05 MDT 2015


On Thu, Mar 12, 2015 at 11:43:45AM +0100, David Disseldorp wrote:
> On Wed, 11 Mar 2015 19:53:27 +0100, Jelmer Vernooij wrote:
> 
> > On Wed, Mar 11, 2015 at 07:39:41PM +0100, David Disseldorp wrote:
> > > As of c660845737f454713f60f01d015125b053435b2c, the PIDL Python back-end
> > > unconditionally includes the client NDR header, regardless of whether it
> > > was generated by PIDL via --client or not.
> > > 
> > > This change sees the Python back-end only include the corresponding
> > > client NDR header if PIDL is run with --client.
> > 
> > Some users of pidl run it separately for each file to generate - e.g. once with
> > --client and once with --python. Won't this break them?
> 
> Which users? I haven't been able to find such (IMO broken) use cases in
> Samba, but may be looking in the wrong place.

I think it is quite surprising behaviour - especially as you won't be
able to build the resulting C file.
> 
> Given that the initial regression was introduced to fix warnings in the
> generated code, I'm not so sure it'd cause breakage.

What is the use case you're trying to address?

The correct fix is to only include the header file if there were
any calls generated that use the client code. You could do this by
checking for the number of functions in the interfaces beforehand.

Cheers,

Jelmer


More information about the samba-technical mailing list