From: Joshua Brindle <jbrindle@tresys.com>
To: Stephen Smalley <sds@tycho.nsa.gov>
Cc: Ivan Gyurdiev <ivg2@cornell.edu>, SELinux List <SELinux@tycho.nsa.gov>
Subject: Re: [SEMANAGE][UTILS] Use PyList in bindings
Date: Fri, 03 Feb 2006 09:36:29 -0500 [thread overview]
Message-ID: <43E36A6D.9060706@tresys.com> (raw)
In-Reply-To: <1138975232.18268.362.camel@moss-spartans.epoch.ncsc.mil>
Stephen Smalley wrote:
> On Thu, 2006-02-02 at 15:45 -0500, Ivan Gyurdiev wrote:
>> Okay, this patch is being the subject of controversy on IRC, so I wanted
>> to continue discussion on-list.
>>
>> It's an API change in the python bindings only, which converts out-bound
>> arrays of objects (port, iface, boolean, etc..) to a PyList, which makes
>> them easier to work with, and better integrated with the target
>> language. Also, it fixes memory leak of the list structure (otherwise we
>> have to expose free() to address that). It eliminates the need for
>> get_by_idx functions, which are not really part of the libsemanage API.
>>
>> Some problems w/ patch - it relies on some internal swig things - like
>> the output variable being called result (swig provides $result, but
>> that's in python, and I don't want to unpack it). Not sure if that's a
>> problem, I'm not sure this t_output_helper business is part of the
>> official API either. Also, swig is not very intelligent, and wants all
>> the argument names to match (despite the docs saying otherwise).
>>
>> Joshua doesn't like it..says semanage.i should be portable to other
>> languages. However, I like better integration w/ python, so I think in
>> that case maybe it makes sense to have several .i files. Also, I'm not
>> sure the .i file is language portable right now - what will happen in a
>> language that doesn't support an output vector, so adding things to
>> result w/ t_output_helper doesn't necessarily make sense?
>>
>> Also, how do I implement a binding for set_roles()? I want to unpack a
>> PyList into a char** array - requires understanding of python in the .i
>> file.
>
> Abstractly (while confessing total ignorance of swig), I would agree
> that we shouldn't cripple the python bindings for libsemanage just to
> allow a single interface file to be re-useable for other bindings. That
> said, I'm a little hesitant to merge without greater consensus and FC5
> is very close to devel freeze. Not sure what expectations are for
> stability of python bindings API...
>
I don't disagree, my points were that 1) we don't want to totally
eliminate the ability to build bindings for other languages and 2) we
don't want to make maintenance of the bindings more difficult. If the
python bindings are much better now (I'm no python developer so I don't
know what pylists give us) then I don't have a problem merging it into a
seperate .i file. I think we should reuse as much as possible so that
it's easier to maintain if we ever want to support another binding.
--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.
next prev parent reply other threads:[~2006-02-03 14:36 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-02 20:45 [SEMANAGE][UTILS] Use PyList in bindings Ivan Gyurdiev
2006-02-02 21:16 ` Ivan Gyurdiev
2006-02-03 14:00 ` Stephen Smalley
2006-02-03 14:36 ` Joshua Brindle [this message]
2006-02-14 10:59 ` Ivan Gyurdiev
2006-02-14 12:08 ` Move python bindings into semanageswig_python.i Ivan Gyurdiev
2006-02-14 18:51 ` Improve bindings, add PyList(String) for roles array Ivan Gyurdiev
2006-02-14 20:12 ` Stephen Smalley
2006-02-14 19:01 ` Move python bindings into semanageswig_python.i Stephen Smalley
2006-02-14 18:57 ` [SEMANAGE][UTILS] Use PyList in bindings Stephen Smalley
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=43E36A6D.9060706@tresys.com \
--to=jbrindle@tresys.com \
--cc=SELinux@tycho.nsa.gov \
--cc=ivg2@cornell.edu \
--cc=sds@tycho.nsa.gov \
/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.