Re: NSXPCConnection not working in pyobjc

Ronald Oussoren via Pyobjc-dev <[email protected]> Tue, 24 Aug 2021 08:52:07 +0200
Newsgroups gmane.comp.python.pyobjc.devel
Message-ID <[email protected]>
--===============4265882897575089056==
Content-Type: multipart/alternative;
	boundary="Apple-Mail=_31F59230-CAFA-4E10-B5A5-80C9142E35DB"


--Apple-Mail=_31F59230-CAFA-4E10-B5A5-80C9142E35DB
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8



> On 23 Aug 2021, at 10:06, Durgaprasad Kelkar <[email protected]> =
wrote:
>=20
> Hi Ronald,
> Thanks a lot for quick response.=20
> I don=E2=80=99t have any experience of writing C extension. I have =
started learning the same.=20
> I found some blogs explaining this. They are writing .c files and then =
compiling with python setup.py install
>=20
> I can=E2=80=99t find any help to compile with Xcode clang compiler.
> Can you please help me out. Any pointers or examples would be helpful.

I=E2=80=99ve added a complete extension to the documentation =
(https://pyobjc.readthedocs.io/en/latest/notes/using-nsxpcinterface.html =
<https://pyobjc.readthedocs.io/en/latest/notes/using-nsxpcinterface.html>)=
.=20

Use =E2=80=9Cpython setup.py install=E2=80=9D to build and install the C =
extension. This should work when either Xcode or the Xcode command line =
tools are installed.

The example assumes that you only need definition in the core Cocoa =
frameworks (Foundation, AppKit), you may have to adjust the includes and =
link flags if you need definitions from other frameworks.

Ronald

>=20
>=20
> On Sat, 21 Aug 2021 at 3:33 PM, Ronald Oussoren =
<[email protected] <mailto:[email protected]>> wrote:
> Sadly enough the issue is not fixed and cannot be fixed. I=E2=80=99ve =
described the workaround in =
<https://pyobjc.readthedocs.io/en/latest/notes/using-nsxpcinterface.html =
<https://pyobjc.readthedocs.io/en/latest/notes/using-nsxpcinterface.html>>=
, that description assumes you know how to write C extensions.
>=20
> I=E2=80=99ve closed the the issue at GitHub =
(https://github.com/ronaldoussoren/pyobjc/issues/256 =
<https://github.com/ronaldoussoren/pyobjc/issues/256>) as wontfix =
because there are no public APIs that can be used to register the =
=E2=80=9Cextended method signature=E2=80=9D information needed by =
NSXPCInterface.   I have filed an issue with Apple about this, but have =
little hope that this will accomplish anything. And even if my request =
is granted this would end up in macOS 13 at the earliest.
>=20
> Ronald
>=20
>> On 20 Aug 2021, at 11:43, Durgaprasad Kelkar <[email protected] =
<mailto:[email protected]>> wrote:
>>=20
>=20
>> I am working on NSXPCConnection in Pyobjc.
>> I could not create NSXPCInterface with a protocol.
>> I referred =
https://stackoverflow.com/questions/52284089/is-it-possible-to-use-pyobjc-=
with-a-privilved-xpc-helper-tool-and-xpcinterface-a =
<https://stackoverflow.com/questions/52284089/is-it-possible-to-use-pyobjc=
-with-a-privilved-xpc-helper-tool-and-xpcinterface-a>.
>> Links given in the answers are not working.
>> Can you give latest links or code snippet for the same.
>>=20
>> Does issue =
https://bitbucket.org/ronaldoussoren/pyobjc/issues/256/enable-using-xpcint=
erface-with-protocols =
<https://bitbucket.org/ronaldoussoren/pyobjc/issues/256/enable-using-xpcin=
terface-with-protocols>. is fixed.
>>=20
>> Any help around this would be helpful.=20
>=20
>> _______________________________________________
>> Pyobjc-dev mailing list
>> [email protected] =
<mailto:[email protected]>
>> https://lists.sourceforge.net/lists/listinfo/pyobjc-dev =
<https://lists.sourceforge.net/lists/listinfo/pyobjc-dev>
>=20
>=20
> =E2=80=94
>=20
> Twitter / micro.blog: @ronaldoussoren
> Blog: https://blog.ronaldoussoren.net/ =
<https://blog.ronaldoussoren.net/>

=E2=80=94

Twitter / micro.blog: @ronaldoussoren
Blog: https://blog.ronaldoussoren.net/


--Apple-Mail=_31F59230-CAFA-4E10-B5A5-80C9142E35DB
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=utf-8

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; =
charset=3Dutf-8"></head><body style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; line-break: after-white-space;" class=3D""><br =
class=3D""><div><br class=3D""><blockquote type=3D"cite" class=3D""><div =
class=3D"">On 23 Aug 2021, at 10:06, Durgaprasad Kelkar &lt;<a =
href=3D"mailto:[email protected]" class=3D"">[email protected]</a>&gt; =
wrote:</div><br class=3D"Apple-interchange-newline"><div class=3D""><div =
class=3D""><div dir=3D"auto" class=3D"">Hi Ronald,</div></div><div =
dir=3D"auto" class=3D"">Thanks a lot for quick response.&nbsp;</div><div =
dir=3D"auto" class=3D"">I don=E2=80=99t have any experience of writing C =
extension. I have started learning the same.&nbsp;</div><div dir=3D"auto" =
class=3D"">I found some blogs explaining this. They are writing .c files =
and then compiling with python setup.py install</div><div dir=3D"auto" =
class=3D""><br class=3D""></div><div dir=3D"auto" class=3D"">I can=E2=80=99=
t find any help to compile with Xcode clang compiler.</div><div =
dir=3D"auto" class=3D"">Can you please help me out. Any pointers or =
examples would be helpful.</div></div></blockquote><div><br =
class=3D""></div>I=E2=80=99ve added a complete extension to the =
documentation (<a =
href=3D"https://pyobjc.readthedocs.io/en/latest/notes/using-nsxpcinterface=
.html" =
class=3D"">https://pyobjc.readthedocs.io/en/latest/notes/using-nsxpcinterf=
ace.html</a>).&nbsp;</div><div><br class=3D""></div><div>Use =E2=80=9Cpyth=
on setup.py install=E2=80=9D to build and install the C extension. This =
should work when either Xcode or the Xcode command line tools are =
installed.</div><div><br class=3D""></div><div>The example assumes that =
you only need definition in the core Cocoa frameworks (Foundation, =
AppKit), you may have to adjust the includes and link flags if you need =
definitions from other frameworks.</div><div><br =
class=3D""></div><div>Ronald</div><div><br =
class=3D""></div><div><blockquote type=3D"cite" class=3D""><div =
class=3D""><div dir=3D"auto" class=3D""><br class=3D""></div><div =
class=3D""><br class=3D""><div class=3D"gmail_quote"><div dir=3D"ltr" =
class=3D"">On Sat, 21 Aug 2021 at 3:33 PM, Ronald Oussoren &lt;<a =
href=3D"mailto:[email protected]" =
class=3D"">[email protected]</a>&gt; wrote:<br =
class=3D""></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 =
.8ex;border-left:1px #ccc solid;padding-left:1ex"><div =
style=3D"word-wrap:break-word;line-break:after-white-space" =
class=3D"">Sadly enough the issue is not fixed and cannot be fixed. =
I=E2=80=99ve described the workaround in &lt;<font face=3D"-apple-system, =
BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color =
Emoji, Segoe UI Emoji" class=3D""><span =
style=3D"box-sizing:border-box;color:var(--color-text-link);font-size:14px=
" class=3D""><a =
href=3D"https://pyobjc.readthedocs.io/en/latest/notes/using-nsxpcinterface=
.html" target=3D"_blank" =
class=3D"">https://pyobjc.readthedocs.io/en/latest/notes/using-nsxpcinterf=
ace.html</a></span></font>&gt;, that description assumes you know how to =
write C extensions.<div class=3D""><br class=3D""></div><div =
class=3D"">I=E2=80=99ve closed the the issue at GitHub (<a =
href=3D"https://github.com/ronaldoussoren/pyobjc/issues/256" =
target=3D"_blank" =
class=3D"">https://github.com/ronaldoussoren/pyobjc/issues/256</a>) as =
wontfix because there are no public APIs that can be used to register =
the =E2=80=9Cextended method signature=E2=80=9D information needed by =
NSXPCInterface. &nbsp; I have filed an issue with Apple about this, but =
have little hope that this will accomplish anything. And even if my =
request is granted this would end up in macOS 13 at the =
earliest.</div><div class=3D""><br class=3D""></div><div =
class=3D"">Ronald<br class=3D""><div class=3D""><br class=3D""><blockquote=
 type=3D"cite" class=3D""><div class=3D"">On 20 Aug 2021, at 11:43, =
Durgaprasad Kelkar &lt;<a href=3D"mailto:[email protected]" =
target=3D"_blank" class=3D"">[email protected]</a>&gt; wrote:</div><br =
class=3D""><div class=3D""></div></blockquote></div></div></div><div =
style=3D"word-wrap:break-word;line-break:after-white-space" =
class=3D""><div class=3D""><div class=3D""><blockquote type=3D"cite" =
class=3D""><div class=3D""><div dir=3D"auto" class=3D"">I am working on =
NSXPCConnection in Pyobjc.</div><div dir=3D"auto" class=3D"">I could not =
create NSXPCInterface with a protocol.</div><div dir=3D"auto" class=3D"">I=
 referred <a =
href=3D"https://stackoverflow.com/questions/52284089/is-it-possible-to-use=
-pyobjc-with-a-privilved-xpc-helper-tool-and-xpcinterface-a" =
target=3D"_blank" =
class=3D"">https://stackoverflow.com/questions/52284089/is-it-possible-to-=
use-pyobjc-with-a-privilved-xpc-helper-tool-and-xpcinterface-a</a>.</div><=
div dir=3D"auto" class=3D"">Links given in the answers are not =
working.</div><div dir=3D"auto" class=3D"">Can you give latest links or =
code snippet for the same.</div><div dir=3D"auto" class=3D""><br =
class=3D""></div><div dir=3D"auto" class=3D"">Does issue <a =
href=3D"https://bitbucket.org/ronaldoussoren/pyobjc/issues/256/enable-usin=
g-xpcinterface-with-protocols" target=3D"_blank" =
class=3D"">https://bitbucket.org/ronaldoussoren/pyobjc/issues/256/enable-u=
sing-xpcinterface-with-protocols</a>. is fixed.</div><div dir=3D"auto" =
class=3D""><br class=3D""></div><div dir=3D"auto" class=3D"">Any help =
around this would be =
helpful.&nbsp;</div></div></blockquote></div></div></div><div =
style=3D"word-wrap:break-word;line-break:after-white-space" =
class=3D""><div class=3D""><div class=3D""><blockquote type=3D"cite" =
class=3D""><div class=3D"">
_______________________________________________<br class=3D"">Pyobjc-dev =
mailing list<br class=3D""><a =
href=3D"mailto:[email protected]" target=3D"_blank" =
class=3D"">[email protected]</a><br class=3D""><a =
href=3D"https://lists.sourceforge.net/lists/listinfo/pyobjc-dev" =
target=3D"_blank" =
class=3D"">https://lists.sourceforge.net/lists/listinfo/pyobjc-dev</a><br =
class=3D""></div></blockquote></div></div></div><div =
style=3D"word-wrap:break-word;line-break:after-white-space" =
class=3D""><div class=3D""><br class=3D""><div class=3D"">
<div dir=3D"auto" =
style=3D"word-wrap:break-word;line-break:after-white-space" =
class=3D""><div style=3D"font-family: Helvetica; font-size: 12px; =
font-style: normal; font-variant-caps: normal; font-weight: normal; =
letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
text-decoration: none;" class=3D"">=E2=80=94</div><div =
style=3D"font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: normal; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; text-decoration: none;" class=3D""><br =
class=3D""></div><div style=3D"font-family: Helvetica; font-size: 12px; =
font-style: normal; font-variant-caps: normal; font-weight: normal; =
letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
text-decoration: none;" class=3D"">Twitter / micro.blog: =
@ronaldoussoren</div><div style=3D"font-family: Helvetica; font-size: =
12px; font-style: normal; font-variant-caps: normal; font-weight: =
normal; letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
text-decoration: none;" class=3D"">Blog: <a =
href=3D"https://blog.ronaldoussoren.net/" target=3D"_blank" =
class=3D"">https://blog.ronaldoussoren.net/</a></div></div>
</div>
<br class=3D""></div></div></blockquote></div></div>
</div></blockquote></div><br class=3D""><div class=3D"">
<div dir=3D"auto" style=3D"word-wrap: break-word; -webkit-nbsp-mode: =
space; line-break: after-white-space;" class=3D""><div =
style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: =
Helvetica; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: normal; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none;">=E2=80=94</div><div style=3D"caret-color: rgb(0, 0, 0); color: =
rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: =
normal; font-variant-caps: normal; font-weight: normal; letter-spacing: =
normal; text-align: start; text-indent: 0px; text-transform: none; =
white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none;"><br class=3D""></div><div style=3D"caret-color: =
rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; font-size: =
12px; font-style: normal; font-variant-caps: normal; font-weight: =
normal; letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; text-decoration: none;">Twitter / =
micro.blog: @ronaldoussoren</div><div style=3D"caret-color: rgb(0, 0, =
0); color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; =
font-style: normal; font-variant-caps: normal; font-weight: normal; =
letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; text-decoration: none;">Blog: <a =
href=3D"https://blog.ronaldoussoren.net/" =
class=3D"">https://blog.ronaldoussoren.net/</a></div></div>
</div>
<br class=3D""></body></html>=

--Apple-Mail=_31F59230-CAFA-4E10-B5A5-80C9142E35DB--


--===============4265882897575089056==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============4265882897575089056==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Pyobjc-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyobjc-dev

--===============4265882897575089056==--