Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 734326

Summary: sys-auth/polkit: use dev-lang/duktape instead of dev-lang/spidermonkey
Product: Gentoo Linux Reporter: Boris Faure <billiob>
Component: Current packagesAssignee: Freedesktop bugs <freedesktop-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: ab4bd, asturm, bertrand, crabbedhaloablution, flaviocamilo, gentoo, krinpaus, marcel.schilling, mgorny, ms, netbox253, nrndda, polynomial-c, sam, soprwa, spiderx, tsebrenko, voron1, xaviermiller, zlogene
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: https://gitlab.freedesktop.org/polkit/polkit/-/merge_requests/35
See Also: https://bugs.gentoo.org/show_bug.cgi?id=833122
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 833748    
Attachments: add duktape support on top of 0.120
0.120-r3 ebuild patch
0.120-r3 ebuild patch

Description Boris Faure 2020-07-28 20:33:11 UTC
Hi!
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 https://github.com/billiob/gentoo-overlay/tree/master/sys-auth/polkit
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")
     Homepage:            https://github.com/elogind/elogind
     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.

https://gitlab.freedesktop.org/polkit/polkit/-/commit/c7fc4e1b61f0fd82fc697c19c604af7e9fb291a2
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):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a5f0be7ceb05007e3a309487badb9a098b877952

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

    sys-auth/polkit: add 0.120_p20220127
    
    Now with Duktape!
    
    Closes: https://bugs.gentoo.org/833122
    Closes: https://bugs.gentoo.org/734326
    Signed-off-by: Sam James <sam@gentoo.org>

 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(-)