From 79c5b216c6cf013f88615a5c301cab62177c74b5 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Fri, 9 Aug 2024 14:50:57 +0800 Subject: [PATCH] jsauthority: Bump mozjs to 128 JSErrorReport::filename is now a ConstUTF8CharsZ. Invoke c_str() to get the C string. --- .github/workflows/ci.yml | 2 +- meson.build | 2 +- src/polkitbackend/polkitbackendjsauthority.cpp | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3f621e8e..2833b105 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,7 +33,7 @@ jobs: - name: Install build & test dependencies run: | - sudo dnf install -y dnf-plugins-core python3-dbusmock clang compiler-rt libasan libubsan mozjs115-devel + sudo dnf install -y dnf-plugins-core python3-dbusmock clang compiler-rt libasan libubsan mozjs128-devel sudo dnf builddep -y polkit - name: Build & test diff --git a/meson.build b/meson.build index 302c1896..a52db8db 100644 --- a/meson.build +++ b/meson.build @@ -145,7 +145,7 @@ if js_engine == 'duktape' func = 'pthread_condattr_setclock' config_data.set('HAVE_' + func.to_upper(), cc.has_function(func, prefix : '#include ')) elif js_engine == 'mozjs' - js_dep = dependency('mozjs-115') + js_dep = dependency('mozjs-128') _system = host_machine.system().to_lower() if _system.contains('freebsd') diff --git a/src/polkitbackend/polkitbackendjsauthority.cpp b/src/polkitbackend/polkitbackendjsauthority.cpp index d8a53ab0..7973c342 100644 --- a/src/polkitbackend/polkitbackendjsauthority.cpp +++ b/src/polkitbackend/polkitbackendjsauthority.cpp @@ -165,7 +165,8 @@ static void report_error (JSContext *cx, polkit_backend_authority_log (POLKIT_BACKEND_AUTHORITY (authority), LOG_LEVEL_ERROR, "%s:%u: %s", - report->filename ? report->filename : "", + report->filename ? report->filename.c_str() + : "", (unsigned int) report->lineno, report->message().c_str()); }