Skip to content

Commit

Permalink
Drop mozjs support
Browse files Browse the repository at this point in the history
It has been decided that 125 is the last polkit release with mozjs
support.  As the person who had been attempting to keep the support,
end it personally.
  • Loading branch information
xry111 authored and jrybar-rh committed Aug 26, 2024
1 parent a45a2a1 commit e0c6725
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 1,412 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,13 @@ set -o pipefail
# requires another set of tweaks to the environment

PHASE="${1:?}"
JS_ENGINE="${2:?}"
COMMON_BUILD_OPTS=(
-Dauthfw=pam
-Dexamples=true
-Dgtk_doc=true
-Dintrospection=true
-Dsession_tracking=logind
-Dtests=true
-Djs_engine="$JS_ENGINE"
)

if [[ "$PHASE" =~ ^CLANG_ ]]; then
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,12 @@ jobs:
image: registry.fedoraproject.org/fedora:latest
options: "--privileged"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.phase }}-${{ matrix.js_engine }}
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.phase }}
cancel-in-progress: true
strategy:
fail-fast: false
matrix:
phase: [BUILD_GCC, GCC, GCC_ASAN_UBSAN, BUILD_CLANG, CLANG]
js_engine: [mozjs, duktape]
steps:
- name: Repository checkout
uses: actions/checkout@v4
Expand All @@ -37,4 +36,4 @@ jobs:
sudo dnf builddep -y polkit
- name: Build & test
run: sudo --preserve-env=GITHUB_ACTIONS,CI .github/workflows/ci.sh ${{ matrix.phase }} ${{ matrix.js_engine }}
run: sudo --preserve-env=GITHUB_ACTIONS,CI .github/workflows/ci.sh ${{ matrix.phase }}
10 changes: 4 additions & 6 deletions docs/man/polkit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -636,12 +636,10 @@ polkit.Result = {
</para>

<para>
If user-provided code takes a long time to execute, an exception
will be thrown which normally results in the function being
terminated (the current limit is 15 seconds). This is used to
catch runaway scripts. If the duktape JavaScript backend is
compiled in, instead of mozjs, no exception will be thrown—the
script will be killed right away (same timeout).
If user-provided code takes a long time to execute, no exception
will be thrown and the script will be killed right away (the
current limit is 15 seconds). This is used to catch runaway
scripts.
</para>

<para>
Expand Down
15 changes: 1 addition & 14 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -123,17 +123,12 @@ gobject_dep = dependency('gobject-2.0', version: glib_req_version)

duktape_req_version = '>= 2.2.0'

js_engine = get_option('js_engine')
libs_only = get_option('libs-only')
if libs_only
js_engine = ''
else
if not libs_only
expat_dep = dependency('expat')
assert(cc.has_header('expat.h', dependencies: expat_dep), 'Can\'t find expat.h. Please install expat.')
assert(cc.has_function('XML_ParserCreate', dependencies: expat_dep), 'Can\'t find expat library. Please install expat.')
endif

if js_engine == 'duktape'
js_dep = dependency('duktape', version: duktape_req_version, required: false)
if not js_dep.found()
message('Falling back to looking for library and header...')
Expand All @@ -143,13 +138,6 @@ if js_engine == 'duktape'
thread_dep = dependency('threads')
func = 'pthread_condattr_setclock'
config_data.set('HAVE_' + func.to_upper(), cc.has_function(func, prefix : '#include <pthread.h>'))
elif js_engine == 'mozjs'
js_dep = dependency('mozjs-115')

_system = host_machine.system().to_lower()
if _system.contains('freebsd')
config_data.set('__BSD_VISIBLE', 1)
endif
endif

dbus_dep = dependency('dbus-1', required: false)
Expand Down Expand Up @@ -412,7 +400,6 @@ output += ' polkitd user: ' + polkitd_user + ' \n'
if polkitd_uid != '-'
output += ' polkitd UID: ' + polkitd_uid + ' \n'
endif
output += ' Javascript engine: ' + js_engine + '\n'
output += ' PAM support: ' + enable_pam.to_string() + '\n\n'
if libs_only
output += ' !!! Only building polkit libraries, not polkitd !!!\n\n'
Expand Down
1 change: 0 additions & 1 deletion meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,3 @@ option('introspection', type: 'boolean', value: true, description: 'Enable intro

option('gtk_doc', type: 'boolean', value: false, description: 'use gtk-doc to build documentation')
option('man', type: 'boolean', value: false, description: 'build manual pages')
option('js_engine', type: 'combo', choices: ['mozjs', 'duktape'], value: 'duktape', description: 'javascript engine')
11 changes: 3 additions & 8 deletions src/polkitbackend/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,9 @@ c_flags = [
'-DPACKAGE_SYSCONF_DIR="@0@"'.format(pk_prefix / pk_sysconfdir),
]

if js_engine == 'duktape'
sources += files('polkitbackendduktapeauthority.c')
deps += libm_dep
deps += thread_dep
elif js_engine == 'mozjs'
add_languages('cpp')
sources += files('polkitbackendjsauthority.cpp')
endif
sources += files('polkitbackendduktapeauthority.c')
deps += libm_dep
deps += thread_dep

if enable_logind
sources += files('polkitbackendsessionmonitor-systemd.c')
Expand Down
Loading

0 comments on commit e0c6725

Please sign in to comment.