Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package gjs for openSUSE:Factory checked in 
at 2023-06-20 16:40:03
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/gjs (Old)
 and      /work/SRC/openSUSE:Factory/.gjs.new.15902 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "gjs"

Tue Jun 20 16:40:03 2023 rev:110 rq:1093707 version:1.76.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/gjs/gjs.changes  2023-06-14 16:29:26.846508071 
+0200
+++ /work/SRC/openSUSE:Factory/.gjs.new.15902/gjs.changes       2023-06-20 
16:40:11.224414972 +0200
@@ -1,0 +2,13 @@
+Thu Jun 15 07:27:19 UTC 2023 - Bjørn Lie <[email protected]>
+
+- Update to version 1.76.2:
+  + Various fixes ported from the development branch.
+  + Closed bugs and merge requests:
+    - GJS freezes, program stops responding, error states Gtk4
+      EventController GestureClick returns incorrect state-
+      Gdk.ModifierType on mouse button press in X11
+    - Caller allocated boxed types or structs are not fully
+      released
+    - Gjs console leaks invalid option errors
+
+-------------------------------------------------------------------

Old:
----
  gjs-1.76.1.tar.xz

New:
----
  gjs-1.76.2.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ gjs.spec ++++++
--- /var/tmp/diff_new_pack.U7h4HK/_old  2023-06-20 16:40:11.808418481 +0200
+++ /var/tmp/diff_new_pack.U7h4HK/_new  2023-06-20 16:40:11.812418506 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           gjs
-Version:        1.76.1
+Version:        1.76.2
 Release:        0
 Summary:        JavaScript bindings based on gobject-introspection and Mozilla
 License:        LGPL-2.0-or-later AND MIT

++++++ gjs-1.76.1.tar.xz -> gjs-1.76.2.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gjs-1.76.1/NEWS new/gjs-1.76.2/NEWS
--- old/gjs-1.76.1/NEWS 2023-06-10 16:52:39.000000000 +0200
+++ new/gjs-1.76.2/NEWS 2023-06-15 00:04:12.000000000 +0200
@@ -1,3 +1,16 @@
+Version 1.76.2
+--------------
+
+- Various fixes ported from the development branch.
+
+- Closed bugs and merge requests:
+  * GJS freezes, program stops responding, error states Gtk4 EventController
+    GestureClick returns incorrect state- Gdk.ModifierType on mouse button 
press
+    in X11 [#507, !829, !850, Sundeep Mediratta]
+  * Caller allocated boxed types or structs are not fully released [#543, !837,
+    !849, Marco Trevisan]
+  * Gjs console leaks invalid option errors [#544, !837, !849, Marco Trevisan]
+
 Version 1.76.1
 --------------
 
@@ -10,11 +23,10 @@
   * GVariant return values leaked [#499, !837, Marco Trevisan]
   * GBytes's are leaked when passed as-is to a function [#539, !837, Marco
     Trevisan]
-  * Transformated GValues are leaking temporary instances [#540, !837, Marco
+  * Transformed GValues are leaking temporary instances [#540, !837, Marco
     Trevisan]
   * GHash value infos are leaked [#541, !837, Marco Trevisan]
   * "flat" arrays of GObject's are leaked [#542, !837, Marco Trevisan]
-  * Gjs console leaks invalid option errors [#544, !837, Marco Trevisan]
   * gjs can't print null [#545, !841, Angelo Verlain]
 
 Version 1.76.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gjs-1.76.1/gi/arg-cache.cpp 
new/gjs-1.76.2/gi/arg-cache.cpp
--- old/gjs-1.76.1/gi/arg-cache.cpp     2023-06-10 16:52:39.000000000 +0200
+++ new/gjs-1.76.2/gi/arg-cache.cpp     2023-06-15 00:04:12.000000000 +0200
@@ -216,30 +216,31 @@
 };
 
 // boxed / union / GObject
-struct RegisteredType {
+struct GTypedType {
+    explicit GTypedType(GType gtype) : m_gtype(gtype) {}
+    constexpr GType gtype() const { return m_gtype; }
+
+ protected:
+    GType m_gtype;
+};
+
+struct RegisteredType : GTypedType {
     RegisteredType(GType gtype, GIInfoType info_type)
-        : m_gtype(gtype), m_info_type(info_type) {}
+        : GTypedType(gtype), m_info_type(info_type) {}
     explicit RegisteredType(GIBaseInfo* info)
-        : m_gtype(g_registered_type_info_get_g_type(info)),
+        : GTypedType(g_registered_type_info_get_g_type(info)),
           m_info_type(g_base_info_get_type(info)) {
         g_assert(m_gtype != G_TYPE_NONE &&
                  "Use RegisteredInterface for this type");
     }
 
-    constexpr GType gtype() const { return m_gtype; }
-
-    GType m_gtype;
     GIInfoType m_info_type : 5;
 };
 
-struct RegisteredInterface : BaseInfo {
+struct RegisteredInterface : BaseInfo, GTypedType {
     explicit RegisteredInterface(GIBaseInfo* info)
         : BaseInfo(info, GjsAutoTakeOwnership{}),
-          m_gtype(g_registered_type_info_get_g_type(m_info)) {}
-
-    constexpr GType gtype() const { return m_gtype; }
-
-    GType m_gtype;
+          GTypedType(g_registered_type_info_get_g_type(m_info)) {}
 };
 
 struct Callback : Nullable, BaseInfo {
@@ -715,6 +716,12 @@
     }
 };
 
+struct BoxedCallerAllocatesOut : CallerAllocatesOut, GTypedType {
+    using GTypedType::GTypedType;
+    bool release(JSContext*, GjsFunctionCallState*, GIArgument*,
+                 GIArgument*) override;
+};
+
 GJS_JSAPI_RETURN_CONVENTION
 bool NotIntrospectable::in(JSContext* cx, GjsFunctionCallState* state,
                            GIArgument*, JS::HandleValue) {
@@ -1431,6 +1438,13 @@
 }
 
 GJS_JSAPI_RETURN_CONVENTION
+bool BoxedCallerAllocatesOut::release(JSContext*, GjsFunctionCallState*,
+                                      GIArgument* in_arg, GIArgument*) {
+    g_boxed_free(m_gtype, gjs_arg_steal<void*>(in_arg));
+    return true;
+}
+
+GJS_JSAPI_RETURN_CONVENTION
 bool CallbackIn::release(JSContext*, GjsFunctionCallState*, GIArgument* in_arg,
                          GIArgument* out_arg [[maybe_unused]]) {
     ffi_closure *closure = m_ffi_closure;
@@ -2195,6 +2209,18 @@
             return;
         }
 
+        if (type_tag == GI_TYPE_TAG_INTERFACE) {
+            GjsAutoBaseInfo interface_info =
+                g_type_info_get_interface(&type_info);
+            GType gtype = g_registered_type_info_get_g_type(interface_info);
+            if (g_type_is_a(gtype, G_TYPE_BOXED)) {
+                auto* gjs_arg = 
set_argument_auto<Arg::BoxedCallerAllocatesOut>(
+                    common_args, gtype);
+                gjs_arg->m_allocates_size = size;
+                return;
+            }
+        }
+
         auto* gjs_arg = 
set_argument_auto<Arg::CallerAllocatesOut>(common_args);
         gjs_arg->m_allocates_size = size;
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gjs-1.76.1/gi/arg.cpp new/gjs-1.76.2/gi/arg.cpp
--- old/gjs-1.76.1/gi/arg.cpp   2023-06-10 16:52:39.000000000 +0200
+++ new/gjs-1.76.2/gi/arg.cpp   2023-06-15 00:04:12.000000000 +0200
@@ -65,34 +65,18 @@
                                    GjsArgumentType arg_type);
 
 bool _gjs_flags_value_is_valid(JSContext* context, GType gtype, int64_t value) 
{
-    GFlagsValue *v;
-    guint32 tmpval;
+    /* Do proper value check for flags with GType's */
+    if (gtype != G_TYPE_NONE) {
+        GjsAutoTypeClass<GFlagsClass> gflags_class(gtype);
+        uint32_t tmpval = static_cast<uint32_t>(value);
 
-    /* FIXME: Do proper value check for flags with GType's */
-    if (gtype == G_TYPE_NONE)
-        return true;
-
-    GjsAutoTypeClass<GTypeClass> klass(gtype);
-
-    /* check all bits are defined for flags.. not necessarily desired */
-    tmpval = (guint32)value;
-    if (tmpval != value) { /* Not a guint32 */
-        gjs_throw(context,
-                  "0x%" G_GINT64_MODIFIER "x is not a valid value for flags 
%s",
-                  value, g_type_name(G_TYPE_FROM_CLASS(klass)));
-        return false;
-    }
-
-    while (tmpval) {
-        v = g_flags_get_first_value(klass.as<GFlagsClass>(), tmpval);
-        if (!v) {
+        /* check all bits are valid bits for the flag and is a 32 bit flag*/
+        if ((tmpval &= gflags_class->mask) != value) { /* Not a guint32 with 
invalid mask values*/
             gjs_throw(context,
-                      "0x%x is not a valid value for flags %s",
-                      (guint32)value, g_type_name(G_TYPE_FROM_CLASS(klass)));
+                    "0x%" G_GINT64_MODIFIER "x is not a valid value for flags 
%s",
+                    value, g_type_name(gtype));
             return false;
         }
-
-        tmpval &= ~v->value;
     }
 
     return true;
@@ -2578,8 +2562,20 @@
                     gjs_arg_get<int, GI_TYPE_TAG_INTERFACE>(arg));
 
                 gtype = 
g_registered_type_info_get_g_type((GIRegisteredTypeInfo*)interface_info);
-                if (!_gjs_flags_value_is_valid(context, gtype, value_int64))
-                    return false;
+
+                if (gtype != G_TYPE_NONE) {
+                    /* check make sure 32 bit flag */
+                   if (static_cast<uint32_t>(value_int64) != value_int64) { /* 
Not a guint32 */
+                        gjs_throw(context,
+                                "0x%" G_GINT64_MODIFIER "x is not a valid 
value for flags %s",
+                                value_int64, g_type_name(gtype));
+                        return false;
+                    }
+
+                    /* Pass only valid values*/
+                    GjsAutoTypeClass<GFlagsClass> gflags_class(gtype);
+                    value_int64 &= gflags_class->mask;
+                }
 
                 value_p.setNumber(static_cast<double>(value_int64));
                 return true;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gjs-1.76.1/gjs/console.cpp 
new/gjs-1.76.2/gjs/console.cpp
--- old/gjs-1.76.1/gjs/console.cpp      2023-06-10 16:52:39.000000000 +0200
+++ new/gjs-1.76.2/gjs/console.cpp      2023-06-15 00:04:12.000000000 +0200
@@ -127,7 +127,7 @@
 check_script_args_for_stray_gjs_args(int           argc,
                                      char * const *argv)
 {
-    GError *error = NULL;
+    GjsAutoError error = NULL;
     GjsAutoStrv new_coverage_prefixes;
     GjsAutoChar new_coverage_output_path;
     GjsAutoStrv new_include_paths;
@@ -155,9 +155,9 @@
     g_option_context_set_ignore_unknown_options(script_options, true);
     g_option_context_set_help_enabled(script_options, false);
     g_option_context_add_main_entries(script_options, script_check_entries, 
NULL);
-    if (!g_option_context_parse_strv(script_options, argv_copy.out(), &error)) 
{
+    if (!g_option_context_parse_strv(script_options, argv_copy.out(),
+                                     error.out())) {
         g_warning("Scanning script arguments failed: %s", error->message);
-        g_error_free(error);
         return;
     }
 
@@ -221,7 +221,7 @@
 }
 
 int main(int argc, char** argv) {
-    GError* error = NULL;
+    GjsAutoError error;
     const char *filename;
     const char *program_name;
     gsize len;
@@ -240,7 +240,7 @@
     char** argv_copy = argv_copy_addr;
 
     g_option_context_add_main_entries(context, entries, NULL);
-    if (!g_option_context_parse_strv(context, &argv_copy, &error))
+    if (!g_option_context_parse_strv(context, &argv_copy, error.out()))
         g_error("option parsing failed: %s", error->message);
 
     /* Split options so we pass unknown ones through to the JS script */
@@ -276,7 +276,7 @@
     exec_as_module = false;
     g_option_context_set_ignore_unknown_options(context, false);
     g_option_context_set_help_enabled(context, true);
-    if (!g_option_context_parse_strv(context, &gjs_argv, &error)) {
+    if (!g_option_context_parse_strv(context, &gjs_argv, error.out())) {
         GjsAutoChar help_text =
             g_option_context_get_help(context, true, nullptr);
         g_printerr("%s\n\n%s\n", error->message, help_text.get());
@@ -319,7 +319,7 @@
         error = NULL;
         GjsAutoUnref<GFile> input = 
g_file_new_for_commandline_arg(gjs_argv[1]);
         if (!g_file_load_contents(input, nullptr, script.out(), &len, nullptr,
-                                  &error)) {
+                                  error.out())) {
             g_printerr("%s\n", error->message);
             return EXIT_FAILURE;
         }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gjs-1.76.1/installed-tests/extra/lsan.supp 
new/gjs-1.76.2/installed-tests/extra/lsan.supp
--- old/gjs-1.76.1/installed-tests/extra/lsan.supp      2023-06-10 
16:52:39.000000000 +0200
+++ new/gjs-1.76.2/installed-tests/extra/lsan.supp      2023-06-15 
00:04:12.000000000 +0200
@@ -10,3 +10,6 @@
 # https://bugzilla.mozilla.org/show_bug.cgi?id=1478679
 leak:js::coverage::LCovSource::writeScript
 leak:js/src/util/Text.cpp
+
+# GIO Module instances are created once and they're expected to be "leaked"
+leak:g_io_module_new
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gjs-1.76.1/meson.build new/gjs-1.76.2/meson.build
--- old/gjs-1.76.1/meson.build  2023-06-10 16:52:39.000000000 +0200
+++ new/gjs-1.76.2/meson.build  2023-06-15 00:04:12.000000000 +0200
@@ -2,7 +2,7 @@
 # SPDX-FileCopyrightText: 2019 Philip Chimento <[email protected]>
 # SPDX-FileCopyrightText: 2019 Chun-wei Fan <[email protected]>
 
-project('gjs', 'cpp', 'c', version: '1.76.1', license: ['MIT', 'LGPL2+'],
+project('gjs', 'cpp', 'c', version: '1.76.2', license: ['MIT', 'LGPL2+'],
     meson_version: '>= 0.54.0',
     default_options: ['cpp_std=c++17', 'cpp_rtti=false', 'c_std=c99',
         'warning_level=2', 'b_pch=true' ])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gjs-1.76.1/test/gjs-tests.cpp 
new/gjs-1.76.2/test/gjs-tests.cpp
--- old/gjs-1.76.1/test/gjs-tests.cpp   2023-06-10 16:52:39.000000000 +0200
+++ new/gjs-1.76.2/test/gjs-tests.cpp   2023-06-15 00:04:12.000000000 +0200
@@ -1012,20 +1012,20 @@
 
 static void gjstest_test_func_gjs_context_argv_array() {
     GjsAutoUnref<GjsContext> gjs = gjs_context_new();
-    GError* error = NULL;
+    GjsAutoError error;
     int status;
 
     const char* argv[1] = {"test"};
-    bool ok = gjs_context_define_string_array(gjs, "ARGV", 1, argv, &error);
+    bool ok =
+        gjs_context_define_string_array(gjs, "ARGV", 1, argv, error.out());
 
     g_assert_no_error(error);
-    g_clear_error(&error);
     g_assert_true(ok);
 
     ok = gjs_context_eval(gjs, R"js(
         imports.system.exit(ARGV[0] === "test" ? 0 : 1)
     )js",
-                          -1, "<main>", &status, &error);
+                          -1, "<main>", &status, error.out());
 
     g_assert_cmpint(status, ==, 0);
     g_assert_error(error, GJS_ERROR, GJS_ERROR_SYSTEM_EXIT);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gjs-1.76.1/test/test-ci.sh 
new/gjs-1.76.2/test/test-ci.sh
--- old/gjs-1.76.1/test/test-ci.sh      2023-06-10 16:52:39.000000000 +0200
+++ new/gjs-1.76.2/test/test-ci.sh      2023-06-15 00:04:12.000000000 +0200
@@ -48,7 +48,7 @@
         git fetch --depth=30 --no-tags upstream "$base_branch"
     fi
 
-    git branch ci-upstream-base-branch FETCH_HEAD
+    git branch -f ci-upstream-base-branch FETCH_HEAD
 
     # Work out the newest common ancestor between the detached HEAD that this 
CI
     # job has checked out, and the upstream target branch (which will typically

Reply via email to