Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 734326 - sys-auth/polkit: use dev-lang/duktape instead of dev-lang/spidermonkey
Summary: sys-auth/polkit: use dev-lang/duktape instead of dev-lang/spidermonkey
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 4 votes (vote)
Assignee: Freedesktop bugs
: 829289 (view as bug list)
Depends on:
Blocks: 833748
  Show dependency tree
Reported: 2020-07-28 20:33 UTC by Boris Faure
Modified: 2022-05-05 22:32 UTC (History)
20 users (show)

See Also:
Package list:
Runtime testing required: ---

add duktape support on top of 0.120 (polkit-0.120-duktape-support.patch,126.83 KB, text/plain)
2022-01-27 11:07 UTC, Fab
0.120-r3 ebuild patch (add-duktape-support.patch,1.27 KB, text/plain)
2022-01-27 11:08 UTC, Fab
0.120-r3 ebuild patch (add-duktape-support.patch,1.24 KB, text/plain)
2022-01-27 11:29 UTC, Fab

Note You need to log in before you can comment on or make changes to this bug.
Description Boris Faure 2020-07-28 20:33:11 UTC
In order to no longer have python2.7, I've used the patch found on bug #698910 to replace spidermonkey with duktape.
I've been using that patch since late april without issue.
The patch can also be found in my overlay at
Comment 1 Andreas Sturmlechner gentoo-dev 2020-07-29 08:01:25 UTC
Get it upstream and Gentoo can depend on it.
Comment 2 MW 2020-09-21 19:14:16 UTC
Works here.
Comment 3 Michael 2020-09-22 10:40:32 UTC
With a small change s/mozjs-60/mozjs-78/ the patch works for polkit-0.118 too.
Comment 4 Reva Denis 2020-10-21 04:27:19 UTC
Vote for that bug. Spidermonkey is just enormous engine to be included in server.
Comment 5 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2020-10-21 07:16:23 UTC
To be honest, I suppose even killing javascript entirely and hardcoding the default polkit rule would work for the majority of users.  For one, I don't have any other rules installed.

Maybe I should fork it into polkit-shim one day.
Comment 6 tt_1 2020-10-23 13:04:16 UTC
The whole of spidermonkey is a bit of an overkill on weak machines, allowing users to choose duktape over the whole spidermonkey + rust + llvm chain would be great. But please don't fully switch over to duktape, at least not before propper testing. I've already tried the pending upstream patch with 0.117 and it didn't fully work for me.
Comment 7 Reva Denis 2020-10-23 14:06:54 UTC
> tt_1 
So think I

> Mgorny

I have removed polkit entirely on my production server (disabled in elogind). Just because any user should not perform server control actions.

RarogCmexDell ~ # LC_ALL=C eix elogind
[I] sys-auth/elogind
     Available versions:  243.7 {+acl debug doc +pam +policykit selinux KERNEL="linux"}
     Installed versions:  243.7(10:51:52 10/18/20)(acl pam -debug -doc -policykit -selinux KERNEL="linux")
     Description:         The systemd project's logind, extracted to a standalone package
Comment 8 Mike Gilbert gentoo-dev 2020-10-23 14:42:19 UTC
I am closing this as an upstream issue. Feel free to notify us if/when it gets accepted there.
Comment 9 Mike Gilbert gentoo-dev 2021-12-15 21:34:51 UTC
*** Bug 829289 has been marked as a duplicate of this bug. ***
Comment 10 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2022-01-25 10:03:30 UTC
Reopening. Upstream has merged duktape support into polkit. It's now optional and consumers can decide whether to use duktape or spidermonkey.
Comment 11 Fab 2022-01-27 11:07:11 UTC
Created attachment 763734 [details]
add duktape support on top of 0.120

Patch coming from upstream.
Comment 12 Fab 2022-01-27 11:08:45 UTC
Created attachment 763739 [details]
0.120-r3 ebuild patch

Upgraded from 0.116-r3 to 0.120-r3 here without problem.
Comment 13 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2022-01-27 11:20:00 UTC
This part can be improved:

  $(usex duktape '-Djs_engine=duktape' '-Djs_engine=mozjs')

make it

  -Djs_engine="$(usex duktape duktape mozjs)"
Comment 14 Fab 2022-01-27 11:29:00 UTC
Created attachment 763740 [details]
0.120-r3 ebuild patch

v2, thanks.
Comment 15 Mike Gilbert gentoo-dev 2022-02-02 18:26:47 UTC
Thanks for working on this.

The patch adding duktape support is too large to be distributed via FILESDIR.

We should probably add a snapshot version bump instead of patching this in anyway.
Comment 16 Larry the Git Cow gentoo-dev 2022-02-19 02:04:10 UTC
The bug has been closed via the following commit(s):

commit a5f0be7ceb05007e3a309487badb9a098b877952
Author:     Sam James <>
AuthorDate: 2022-02-19 01:56:05 +0000
Commit:     Sam James <>
CommitDate: 2022-02-19 02:03:44 +0000

    sys-auth/polkit: add 0.120_p20220127
    Now with Duktape!
    Signed-off-by: Sam James <>

 profiles/arch/alpha/package.use.force         |   6 +-
 profiles/arch/hppa/package.use.force          |   6 ++
 profiles/arch/ia64/package.use.force          |   6 +-
 profiles/arch/powerpc/ppc32/package.use.force |   6 ++
 profiles/arch/sparc/package.use.force         |   6 +-
 sys-auth/polkit/Manifest                      |   1 +
 sys-auth/polkit/metadata.xml                  |   1 +
 sys-auth/polkit/polkit-0.120_p20220127.ebuild | 123 ++++++++++++++++++++++++++
 8 files changed, 152 insertions(+), 3 deletions(-)