summaryrefslogtreecommitdiff
path: root/gmodule
Commit message (Collapse)AuthorAgeFilesLines
* gmodule: Define a gmodule include dependency and use it in gio moduleswip/3v1n0/gio-gmodule-visibility-depMarco Trevisan (Treviño)2023-04-191-3/+6
| | | | | | | | | | | Various gio modules include gmodule.h that requires the gmodule-visibility.h to be already built. To make this easier, just provide a dependency and use it where we are building modules that do not depend on libgio_dep (that already includes that). Fixes: https://gitlab.gnome.org/GNOME/glib/-/issues/2982
* Merge branch 'valgrind-variable' into 'main'Marco Trevisan2023-04-171-0/+28
|\ | | | | | | | | meson: Add glib_valgrind_suppressions variable to glib pkg-config file See merge request GNOME/glib!3361
| * meson: Add tests for generated pkg-config filesMarco Trevisan (Treviño)2023-04-171-0/+28
| | | | | | | | Ensure things are generated as we expect and avoid we regress on that.
* | build/gmodule-2.0.pc: Move compiler flags from Libs to CflagsJan Tojnar2023-03-311-2/+4
|/ | | | | | | | | | | | | | Previously, `-Wl,--export-dynamic` was in `Libs` key of `gmodule-2.0.pc`, even though `-Wl` is a compiler flag, rather than a linker one. This caused issues with API reference builds in evolution-data-server, which passes the output of `pkg-config --libs` through `--ldflags` argument of `gtkdoc-scan`, which are forwarded unchanged to `ld`: ld: unrecognized option '-Wl,--export-dynamic' Let’s move the flag to `Cflags` so that the compiler can deal with it. https://gitlab.gnome.org/GNOME/evolution-data-server/-/issues/463
* Use O_CLOEXEC in {g_,}open () calls for race-free setting of the ↵Maciej S. Szmigiero2023-02-211-1/+5
| | | | | | | | | close-on-exec flag The remaining call sites are either Windows-only, between fork () and exec () or in xdgmime copylib. Hope I haven't missed any site.
* meson: Use exitcode protocol for some c++ and gobject definition testsMarco Trevisan (Treviño)2023-01-171-0/+2
| | | | | | | In all these cases we don't really care about running the test file, while building and basic execution it is relevant. Also they don't support TAP at all.
* meson: Use 'tap' test protocol by defaultMarco Trevisan (Treviño)2023-01-171-0/+1
| | | | | | | | | Meson supports tap protocol results parsing, allowing us to track better the tests that are running (and the ones that are actually skipped) without manually parsing the test output. However this also implies that using the verbose mode for a test doesn't show its output by default (unless there are failures).
* build: Don't overwrite build variablesEmmanuele Bassi2023-01-081-3/+3
| | | | | | | We cannot use `gvisibility_h` for different visibility header files; you never know when you're going to refer to the variable again, and projects might end up needing to retrieve the variable contents—like, for instance, gobject-introspection using glib as a subproject.
* Fix gmodule/COPYING symlink pathRoman Stratiienko2022-11-281-1/+1
| | | | Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
* gmodule: Fix redeclaration of symbolPhilip Withnall2022-11-161-0/+3
| | | | | | | | | | | | | | This should fix the Coverity build, which is currently broken: https://gitlab.gnome.org/GNOME/glib/-/jobs/2389979 ``` ../gmodule/gmodule-deprecated.c:8: error: "GLIB_DISABLE_DEPRECATION_WARNINGS" redefined [-Werror] 8 | #define GLIB_DISABLE_DEPRECATION_WARNINGS | <command-line>: note: this is the location of the previous definition cc1: all warnings being treated as errors ``` Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
* Merge branch 'wip/3v1n0/meson-fix-tests-binary-dependencies' into 'main'Philip Withnall2022-11-081-15/+31
|\ | | | | | | | | test/meson: Add tests dependencies on built programs, libraries and modules See merge request GNOME/glib!3015
| * gmodule/tests/meson: Make tests depending on loaded libraries and modulesMarco Trevisan (Treviño)2022-11-011-15/+31
| |
* | Revert "gio, glib: Use G_OS_DARWIN for code that is for such environments"Philip Withnall2022-11-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 476e33c3f3632bd32370fadc67b10d61da9a4098. We’ve decided to remove `G_OS_DARWIN` in favour of recommending people use `__APPLE__` instead. As per the discussion on #2802 and linked issues, * Adding a new define shifts the complexity from “which of these platform-provided defines do I use” to “which platform-provided defines does G_OS_DARWIN use” * There should ideally be no cases where a user of GLib has to use their own platform-specific code, since GLib should be providing appropriate abstractions * Providing a single `G_OS_DARWIN` to cover all Apple products (macOS and iOS) hides the complexity of what the user is actually testing: are they testing for the Mach kernel, the Carbon and/or Cocoa user space toolkits, macOS vs iOS vs tvOS, etc Helps: #2802
* | Merge branch 'wip/3v1n0/some-meson-fixmes' into 'main'Xavier Claessens2022-11-011-2/+2
|\ \ | |/ |/| | | | | meson: Handle various build system FIXME's See merge request GNOME/glib!3012
| * gmodule/meson: Use stdout to communicate return value pf dlsym test codeMarco Trevisan (Treviño)2022-10-261-2/+2
| |
* | meson: Use test setup environment instead of repeating it everywhereMarco Trevisan (Treviño)2022-10-311-1/+1
| |
* | ci: Mark failing windows tests as can-fail and do not ignore test failuresMarco Trevisan (Treviño)2022-10-311-0/+2
| |
* | meson: Expose library build type as global variablesMarco Trevisan (Treviño)2022-10-311-1/+1
| | | | | | | | | | | | Given that it can be computed using an error-prone strings comparisons it is better to provide a variable everywhere, so that we don't have the risk of comparing values that are always false.
* | meson, ci: Support tests that can fail under certain conditionsMarco Trevisan (Treviño)2022-10-311-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have tests that are failing in some environments, but it's difficult to handle them because: - for some environments we just allow all the tests to fail: DANGEROUS - when we don't allow failures we have flacky tests: A CI pain So, to avoid this and ensure that: - New failing tests are tracked in all platforms - gitlab integration on tests reports is working - coverage is reported also for failing tests Add support for `can_fail` keyword on tests that would mark the test as part of the `failing` test suite. Not adding the suite directly when defining the tests as this is definitely simpler and allows to define conditions more clearly (see next commits). Now, add a default test setup that does not run the failing and flaky tests by default (not to bother distributors with testing well-known issues) and eventually run all the tests in CI: - Non-flaky tests cannot fail in all platforms - Failing and Flaky tests can fail In both cases we save the test reports so that gitlab integration is preserved.
* | Merge branch 'wip/smcv/autofd' into 'main'Philip Withnall2022-10-272-0/+47
|\ \ | | | | | | | | | | | | | | | | | | gstdio: Silence "Not available before" warnings for inline functions Closes #2796 See merge request GNOME/glib!3026
| * | tests: Test that we can include all headers with an old MAX_VERSIONSimon McVittie2022-10-272-0/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In principle we could script this so that each max-version.c is compiled 26 times, once per possible MAX_VERSION, but I haven't implemented that here: just pinning to the oldest possible version is sufficient to reproduce #2796. These aren't included in the installed-tests, since they don't really do anything at runtime (the important thing is that they compile without warnings). Reproduces: #2796 Signed-off-by: Simon McVittie <smcv@collabora.com>
* | | Merge branch 'nirbheek/gmodule-suffix-deprecation' into 'main'Marco Trevisan2022-10-276-58/+133
|\ \ \ | |/ / |/| | | | | | | | | | | | | | Improve g_module_open(), deprecate G_MODULE_SUFFIX Closes #520 e #1413 See merge request GNOME/glib!2950
| * | Improve g_module_open(), deprecate G_MODULE_SUFFIXNirbheek Chauhan2022-10-276-58/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | G_MODULE_SUFFIX is deprecated now because you will get the wrong results using it most of the time: 1. The suffix on macOS is usually 'dylib', but it's 'so' when using Autotools, so there's no way to get the suffix correct using a pre-processor macro. 2. Prefixes also vary in a platform-specific way. You may or may not have a 'lib' prefix for the name on Windows and on Cygwin the prefix is 'cyg'. 3. The library name itself can vary per platform. For instance, you may want to load foo-1.dll on Windows and libfoo.1.dylib on macOS. This is for libraries, not modules, but that is still a use-case that people use the GModule API for. g_module_build_path() does take care of (2) on Cygwin, but it fundamentally cannot handle the possibility of multiple options for the module name, since it does not do any I/O. Hence, it is also deprecated. Instead, g_module_open() has been improved so that it takes care of all this by searching the filesystem for combinations of possible suffixes and prefixes on each platform. Along the way, the documentation for it was also improved to make it clearer what it does. Closes https://gitlab.gnome.org/GNOME/glib/-/issues/520 Closes https://gitlab.gnome.org/GNOME/glib/-/issues/1413
* | | meson: Add missing install tagsXavier Claessens2022-10-261-0/+2
| |/ |/|
* | Merge branch 'RTLD_DEFAULT' into 'main'Philip Withnall2022-10-261-2/+2
|\ \ | |/ |/| | | | | | | | | Handle plugable g_modules through RTLD_DEFAULT for NetBSD Closes #19 See merge request GNOME/glib!3014
| * Handle plugable g_modules through RTLD_DEFAULT for NetBSDEmmanuel Fleury2022-10-251-2/+2
| | | | | | | | fix issue #19
* | meson: Remove unneeded install_tag's on headersMarco Trevisan (Treviño)2022-10-241-1/+0
| | | | | | | | | | Meson is able to handle this automatically when we're installing in the include-dir prefix.
* | meson: Cleanup include-dir paths, use base path without repetitionsMarco Trevisan (Treviño)2022-10-241-2/+4
| | | | | | | | | | Avoid setting the subdir all the times, just use the global definition plus the specific module subdir
* | glib, gmodule, gobject: Add generated headers to the lib dependencyMarco Trevisan (Treviño)2022-10-231-3/+6
|/ | | | | | | | | | | This requires changing them from being generated sources at compile time to custom targets, but it also ensures that they are actually there when needed, in fact currently we may instead try to compile files that requires them without having been generated yet. See: https://gitlab.gnome.org/GNOME/glib/-/jobs/2346914 (glib) See: https://gitlab.gnome.org/GNOME/glib/-/jobs/2344802 (gmodule) See: https://gitlab.gnome.org/GNOME/glib/-/jobs/2345205 (gobject)
* Merge branch 'wip/smcv/deprecated-prop-followup' into 'main'Philip Withnall2022-10-151-3/+1
|\ | | | | | | | | Run tests with G_ENABLE_DIAGNOSTIC=1 See merge request GNOME/glib!2889
| * tests: Move common test environment variables to top levelSimon McVittie2022-09-211-3/+1
| | | | | | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* | giomodules: g_io_module_* must always be exportedXavier Claessens2022-10-132-7/+14
| | | | | | | | Those symbols are not used by GIO itself but by external modules.
* | Rename all visibility macrosXavier Claessens2022-10-132-15/+15
| |
* | Fix symbol visibility macros on WindowsXavier Claessens2022-10-132-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is currently no `dllimport` attribute on any of our function, which prevents MSVC to optimize function calls. To fix that issue, we need to redeclare all our visibility macros for each of our libraries, because when compiling e.g. GIO code, we need dllimport in GLIB headers and dllexport in GIO headers. That means they cannot use the same GLIB_AVAILABLE_* macro. Since that's a lot of boilerplate to copy/paste after each version bump, this MR generate all those macros using a python script. Also simplify the meson side by using `gnu_symbol_visibility : 'hidden'` keyword argument instead of passing the cflag manually. This leaves only API index to add manually into glib-docs.xml when bumping GLib version. That file cannot be generated because Meson does not allow passing a buit file to gnome.gtkdoc()'s main_xml kwarg unfortunately.
* | tests: skip shared libs if default_library=staticAlyssa Ross2022-10-121-16/+18
| | | | | | | | | | | | | | Otherwise, the build will fail when the toolchain is static-only, even with -Ddefault_library=static. I talked to a Meson developer in their IRC channel, who told me that the correct fix was to ensure that shared_library is only used if default_library != static.
* | Merge branch 'atomic-older-cplusplus' into 'main'Philip Withnall2022-10-121-0/+13
|\ \ | | | | | | | | | | | | gatomic: fix the atomic compare_and_exchange macros on older C++ standard versions See merge request GNOME/glib!2864
| * | meson: Build C++ tests for the currently supported C++ standard versionsMarco Trevisan (Treviño)2022-09-151-0/+13
| |/ | | | | | | | | | | We've various macros definitions that are depending using C++ features that may not work in all the standard versions, so recompile the cxx tests that we have in all the ones we want to support.
* | meson: Set install_tag on installed tests filesXavier Claessens2022-09-201-0/+4
|/ | | | | | This could be done automatically by Meson, this commit can be reverted when we have that Meson PR in our CI: https://github.com/mesonbuild/meson/pull/10829
* meson: fix build without cpp toolchainJames Hilliard2022-07-151-3/+8
| | | | | | | We don't need a cpp toolchain for building glib so lets just automatically disable tests requiring one when not available. Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
* Merge branch 'gmodule-invalid-la-file' into 'main'Marco Trevisan2022-07-062-4/+43
|\ | | | | | | | | gmodule: Improve error handling for invalid .la files See merge request GNOME/glib!2796
| * gmodule: Use Unicode quotation marks in error messagesPhilip Withnall2022-07-061-3/+3
| | | | | | | | | | | | This makes them a little nicer to read. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
| * gmodule: Improve error handling for invalid .la filesPhilip Withnall2022-07-062-2/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If a `.la` file is empty, `lt_libdir` and/or `lt_dlname` won’t be set, but will then still be used in `g_strconcat()`, leading to invalid output. Detect that and return an error. Adds a unit test. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Coverity CID: #1474756
* | Merge branch 'more-spdx' into 'main'Philip Withnall2022-07-0510-0/+20
|\ \ | |/ |/| | | | | Add more SPDX license headers See merge request GNOME/glib!2706
| * Add SPDX license headers for LGPL-2.1-or-later to various filesPhilip Withnall2022-06-0110-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | These have all been added manually, as I’ve finished all the files which I can automatically detect. All the license headers in this commit are for LGPL-2.1-or-later, and all have been double-checked against the license paragraph in the file header. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Helps: #1415
* | build: Drop MALLOC_PERTURB_ from test environmentsPhilip Withnall2022-06-211-1/+0
|/ | | | | | It’s set already by Meson, to an actually random value. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
* Move tests/module-test.c to gmodules/tests/Emmanuel Fleury2022-05-264-0/+391
| | | | Helps issue #1434
* docs: Add all used licenses in a REUSE-compatible directoryPhilip Withnall2022-05-171-502/+1
| | | | | | | | | | | | | | This is the result of running `reuse download --all`. This isn’t yet necessarily a comprehensive list of all licenses used in GLib, as the majority of files in GLib are currently missing machine readable copyright and licensing headers. It’s a start though. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Helps: #1415
* Merge branch 'meson-version-policy' into 'main'Philip Withnall2022-05-101-6/+4
|\ | | | | | | | | | | | | docs: Add a Meson version policy and bump Meson version in CI Closes #2596 See merge request GNOME/glib!2641
| * meson: Use meson.can_run_host_binaries()Xavier Claessens2022-05-061-1/+1
| | | | | | | | | | | | It is not only shorter than `not meson.is_cross_build() or meson.has_exe_wrapper()` but also handle the case of cross compiling to a compatible arch such as building for i386 on an amd64.
| * build: Drop checks and workarounds for older Meson versionsPhilip Withnall2022-05-061-5/+3
| | | | | | | | Signed-off-by: Philip Withnall <pwithnall@endlessos.org>