diff options
-rw-r--r-- | NEWS | 44 | ||||
-rw-r--r-- | examples/clutter.js | 25 | ||||
-rw-r--r-- | gi/arg-cache.cpp | 2 | ||||
-rw-r--r-- | gi/arg.cpp | 56 | ||||
-rw-r--r-- | gi/function.cpp | 39 | ||||
-rw-r--r-- | gi/function.h | 9 | ||||
-rw-r--r-- | gi/object.cpp | 52 | ||||
-rw-r--r-- | gi/value.cpp | 11 | ||||
-rw-r--r-- | gjs/context.cpp | 9 | ||||
-rw-r--r-- | gjs/jsapi-util-string.cpp | 3 | ||||
-rw-r--r-- | gjs/module.cpp | 5 | ||||
-rw-r--r-- | gjs/profiler.cpp | 4 | ||||
-rw-r--r-- | installed-tests/js/testGIMarshalling.js | 11 | ||||
-rw-r--r-- | installed-tests/js/testGObjectInterface.js | 14 | ||||
-rw-r--r-- | installed-tests/js/testRegress.js | 2 | ||||
-rw-r--r-- | meson.build | 2 | ||||
-rw-r--r-- | modules/script/package.js | 28 | ||||
-rwxr-xr-x | test/test-ci.sh | 4 | ||||
-rw-r--r-- | tools/package.json | 4 | ||||
-rw-r--r-- | tools/yarn.lock | 80 |
20 files changed, 246 insertions, 158 deletions
@@ -1,3 +1,47 @@ +Version 1.72.0 +-------------- + +- No changes from release candidate 1.71.90. + +Version 1.70.2 +-------------- + +- Build and compatibility fixes backported from the development branch. + +- Closed bugs and merge requests: + * package: Reverse order of running-from-source checks [!734, Philip Chimento] + +- Fix build error on Darwin [Evan Miller] + +Version 1.68.6 +-------------- + +- Build and compatibility fixes backported from the development branch. + +- Closed bugs and merge requests: + * package: Reverse order of running-from-source checks [!734, Philip Chimento] + +- Fix build error on Darwin [Evan Miller] + +Version 1.71.90 +--------------- + +- Closed bugs and merge requests: + * Cairo test broken with commit ea52cf92 [#461, !724, Philip Chimento] + * native: Convert to singleton class [!725, Nasah Kuma] + * Checking `instanceof` for primitive types may lead to a crash or error + [#464, !726, Marco Trevisan] + * Change the GObject Introspection development branch [!727, Emmanuele Bassi] + * gi_marshalling_tests_long_in_max test fails on i686 [#462, !728, Philip + Chimento, Evan Welsh] + * GNOME Shell crashes at startup with the AppIndicator extension enabled + [#466, !729, Marco Trevisan] + * Instances of classes implementing interfaces can override functions for all + implementations of an interface [#467, !730, Evan Welsh] + * package: Reverse order of running-from-source checks [!734, Philip Chimento] + * Various maintenance [!735, Philip Chimento] + * Various maintenance [!736, Evan Welsh] + Version 1.71.1 -------------- diff --git a/examples/clutter.js b/examples/clutter.js deleted file mode 100644 index a9886cb0..00000000 --- a/examples/clutter.js +++ /dev/null @@ -1,25 +0,0 @@ -// SPDX-License-Identifier: MIT OR LGPL-2.0-or-later -// SPDX-FileCopyrightText: 2008 litl, LLC - -const Clutter = imports.gi.Clutter; - -Clutter.init(null); - -const stage = new Clutter.Stage({visible: true}); - -let texture = new Clutter.Texture({ - filename: 'test.jpg', - reactive: true, -}); - -texture.connect('button-press-event', () => { - log('Clicked!'); - return Clutter.EVENT_STOP; -}); - -const [, color] = Clutter.Color.from_string('Black'); -stage.background_color = color; - -stage.add_child(texture); - -Clutter.main(); diff --git a/gi/arg-cache.cpp b/gi/arg-cache.cpp index 83c4ad4d..177f246f 100644 --- a/gi/arg-cache.cpp +++ b/gi/arg-cache.cpp @@ -826,7 +826,7 @@ GJS_JSAPI_RETURN_CONVENTION bool CallbackIn::in(JSContext* cx, GjsFunctionCallState* state, GIArgument* arg, JS::HandleValue value) { GjsCallbackTrampoline* trampoline; - ffi_closure* closure; + void* closure; if (value.isNull() && m_nullable) { closure = nullptr; @@ -263,11 +263,8 @@ GJS_JSAPI_RETURN_CONVENTION static bool gjs_array_to_g_list( const GjsAtoms& atoms = GjsContextPrivate::atoms(cx); JS::RootedObject array_obj(cx, &value.toObject()); - if (!JS_HasPropertyById(cx, array_obj, atoms.length(), &found_length)) { - throw_invalid_argument(cx, value, type_info, arg_name, arg_type); + if (!JS_HasPropertyById(cx, array_obj, atoms.length(), &found_length)) return false; - } - if (!found_length) { throw_invalid_argument(cx, value, type_info, arg_name, arg_type); return false; @@ -339,13 +336,10 @@ GJS_JSAPI_RETURN_CONVENTION static bool gjs_array_to_g_list( } [[nodiscard]] static GHashTable* create_hash_table_for_key_type( - GITypeInfo* key_param_info) { + GITypeTag key_type) { /* Don't use key/value destructor functions here, because we can't * construct correct ones in general if the value type is complex. * Rely on the type-aware g_argument_release functions. */ - - GITypeTag key_type = g_type_info_get_tag(key_param_info); - if (key_type == GI_TYPE_TAG_UTF8 || key_type == GI_TYPE_TAG_FILENAME) return g_hash_table_new(g_str_hash, g_str_equal); return g_hash_table_new(NULL, NULL); @@ -375,16 +369,12 @@ GJS_JSAPI_RETURN_CONVENTION static bool hashtable_int_key( * possible, otherwise giving the location of an allocated key in @pointer_out. */ GJS_JSAPI_RETURN_CONVENTION -static bool -value_to_ghashtable_key(JSContext *cx, - JS::HandleValue value, - GITypeInfo *type_info, - gpointer *pointer_out) -{ - GITypeTag type_tag = g_type_info_get_tag((GITypeInfo*) type_info); +static bool value_to_ghashtable_key(JSContext* cx, JS::HandleValue value, + GITypeTag type_tag, void** pointer_out) { bool unsupported = false; - g_return_val_if_fail(value.isString() || value.isInt32(), false); + g_assert((value.isString() || value.isInt32()) && + "keys from JS_Enumerate must be non-symbol property keys"); gjs_debug_marshal(GJS_DEBUG_GFUNCTION, "Converting JS::Value to GHashTable key %s", @@ -536,8 +526,9 @@ static bool gjs_object_to_g_hash(JSContext* context, JS::HandleObject props, if (!JS_Enumerate(context, props, &ids)) return false; + GITypeTag key_tag = g_type_info_get_tag(key_param_info); GjsAutoPointer<GHashTable, GHashTable, g_hash_table_destroy> result = - create_hash_table_for_key_type(key_param_info); + create_hash_table_for_key_type(key_tag); JS::RootedValue key_js(context), val_js(context); JS::RootedId cur_id(context); @@ -548,8 +539,7 @@ static bool gjs_object_to_g_hash(JSContext* context, JS::HandleObject props, if (!JS_IdToValue(context, cur_id, &key_js) || // Type check key type. - !value_to_ghashtable_key(context, key_js, key_param_info, - &key_ptr) || + !value_to_ghashtable_key(context, key_js, key_tag, &key_ptr) || !JS_GetPropertyById(context, props, cur_id, &val_js) || // Type check and convert value to a C type !gjs_value_to_g_argument(context, val_js, val_param_info, nullptr, @@ -685,18 +675,11 @@ gjs_array_to_strv(JSContext *context, } GJS_JSAPI_RETURN_CONVENTION -static bool -gjs_string_to_intarray(JSContext *context, - JS::HandleString str, - GITypeInfo *param_info, - void **arr_p, - size_t *length) -{ - GITypeTag element_type; +static bool gjs_string_to_intarray(JSContext* context, JS::HandleString str, + GITypeTag element_type, void** arr_p, + size_t* length) { char16_t *result16; - element_type = g_type_info_get_tag(param_info); - switch (element_type) { case GI_TYPE_TAG_INT8: case GI_TYPE_TAG_UINT8: { @@ -1120,19 +1103,24 @@ bool gjs_array_to_explicit_array(JSContext* context, JS::HandleValue value, } else if (value.isString()) { /* Allow strings as int8/uint8/int16/uint16 arrays */ JS::RootedString str(context, value.toString()); - if (!gjs_string_to_intarray(context, str, param_info, contents, length_p)) + GITypeTag element_tag = g_type_info_get_tag(param_info); + if (!gjs_string_to_intarray(context, str, element_tag, contents, length_p)) return false; } else { JS::RootedObject array_obj(context, &value.toObject()); - const GjsAtoms& atoms = GjsContextPrivate::atoms(context); GITypeTag element_type = g_type_info_get_tag(param_info); if (JS_IsUint8Array(array_obj) && (element_type == GI_TYPE_TAG_INT8 || element_type == GI_TYPE_TAG_UINT8)) { GBytes* bytes = gjs_byte_array_get_bytes(array_obj); *contents = g_bytes_unref_to_data(bytes, length_p); - } else if (JS_HasPropertyById(context, array_obj, atoms.length(), - &found_length) && - found_length) { + return true; + } + + const GjsAtoms& atoms = GjsContextPrivate::atoms(context); + if (!JS_HasPropertyById(context, array_obj, atoms.length(), + &found_length)) + return false; + if (found_length) { guint32 length; if (!gjs_object_require_converted_property( diff --git a/gi/function.cpp b/gi/function.cpp index 716acc8e..5c4fa4a2 100644 --- a/gi/function.cpp +++ b/gi/function.cpp @@ -640,8 +640,13 @@ GjsCallbackTrampoline::GjsCallbackTrampoline( } GjsCallbackTrampoline::~GjsCallbackTrampoline() { - if (m_info && m_closure) + if (m_info && m_closure) { +#if GI_CHECK_VERSION(1, 71, 0) + g_callable_info_destroy_closure(m_info, m_closure); +#else g_callable_info_free_closure(m_info, m_closure); +#endif + } } void GjsCallbackTrampoline::mark_forever() { @@ -652,6 +657,23 @@ void GjsCallbackTrampoline::prepare_shutdown() { s_forever_closure_list.clear(); } +ffi_closure* GjsCallbackTrampoline::create_closure() { + auto callback = [](ffi_cif*, void* result, void** ffi_args, void* data) { + auto** args = reinterpret_cast<GIArgument**>(ffi_args); + g_assert(data && "Trampoline data is not set"); + Gjs::Closure::Ptr trampoline(static_cast<GjsCallbackTrampoline*>(data), + GjsAutoTakeOwnership()); + + trampoline.as<GjsCallbackTrampoline>()->callback_closure(args, result); + }; + +#if GI_CHECK_VERSION(1, 71, 0) + return g_callable_info_create_closure(m_info, &m_cif, callback, this); +#else + return g_callable_info_prepare_closure(m_info, &m_cif, callback, this); +#endif +} + bool GjsCallbackTrampoline::initialize() { g_assert(is_valid()); g_assert(!m_closure); @@ -720,20 +742,7 @@ bool GjsCallbackTrampoline::initialize() { } } - m_closure = g_callable_info_prepare_closure( - m_info, &m_cif, - [](ffi_cif*, void* result, void** ffi_args, void* data) { - auto** args = reinterpret_cast<GIArgument**>(ffi_args); - g_assert(data && "Trampoline data is not set"); - Gjs::Closure::Ptr trampoline( - static_cast<GjsCallbackTrampoline*>(data), - GjsAutoTakeOwnership()); - - trampoline.as<GjsCallbackTrampoline>()->callback_closure(args, - result); - }, - this); - + m_closure = create_closure(); return true; } diff --git a/gi/function.h b/gi/function.h index a6e9b82d..799c1490 100644 --- a/gi/function.h +++ b/gi/function.h @@ -49,13 +49,20 @@ struct GjsCallbackTrampoline : public Gjs::Closure { ~GjsCallbackTrampoline(); - constexpr ffi_closure* closure() const { return m_closure; } + void* closure() const { +#if GI_CHECK_VERSION(1, 71, 0) + return g_callable_info_get_closure_native_address(m_info, m_closure); +#else + return m_closure; +#endif + } void mark_forever(); static void prepare_shutdown(); private: + ffi_closure* create_closure(); GJS_JSAPI_RETURN_CONVENTION bool initialize(); GjsCallbackTrampoline(JSContext* cx, JS::HandleFunction function, GICallableInfo* callable_info, GIScopeType scope, diff --git a/gi/object.cpp b/gi/object.cpp index 4c5a9efd..6c85631c 100644 --- a/gi/object.cpp +++ b/gi/object.cpp @@ -18,7 +18,6 @@ #include <utility> // for move #include <vector> -#include <ffi.h> #include <girepository.h> #include <glib-object.h> #include <glib.h> @@ -34,6 +33,8 @@ #include <js/MemoryFunctions.h> // for AddAssociatedMemory, RemoveAssoci... #include <js/Object.h> #include <js/PropertyDescriptor.h> // for JSPROP_PERMANENT, JSPROP_READONLY +#include <js/String.h> +#include <js/Symbol.h> #include <js/TypeDecls.h> #include <js/Utility.h> // for UniqueChars #include <js/Value.h> @@ -662,11 +663,32 @@ static bool interface_getter(JSContext* cx, unsigned argc, JS::Value* vp) { const GjsAtoms& atoms = GjsContextPrivate::atoms(cx); // Check if an override value has been set - bool has_override = false; - if (!JS_HasPropertyById(cx, accessor, atoms.override(), &has_override)) + bool has_override_symbol = false; + if (!JS_HasPropertyById(cx, accessor, atoms.override(), + &has_override_symbol)) return false; - if (has_override) - return JS_GetPropertyById(cx, accessor, atoms.override(), args.rval()); + + if (has_override_symbol) { + JS::RootedValue v_override_symbol(cx); + if (!JS_GetPropertyById(cx, accessor, atoms.override(), + &v_override_symbol)) + return false; + g_assert(v_override_symbol.isSymbol() && + "override symbol must be a symbol"); + JS::RootedSymbol override_symbol(cx, v_override_symbol.toSymbol()); + JS::RootedId override_id(cx, SYMBOL_TO_JSID(override_symbol)); + + JS::RootedObject this_obj(cx); + if (!args.computeThis(cx, &this_obj)) + return false; + + bool has_override = false; + if (!JS_HasPropertyById(cx, this_obj, override_id, &has_override)) + return false; + + if (has_override) + return JS_GetPropertyById(cx, this_obj, override_id, args.rval()); + } JS::RootedValue v_prototype(cx); if (!JS_GetPropertyById(cx, accessor, atoms.prototype(), &v_prototype)) @@ -684,9 +706,23 @@ static bool interface_setter(JSContext* cx, unsigned argc, JS::Value* vp) { JS::RootedValue v_accessor( cx, js::GetFunctionNativeReserved(&args.callee(), ACCESSOR_SLOT)); JS::RootedObject accessor(cx, &v_accessor.toObject()); + JS::RootedString description( + cx, JS_AtomizeAndPinString(cx, "Private interface function setter")); + JS::RootedSymbol symbol(cx, JS::NewSymbol(cx, description)); + JS::RootedValue v_symbol(cx, JS::SymbolValue(symbol)); const GjsAtoms& atoms = GjsContextPrivate::atoms(cx); - return JS_SetPropertyById(cx, accessor, atoms.override(), args[0]); + if (!JS_SetPropertyById(cx, accessor, atoms.override(), v_symbol)) + return false; + + args.rval().setUndefined(); + + JS::RootedObject this_obj(cx); + if (!args.computeThis(cx, &this_obj)) + return false; + JS::RootedId override_id(cx, SYMBOL_TO_JSID(symbol)); + + return JS_SetPropertyById(cx, this_obj, override_id, args[0]); } static bool resolve_on_interface_prototype(JSContext* cx, @@ -2967,7 +3003,7 @@ bool ObjectPrototype::hook_up_vfunc_impl(JSContext* cx, if (field_info) { gint offset; - gpointer method_ptr; + void* method_ptr; GjsCallbackTrampoline *trampoline; offset = g_field_info_get_offset(field_info); @@ -2995,7 +3031,7 @@ bool ObjectPrototype::hook_up_vfunc_impl(JSContext* cx, trampoline, nullptr, [](void*, GClosure* closure) { g_closure_unref(closure); }); - *reinterpret_cast<ffi_closure**>(method_ptr) = trampoline->closure(); + *reinterpret_cast<void**>(method_ptr) = trampoline->closure(); } return true; diff --git a/gi/value.cpp b/gi/value.cpp index ecc65ad7..f53ff75e 100644 --- a/gi/value.cpp +++ b/gi/value.cpp @@ -479,7 +479,7 @@ gjs_value_to_g_value_internal(JSContext *context, return throw_expect_type(context, value, "integer"); } } else if (gtype == G_TYPE_INT64) { - gint64 i; + int64_t i; if (Gjs::js_value_to_c_checked<int64_t>(context, value, &i, &out_of_range) && !out_of_range) { @@ -512,7 +512,7 @@ gjs_value_to_g_value_internal(JSContext *context, return throw_expect_type(context, value, "unsigned integer"); } } else if (gtype == G_TYPE_UINT64) { - guint64 i; + uint64_t i; if (Gjs::js_value_to_c_checked<uint64_t>(context, value, &i, &out_of_range) && !out_of_range) { @@ -551,9 +551,10 @@ gjs_value_to_g_value_internal(JSContext *context, const GjsAtoms& atoms = GjsContextPrivate::atoms(context); JS::RootedObject array_obj(context, &value.toObject()); - if (JS_HasPropertyById(context, array_obj, atoms.length(), - &found_length) && - found_length) { + if (!JS_HasPropertyById(context, array_obj, atoms.length(), + &found_length)) + return false; + if (found_length) { guint32 length; if (!gjs_object_require_converted_property( diff --git a/gjs/context.cpp b/gjs/context.cpp index b1cb934b..4e22825d 100644 --- a/gjs/context.cpp +++ b/gjs/context.cpp @@ -598,11 +598,14 @@ static void load_context_module(JSContext* cx, const char* uri, GjsContextPrivate::from_cx(cx)->main_loop_hold(); bool ok = add_promise_reactions( cx, evaluation_promise, on_context_module_resolved, - [](JSContext* cx, unsigned, JS::Value*) { - GjsContextPrivate::from_cx(cx)->main_loop_release(); + [](JSContext* cx, unsigned argc, JS::Value* vp) { + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::HandleValue error = args.get(0); // Abort because this module is required. - g_error("Failed to load context module."); + gjs_log_exception_full(cx, error, nullptr, G_LOG_LEVEL_ERROR); + + GjsContextPrivate::from_cx(cx)->main_loop_release(); return false; }, "context"); diff --git a/gjs/jsapi-util-string.cpp b/gjs/jsapi-util-string.cpp index 2b880e6f..c78069a8 100644 --- a/gjs/jsapi-util-string.cpp +++ b/gjs/jsapi-util-string.cpp @@ -538,7 +538,8 @@ gjs_debug_string(JSString *str) if (!str) return "<null string>"; if (!JS_StringIsLinear(str)) { - std::ostringstream out("<non-flat string of length "); + std::ostringstream out("<non-flat string of length ", + std::ios_base::ate); out << JS_GetStringLength(str) << '>'; return out.str(); } diff --git a/gjs/module.cpp b/gjs/module.cpp index d46a02c6..3b54a3fc 100644 --- a/gjs/module.cpp +++ b/gjs/module.cpp @@ -667,9 +667,8 @@ bool gjs_dynamic_module_resolve(JSContext* cx, JS::RootedValue result(cx); if (!JS::Call(cx, loader, "moduleResolveAsyncHook", args, &result)) - return JS::FinishDynamicModuleImport_NoTLA( - cx, JS::DynamicImportStatus::Failed, importing_module_priv, - module_request, internal_promise); + return JS::FinishDynamicModuleImport(cx, nullptr, importing_module_priv, + module_request, internal_promise); // Release in finish_import GjsContextPrivate* priv = GjsContextPrivate::from_cx(cx); diff --git a/gjs/profiler.cpp b/gjs/profiler.cpp index b5dc0aaa..095f7a63 100644 --- a/gjs/profiler.cpp +++ b/gjs/profiler.cpp @@ -786,8 +786,8 @@ gjs_profiler_set_filename(GjsProfiler *self, self->filename = g_strdup(filename); } -void _gjs_profiler_add_mark(GjsProfiler* self, gint64 time_nsec, - gint64 duration_nsec, const char* group, +void _gjs_profiler_add_mark(GjsProfiler* self, int64_t time_nsec, + int64_t duration_nsec, const char* group, const char* name, const char* message) { g_return_if_fail(self); g_return_if_fail(group); diff --git a/installed-tests/js/testGIMarshalling.js b/installed-tests/js/testGIMarshalling.js index 1f13b311..797c05a0 100644 --- a/installed-tests/js/testGIMarshalling.js +++ b/installed-tests/js/testGIMarshalling.js @@ -762,6 +762,17 @@ describe('GHashTable', function () { }; testInParameter('ghashtable_uint64', uint64Dict); }); + + it('symbol keys are ignored', function () { + const symbolDict = { + [Symbol('foo')]: 2, + '-1': 1, + 0: 0, + 1: -1, + 2: -2, + }; + expect(() => GIMarshallingTests.ghashtable_int_none_in(symbolDict)).not.toThrow(); + }); }); describe('GValue', function () { diff --git a/installed-tests/js/testGObjectInterface.js b/installed-tests/js/testGObjectInterface.js index 72ee657a..40f5eca8 100644 --- a/installed-tests/js/testGObjectInterface.js +++ b/installed-tests/js/testGObjectInterface.js @@ -385,6 +385,20 @@ describe('GObject interface', function () { expect(file.dup).toBe(originalDup); }); + it('overrides cannot be changed by instances of child classes', function () { + spyOn(Gio.File.prototype, 'dup'); + + expect(file).toBeInstanceOf(Gio.File); + expect(file).toBeInstanceOf(Gio._LocalFilePrototype.constructor); + + file.dup = 5; + expect(Gio.File.prototype.dup).not.toBe(5); + expect(Gio._LocalFilePrototype.dup).not.toBe(5); + + file.dup = originalDup; + expect(file.dup).toBe(originalDup); + }); + it('unknown properties are inherited by implementing classes', function () { Gio.File.prototype._originalDup = originalDup; expect(file._originalDup).toBe(originalDup); diff --git a/installed-tests/js/testRegress.js b/installed-tests/js/testRegress.js index 36d062b2..249b69e0 100644 --- a/installed-tests/js/testRegress.js +++ b/installed-tests/js/testRegress.js @@ -78,7 +78,7 @@ describe('Life, the Universe and Everything', function () { expect(Regress[method](-42)).toBe(-42); if (['float', 'double'].includes(type)) { - expect(Number.isNaN(Regress[method](undefined))).toBeTruthy(); + expect(Regress[method](undefined)).toBeNaN(); expect(Regress[method](42.42)).toBeCloseTo(42.42); expect(Regress[method](-42.42)).toBeCloseTo(-42.42); } else { diff --git a/meson.build b/meson.build index 39d3986c..f999cc43 100644 --- a/meson.build +++ b/meson.build @@ -2,7 +2,7 @@ # SPDX-FileCopyrightText: 2019 Philip Chimento <philip.chimento@gmail.com> # SPDX-FileCopyrightText: 2019 Chun-wei Fan <fanchunwei@src.gnome.org> -project('gjs', 'cpp', 'c', version: '1.71.90', license: ['MIT', 'LGPL2+'], +project('gjs', 'cpp', 'c', version: '1.73.1', license: ['MIT', 'LGPL2+'], meson_version: '>= 0.52.0', default_options: ['cpp_std=c++17', 'cpp_rtti=false', 'c_std=c99', 'warning_level=2', 'b_pch=true' ]) diff --git a/modules/script/package.js b/modules/script/package.js index 757f263e..1491b063 100644 --- a/modules/script/package.js +++ b/modules/script/package.js @@ -115,20 +115,7 @@ function init(params) { datadir = GLib.build_filenamev([prefix, 'share']); let libpath, girpath; - if (_runningFromSource()) { - log('Running from source tree, using local files'); - // Running from source directory - _base = GLib.get_current_dir(); - _submoduledir = _base; - pkglibdir = GLib.build_filenamev([_base, 'lib']); - libpath = GLib.build_filenamev([pkglibdir, '.libs']); - girpath = pkglibdir; - pkgdatadir = GLib.build_filenamev([_base, 'data']); - localedir = GLib.build_filenamev([_base, 'po']); - moduledir = GLib.build_filenamev([_base, 'src']); - - GLib.setenv('GSETTINGS_SCHEMA_DIR', pkgdatadir, true); - } else if (_runningFromMesonSource()) { + if (_runningFromMesonSource()) { log('Running from Meson, using local files'); let bld = GLib.getenv('MESON_BUILD_ROOT'); let src = GLib.getenv('MESON_SOURCE_ROOT'); @@ -147,6 +134,19 @@ function init(params) { } catch (e) { moduledir = GLib.build_filenamev([src, 'src']); } + } else if (_runningFromSource()) { + log('Running from source tree, using local files'); + // Running from source directory + _base = GLib.get_current_dir(); + _submoduledir = _base; + pkglibdir = GLib.build_filenamev([_base, 'lib']); + libpath = GLib.build_filenamev([pkglibdir, '.libs']); + girpath = pkglibdir; + pkgdatadir = GLib.build_filenamev([_base, 'data']); + localedir = GLib.build_filenamev([_base, 'po']); + moduledir = GLib.build_filenamev([_base, 'src']); + + GLib.setenv('GSETTINGS_SCHEMA_DIR', pkgdatadir, true); } else { _base = prefix; pkglibdir = GLib.build_filenamev([libdir, _pkgname]); diff --git a/test/test-ci.sh b/test/test-ci.sh index 1c4c3170..2a531ad9 100755 --- a/test/test-ci.sh +++ b/test/test-ci.sh @@ -156,7 +156,7 @@ elif test "$1" = "SH_CHECKS"; then elif test "$1" = "CPPLINT"; then do_Print_Labels 'C/C++ Linter report ' - cpplint --quiet $(find . -name \*.cpp -or -name \*.c -or -name \*.h | sort) 2>&1 >/dev/null | \ + cpplint --quiet $(find . -name \*.cpp -or -name \*.h | sort) 2>&1 >/dev/null | \ tee "$save_dir"/analysis/head-report.txt | \ sed -E -e 's/:[0-9]+:/:LINE:/' -e 's/ +/ /g' \ > /cwd/head-report.txt @@ -172,7 +172,7 @@ elif test "$1" = "CPPLINT"; then exit 0 fi git checkout ci-upstream-base - cpplint --quiet $(find . -name \*.cpp -or -name \*.c -or -name \*.h | sort) 2>&1 >/dev/null | \ + cpplint --quiet $(find . -name \*.cpp -or -name \*.h | sort) 2>&1 >/dev/null | \ tee "$save_dir"/analysis/base-report.txt | \ sed -E -e 's/:[0-9]+:/:LINE:/' -e 's/ +/ /g' \ > /cwd/base-report.txt diff --git a/tools/package.json b/tools/package.json index c5ac1577..cb110ee6 100644 --- a/tools/package.json +++ b/tools/package.json @@ -9,7 +9,7 @@ "fix": "yarn lint --fix" }, "devDependencies": { - "eslint": "^8.8.0", - "eslint-plugin-jsdoc": "^37.7.0" + "eslint": "^8.10.0", + "eslint-plugin-jsdoc": "^37.9.6" } } diff --git a/tools/yarn.lock b/tools/yarn.lock index 0012303a..0741fc67 100644 --- a/tools/yarn.lock +++ b/tools/yarn.lock @@ -2,23 +2,23 @@ # yarn lockfile v1 -"@es-joy/jsdoccomment@~0.18.0": - version "0.18.0" - resolved "https://registry.yarnpkg.com/@es-joy/jsdoccomment/-/jsdoccomment-0.18.0.tgz#2532b2ecb8576d694011b157c447ed6b12534c70" - integrity sha512-TjT8KJULV4I6ZiwIoKr6eMs+XpRejqwJ/VA+QPDeFGe9j6bZFKmMJ81EeFsGm6JNZhnzm37aoxVROmTh2PZoyA== +"@es-joy/jsdoccomment@~0.20.1": + version "0.20.1" + resolved "https://registry.yarnpkg.com/@es-joy/jsdoccomment/-/jsdoccomment-0.20.1.tgz#fe89f435f045ae5aaf89c7a4df3616c03e9d106e" + integrity sha512-oeJK41dcdqkvdZy/HctKklJNkt/jh+av3PZARrZEl+fs/8HaHeeYoAvEwOV0u5I6bArTF17JEsTZMY359e/nfQ== dependencies: comment-parser "1.3.0" esquery "^1.4.0" - jsdoc-type-pratt-parser "~2.2.2" + jsdoc-type-pratt-parser "~2.2.3" -"@eslint/eslintrc@^1.0.5": - version "1.0.5" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.0.5.tgz#33f1b838dbf1f923bfa517e008362b78ddbbf318" - integrity sha512-BLxsnmK3KyPunz5wmCCpqy0YelEoxxGmH73Is+Z74oOTMtExcjkr3dDR6quwrjh1YspA8DH9gnX1o069KiS9AQ== +"@eslint/eslintrc@^1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.2.0.tgz#7ce1547a5c46dfe56e1e45c3c9ed18038c721c6a" + integrity sha512-igm9SjJHNEJRiUnecP/1R5T3wKLEJ7pL6e2P+GUSfCd0dGjPYYZve08uzw8L2J8foVHFz+NGu12JxRcU2gGo6w== dependencies: ajv "^6.12.4" debug "^4.3.2" - espree "^9.2.0" + espree "^9.3.1" globals "^13.9.0" ignore "^4.0.6" import-fresh "^3.2.1" @@ -172,12 +172,12 @@ escape-string-regexp@^4.0.0: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== -eslint-plugin-jsdoc@^37.7.0: - version "37.7.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-37.7.0.tgz#975d9f18cb0520dde7a2b0db5f4421dfee3fdd17" - integrity sha512-vzy3/ltXoGtabRnjLogaEmhGxxIv5B8HK5MJLIrdxFJUvhBppZjuVuLr71DjIBi0jg6bFomwkYKjojt29cN8PA== +eslint-plugin-jsdoc@^37.9.6: + version "37.9.6" + resolved "https://registry.yarnpkg.com/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-37.9.6.tgz#4ac0b6f171d818856a6e52987413f54d66a50800" + integrity sha512-GDCB0nEwKVaeIzam+t/yB8XG/6tgvc9XgrSwuxqCXVlKRWUqTuTqntZoqAKZAIbWIgYsrnrvrWAyIX/QvhwBcw== dependencies: - "@es-joy/jsdoccomment" "~0.18.0" + "@es-joy/jsdoccomment" "~0.20.1" comment-parser "1.3.0" debug "^4.3.3" escape-string-regexp "^4.0.0" @@ -186,10 +186,10 @@ eslint-plugin-jsdoc@^37.7.0: semver "^7.3.5" spdx-expression-parse "^3.0.1" -eslint-scope@^7.1.0: - version "7.1.0" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.1.0.tgz#c1f6ea30ac583031f203d65c73e723b01298f153" - integrity sha512-aWwkhnS0qAXqNOgKOK0dJ2nvzEbhEvpy8OlJ9kZ0FeZnA6zpjv1/Vei+puGFFX7zkPCkHHXb7IDX3A+7yPrRWg== +eslint-scope@^7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.1.1.tgz#fff34894c2f65e5226d3041ac480b4513a163642" + integrity sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw== dependencies: esrecurse "^4.3.0" estraverse "^5.2.0" @@ -206,17 +206,17 @@ eslint-visitor-keys@^2.0.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz#21fdc8fbcd9c795cc0321f0563702095751511a8" integrity sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ== -eslint-visitor-keys@^3.1.0, eslint-visitor-keys@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.2.0.tgz#6fbb166a6798ee5991358bc2daa1ba76cc1254a1" - integrity sha512-IOzT0X126zn7ALX0dwFiUQEdsfzrm4+ISsQS8nukaJXwEyYKRSnEIIDULYg1mCtGp7UUXgfGl7BIolXREQK+XQ== +eslint-visitor-keys@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz#f6480fa6b1f30efe2d1968aa8ac745b862469826" + integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== -eslint@^8.8.0: - version "8.8.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.8.0.tgz#9762b49abad0cb4952539ffdb0a046392e571a2d" - integrity sha512-H3KXAzQGBH1plhYS3okDix2ZthuYJlQQEGE5k0IKuEqUSiyu4AmxxlJ2MtTYeJ3xB4jDhcYCwGOg2TXYdnDXlQ== +eslint@^8.10.0: + version "8.10.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.10.0.tgz#931be395eb60f900c01658b278e05b6dae47199d" + integrity sha512-tcI1D9lfVec+R4LE1mNDnzoJ/f71Kl/9Cv4nG47jOueCMBrCCKYXr4AUVS7go6mWYGFD4+EoN6+eXSrEbRzXVw== dependencies: - "@eslint/eslintrc" "^1.0.5" + "@eslint/eslintrc" "^1.2.0" "@humanwhocodes/config-array" "^0.9.2" ajv "^6.10.0" chalk "^4.0.0" @@ -224,10 +224,10 @@ eslint@^8.8.0: debug "^4.3.2" doctrine "^3.0.0" escape-string-regexp "^4.0.0" - eslint-scope "^7.1.0" + eslint-scope "^7.1.1" eslint-utils "^3.0.0" - eslint-visitor-keys "^3.2.0" - espree "^9.3.0" + eslint-visitor-keys "^3.3.0" + espree "^9.3.1" esquery "^1.4.0" esutils "^2.0.2" fast-deep-equal "^3.1.3" @@ -252,14 +252,14 @@ eslint@^8.8.0: text-table "^0.2.0" v8-compile-cache "^2.0.3" -espree@^9.2.0, espree@^9.3.0: - version "9.3.0" - resolved "https://registry.yarnpkg.com/espree/-/espree-9.3.0.tgz#c1240d79183b72aaee6ccfa5a90bc9111df085a8" - integrity sha512-d/5nCsb0JcqsSEeQzFZ8DH1RmxPcglRWh24EFTlUEmCKoehXGdpsx0RkHDubqUI8LSAIKMQp4r9SzQ3n+sm4HQ== +espree@^9.3.1: + version "9.3.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-9.3.1.tgz#8793b4bc27ea4c778c19908e0719e7b8f4115bcd" + integrity sha512-bvdyLmJMfwkV3NCRl5ZhJf22zBFo1y8bYh3VYb+bfzqNB4Je68P2sSuXyuFquzWLebHpNd2/d5uv7yoP9ISnGQ== dependencies: acorn "^8.7.0" acorn-jsx "^5.3.1" - eslint-visitor-keys "^3.1.0" + eslint-visitor-keys "^3.3.0" esquery@^1.4.0: version "1.4.0" @@ -421,10 +421,10 @@ js-yaml@^4.1.0: dependencies: argparse "^2.0.1" -jsdoc-type-pratt-parser@~2.2.2: - version "2.2.2" - resolved "https://registry.yarnpkg.com/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-2.2.2.tgz#a85e407ac502b444dc23333aa4d6d0dc83f76187" - integrity sha512-zRokSWcPLSWkoNzsWn9pq7YYSwDhKyEe+cJYT2qaPqLOOJb5sFSi46BPj81vP+e8chvCNdQL9RG86Bi9EI6MDw== +jsdoc-type-pratt-parser@~2.2.3: + version "2.2.3" + resolved "https://registry.yarnpkg.com/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-2.2.3.tgz#3910cd0120054a512a73942d644ef1eb5a9df6e9" + integrity sha512-QPyxq62Q8veBSDtDrWmqaEPjSCeknUV9dH/OAGt3q9an8qC8UQDqitQiw1NvoMskIESpoRZ6qzt4H3rlK0xo8A== json-schema-traverse@^0.4.1: version "0.4.1" |