Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

Fork Polkit to remove SpiderMonkey dependency

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
18 posts • Page 1 of 1
Author
Message
NTU
Apprentice
Apprentice
Posts: 187
Joined: Fri Jul 17, 2015 7:18 pm

Fork Polkit to remove SpiderMonkey dependency

  • Quote

Post by NTU » Wed Jan 30, 2019 1:43 am

Hi everyone,

I stripped out all the JavaScript code in Polkit so you don't need SpiderMonkey (removes JavaScript support) for it anymore. I just wanted your input on this one change:

Code: Select all

authority = POLKIT_BACKEND_AUTHORITY (g_object_new (POLKIT_BACKEND_TYPE_JS_AUTHORITY, NULL));
to:

Code: Select all

authority = POLKIT_BACKEND_AUTHORITY (g_object_new (POLKIT_BACKEND_TYPE_AUTHORITY, NULL));
I'm not sure if this correct, but since Polkit is the only thing that requires SpiderMonkey, and "JavaScript" and "authentication manager" don't really fit, I pulled it. I don't want SpiderMonkey on my system anyway if I can help it, the Mozilla developers say it's not an official project anyway and it's incomplete.

Original code:
https://cgit.freedesktop.org/polkit/tre ... ty.c#n1434 (top of page)

Is using POLKIT_BACKEND_TYPE_AUTHORITY right in this case?

Thank you!
Top
NTU
Apprentice
Apprentice
Posts: 187
Joined: Fri Jul 17, 2015 7:18 pm

  • Quote

Post by NTU » Fri Feb 01, 2019 6:12 am

After digging through the code more, that line is fine but now I need to figure out how to write this rule:

https://cgit.freedesktop.org/polkit/tre ... ault.rules

In Python and have Polkit use it via GObjectIntrospection.

In the documentation:

https://www.freedesktop.org/software/po ... kit.8.html

It mentions, "the libpolkit-gobject-1 library wraps the polkit D-Bus API and is usable from any C/C++ program as well as higher-level languages supporting GObjectIntrospection such as Javascript and Python" but there are no examples I can find about writing a Polkit rule in Python.

Thank you!

Edit: Polkit rules cannot be written in Python. https://lists.freedesktop.org/archives/ ... 00591.html

Edit 2: Found this: https://github.com/magcius/polkit/tree/duktape I think my best option here is to update that tree to use Duktape to 2.3.0 against latest HEAD checkout of Polkit if I want to get away from SpiderMonkey. Duktape was designed to be embedded. Polkit rules are simple and only a few lines anyway, you don't need a massive JS engine from Firefox.
Top
Oschtan
n00b
n00b
Posts: 71
Joined: Sat Dec 27, 2008 6:08 am
Location: Russia, Novosibirsk
Contact:
Contact Oschtan
Website

  • Quote

Post by Oschtan » Wed Jun 26, 2019 4:43 am

Earlier we have xulrunner compiled just for the sake of NPAPI header files. Now we compile spidermonkey just for the sake of polkit rules. Tomorrow they will say that duktape is outdated. Why is it easier if you can put the whole gentoo tree? Nobody needs anything.
Top
mike155
Advocate
Advocate
Posts: 4438
Joined: Fri Sep 17, 2010 11:33 pm
Location: Frankfurt, Germany

  • Quote

Post by mike155 » Wed Oct 09, 2019 1:12 am

You're absolutely right. Polkit and Spidermonkey are a nightmare - and it's time to get rid of them!

They say polkit is about security. But I never understood how it works or how to configure it. And a large chain of other packages depend on polkit, making it even more obscure. But obscurity doesn't mean security -- obscurity means insecurity!

I use systemd and Weston as DE. I use some KDE programs like Konsole or Kate and some GTK programs like Firefox or Thunderbird. No matter what I tried to get rid of udisks and polkit, one of those packages always pulled them back in.

Then I realized that I have to install udisks, polkit & friends, but I don't have to run them. So udisks and polkit were installed on my machine, but the daemons were disabled and they didn't run.

Today I managed to get completely rid of udisks, polkit, Spidermonkey & friends. I added the lines below to packages.provided:

Code: Select all

sys-auth/polkit-0.115-r4
sys-fs/udisks-2.8.2
sys-auth/polkit-qt-0.112.0_p20160416-r2
kde-plasma/polkit-kde-agent-5.16.5 
After that I removed those packages and ran 'emerge --depclean'. I was happy to see that udisks, polkit, Spidermonkey & friends were gone.

A few libraries were preserved, because kauth depended on some sys-auth/polkit-qt libraries. I re-emerged kauth - and the preserved libs were gone.

And now I'm happy that I have a machine without udisks, polkit and Spidermonkey - and everything works nicely. :)
Top
saski4711
Apprentice
Apprentice
Posts: 214
Joined: Thu Jun 24, 2004 8:23 am

  • Quote

Post by saski4711 » Fri Sep 18, 2020 6:10 am

any progress towards making this suitable for general usage?
Top
mirekm
Apprentice
Apprentice
User avatar
Posts: 237
Joined: Thu Feb 12, 2004 8:17 am
Location: Gliwice

  • Quote

Post by mirekm » Fri Sep 18, 2020 6:35 am

There is project using duktape instead of spidermonkey.
You can find ebuilds in pentoo overlay.
Top
Ionen
Developer
Developer
User avatar
Posts: 3014
Joined: Thu Dec 06, 2018 2:23 pm

  • Quote

Post by Ionen » Fri Sep 18, 2020 12:20 pm

mirekm wrote:There is project using duktape instead of spidermonkey.
If want to keep track of addition status for official ::gentoo see bug #734326 and the upstream PR which unfortunately seems to be a bit deadlocked right now (but still seeing interest).

On another note, ~testing =spidermonkey-78.2.0 no longer need python2.7 to build (albeit requires rust now), most other >=78 mozilla-based ebuilds "should" be moving away from the py2 dependency soon'ish as well.
Top
dmpogo
Advocate
Advocate
Posts: 3717
Joined: Thu Sep 02, 2004 9:21 pm
Location: Canada

  • Quote

Post by dmpogo » Sat Nov 07, 2020 7:47 am

Ionen wrote:
On another note, ~testing =spidermonkey-78.2.0 no longer need python2.7 to build (albeit requires rust now)
and llvm
Top
CaptainBlood
Advocate
Advocate
User avatar
Posts: 4237
Joined: Sun Jan 24, 2010 9:38 am

  • Quote

Post by CaptainBlood » Sat Nov 07, 2020 8:24 am

mirekm wrote:There is project using duktape instead of spidermonkey.
You can find ebuilds in pentoo overlay.
Just got removed: commit.
Alternatively, miramir overlay may still fit, untested here.
Thks 4 ur attention, interest & support.
USE="-* ..." in /etc/portage/make.conf here, i.e. a countermeasure to portage implicit braces, belt & diaper paradigm
LT: "I've been doing a passable imitation of the Fontana di Trevi, except my medium is mucus. Sooo much mucus. "
Top
CaptainBlood
Advocate
Advocate
User avatar
Posts: 4237
Joined: Sun Jan 24, 2010 9:38 am

  • Quote

Post by CaptainBlood » Sat Nov 07, 2020 8:26 am

Ionen wrote:
mirekm wrote:There is project using duktape instead of spidermonkey.
If want to keep track of addition status for official ::gentoo see bug #734326 and the upstream PR which unfortunately seems to be a bit deadlocked right now (but still seeing interest).

On another note, ~testing =spidermonkey-78.2.0 no longer need python2.7 to build (albeit requires rust now), most other >=78 mozilla-based ebuilds "should" be moving away from the py2 dependency soon'ish as well.

Code: Select all

* dependency graph for dev-lang/spidermonkey-68.12.0
 `--  dev-lang/spidermonkey-68.12.0  amd64 
   `--  dev-libs/icu-67.1  (>=dev-libs/icu-63.1) amd64 
   `--  dev-libs/nspr-4.29  (>=dev-libs/nspr-4.21) ~amd64 
   `--  sys-libs/readline-8.0_p4  (sys-libs/readline) amd64 
   `--  sys-libs/zlib-1.2.11-r2  (>=sys-libs/zlib-1.2.3) amd64 
   `--  dev-lang/python-2.7.18-r4  (dev-lang/python) amd64 
   `--  dev-lang/python-3.9.0  (dev-lang/python) amd64 
   `--  dev-lang/python-3.8.5  (dev-lang/python) amd64 
   `--  dev-lang/python-3.7.9  (dev-lang/python) amd64 
   `--  dev-lang/python-3.6.12  (dev-lang/python) amd64 
   `--  app-portage/elt-patches-20170815  (>=app-portage/elt-patches-20170815) amd64 
   `--  sys-devel/automake-1.16.1-r1  (>=sys-devel/automake-1.16.1) amd64 
   `--  sys-devel/automake-1.15.1-r2  (>=sys-devel/automake-1.15.1) amd64 
   `--  sys-devel/autoconf-2.13-r1  (~sys-devel/autoconf-2.13) amd64 
   `--  sys-devel/libtool-2.4.6-r6  (>=sys-devel/libtool-2.4) amd64 
[ dev-lang/spidermonkey-68.12.0 stats: packages (15), max depth (1) ]
seems the low limit here.
Thks 4 ur attention, interest & support.
USE="-* ..." in /etc/portage/make.conf here, i.e. a countermeasure to portage implicit braces, belt & diaper paradigm
LT: "I've been doing a passable imitation of the Fontana di Trevi, except my medium is mucus. Sooo much mucus. "
Top
dmpogo
Advocate
Advocate
Posts: 3717
Joined: Thu Sep 02, 2004 9:21 pm
Location: Canada

  • Quote

Post by dmpogo » Sat Nov 07, 2020 5:16 pm

I'll take python-2.7 dependency over rust+llvm+300 Mb spidermonkey-78 (versus 32Mb for 60) just to run polkit, anytime
Last edited by dmpogo on Sat Nov 07, 2020 5:26 pm, edited 1 time in total.
Top
Perfect Gentleman
Veteran
Veteran
User avatar
Posts: 1302
Joined: Sun May 18, 2014 10:16 am
Contact:
Contact Perfect Gentleman
Website

  • Quote

Post by Perfect Gentleman » Sat Nov 07, 2020 5:21 pm

it's easier to use duktape'd polkit.
Top
dmpogo
Advocate
Advocate
Posts: 3717
Joined: Thu Sep 02, 2004 9:21 pm
Location: Canada

  • Quote

Post by dmpogo » Sat Nov 07, 2020 5:29 pm

Perfect Gentleman wrote:it's easier to use duktape'd polkit.
In what sense ? I have yet to need to do anything with polkit configuration, to know what is easy or not :) (which, I may say, is impressive for a service, unless polkit does not do anything :) )
Top
Perfect Gentleman
Veteran
Veteran
User avatar
Posts: 1302
Joined: Sun May 18, 2014 10:16 am
Contact:
Contact Perfect Gentleman
Website

  • Quote

Post by Perfect Gentleman » Sat Nov 07, 2020 5:42 pm

In sense of deps and time compilation. Being using duktape'd polkit for more than a year and have no any problems with it on 2 PCs with KDE.
Top
dmpogo
Advocate
Advocate
Posts: 3717
Joined: Thu Sep 02, 2004 9:21 pm
Location: Canada

  • Quote

Post by dmpogo » Sat Nov 07, 2020 5:45 pm

Perfect Gentleman wrote:In sense of deps and time compilation. Being using duktape'd polkit for more than a year and have no any problems with it on 2 PCs with KDE.
Ok, sure.

Of course the main issue with polkit is that needs javascript at al. Such a basic service shouldn't have :( All this python-2.7 issue was minor. I was more hopeful in this patch discussion that
the original guy tried to rip the Javascript out of it, but somehow it all has fizzled down to python support.
Top
Perfect Gentleman
Veteran
Veteran
User avatar
Posts: 1302
Joined: Sun May 18, 2014 10:16 am
Contact:
Contact Perfect Gentleman
Website

  • Quote

Post by Perfect Gentleman » Sat Nov 07, 2020 5:53 pm

As for me I've Rust and LVVM as it's nearly impossible to have system without them of course if you don't use bin-packages.
Top
dmpogo
Advocate
Advocate
Posts: 3717
Joined: Thu Sep 02, 2004 9:21 pm
Location: Canada

  • Quote

Post by dmpogo » Sat Nov 07, 2020 6:03 pm

Perfect Gentleman wrote:As for me I've Rust and LVVM as it's nearly impossible to have system without them of course if you don't use bin-packages.

I have rust-bin because of a single librsvg. But not llvm. llvm was needed only for mesa, but I use nvidia-drivers, so can compile mesa without llvm. Again, rust etc is just a consequence here,
the main culprit is a need for spidermonkey in the first place.
Top
dmpogo
Advocate
Advocate
Posts: 3717
Joined: Thu Sep 02, 2004 9:21 pm
Location: Canada

  • Quote

Post by dmpogo » Thu Dec 10, 2020 5:18 am

Ionen wrote:
mirekm wrote:There is project using duktape instead of spidermonkey.
If want to keep track of addition status for official ::gentoo see bug #734326 and the upstream PR which unfortunately seems to be a bit deadlocked right now (but still seeing interest).

On another note, ~testing =spidermonkey-78.2.0 no longer need python2.7 to build (albeit requires rust now), most other >=78 mozilla-based ebuilds "should" be moving away from the py2 dependency soon'ish as well.

There is lively recent activity on your second link. Keeping fingers crossed
Top
Post Reply

18 posts • Page 1 of 1

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic