GNOME Bugzilla – Bug 691030
Introduce a new 'posix' module
Last modified: 2015-02-07 16:47:22 UTC
This is something I noticed today. gjs has internal wrappers for these functions, but it would probably make sense to move them into a static gir. Building a home for them is better than completing the module, so I'm porting over the ones we have wrappers for in gjs.
Created attachment 232555 [details] [review] Makefile-gir: Fix indentation
Created attachment 232556 [details] [review] Add a new posix library This is for functions that can't natively be scanned, like getpid/getgid/getuid, but can easily be introspected.
Created attachment 232560 [details] [review] system: Remove getuid/getgid/getpid The system module was to be intended for functions for the language system, not for OS support. We now have the static "posix" library to wrap calls like this.
Review of attachment 232556 [details] [review]: In the big picture, we should try hard to push application API where at all possible into the GTK+ stack, not gjs. That said, it's still true of course that some APIs are really JavaScript specific of course and need to live in gjs. On these specific APIs - GCredentials already has the pid and uid. So I think the right fix here may be to port apps over to that. Does anyone actually need gid? If so we could look at adding that to GCredentials.
Review of attachment 232555 [details] [review]: Sure.
Review of attachment 232560 [details] [review]: But this needs an analysis of who is possibly using these APIs. Did you do that? From a quick grep in gnome-shell and gnome-documents, it looks like they're not used...can you think of anything else?
Review of attachment 232560 [details] [review]: They were intended to be used for PolicyKit. See: https://bugzilla.gnome.org/show_bug.cgi?id=646187
As far as I'm aware, Sushi is the only other big consumer of gjs, and it's not using this either.
(In reply to comment #7) > Review of attachment 232560 [details] [review]: > > They were intended to be used for PolicyKit. See: > > https://bugzilla.gnome.org/show_bug.cgi?id=646187 And that code is now deleted from what I can tell. So, let's go with the third patch only?
Comment on attachment 232560 [details] [review] system: Remove getuid/getgid/getpid Looks good.
It never landed.
Comment on attachment 232560 [details] [review] system: Remove getuid/getgid/getpid Attachment 232560 [details] pushed as 83e00e8 - system: Remove getuid/getgid/getpid
Attachment 232555 [details] pushed as c212cc8 - Makefile-gir: Fix indentation Thanks for the review. Your argument makes sense, so I'll WONTFIX this one.
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]