libpkgconf/client.c


Log

Author Commit Date CI Message
Christoph Reiter c52f7785 2025-06-24T08:00:42 pkgconf_trace: fix error return handling In both cases the return value was incremented before checking for the error case.
Ariadne Conill d6be0d38 2025-06-04T11:53:20 libpkgconf: client: unref the preloaded list on client deinit Signed-off-by: Ariadne Conill <ariadne@ariadne.space>
Ariadne Conill 1a28204a 2025-06-04T11:20:39 libpkgconf: client: avoid environ keyword which is macro on Win32 Signed-off-by: Ariadne Conill <ariadne@ariadne.space>
Ariadne Conill 9665d214 2025-06-04T11:15:52 libpkgconf: client: add pkgconf_client_preload_from_environ() Signed-off-by: Ariadne Conill <ariadne@ariadne.space>
Ariadne Conill 01eb0cf1 2025-06-04T10:39:09 libpkgconf: client: add pkgconf_client_preload_path() for preloading packages Signed-off-by: Ariadne Conill <ariadne@ariadne.space>
Ariadne Conill aa5813ac 2025-05-31T00:06:57 libpkgconf: path: refactor windows registry PKG_CONFIG_PATH support Now we add to the search list rather than falling back to the registry after the search list fails to find a package. Signed-off-by: Ariadne Conill <ariadne@ariadne.space>
Ariadne Conill 205bc7bf 2025-05-29T11:38:54 libpkgconf: client: remove PKGCONF_BUFSIZE from logging subsystem Signed-off-by: Ariadne Conill <ariadne@ariadne.space>
Ariadne Conill e3f9e694 2025-05-28T22:18:39 libpkgconf: client: propagate malloc failures upwards Otherwise a NULL dereference can happen when malloc fails in pkgconf_client_new(). Found-by: GCC -fanalyzer Signed-off-by: Ariadne Conill <ariadne@ariadne.space>
Ariadne Conill 5a188784 2025-05-17T23:49:54 libpkgconf: add support for late-breaking unveil(2) notifications Signed-off-by: Ariadne Conill <ariadne@ariadne.space>
Sam James d454f62c 2023-11-05T22:17:02 libpkgconf: fix -Walloc-size GCC 14 introduces a new -Walloc-size included in -Wextra which gives: ``` libpkgconf/personality.c:260:11: warning: allocation of insufficient size '1' for type 'pkgconf_cross_personality_t' {aka 'struct pkgconf_cross_personality_'} with size '48' [-Walloc-size] libpkgconf/queue.c:46:33: warning: allocation of insufficient size '1' for type 'pkgconf_queue_t' {aka'struct pkgconf_queue_'} with size '16' [-Walloc-size] libpkgconf/client.c:164:33: warning: allocation of insufficient size '1' for type 'pkgconf_client_t' {aka 'struct pkgconf_client_'} with size '120' [-Walloc-size] libpkgconf/path.c:105:14: warning: allocation of insufficient size '1' for type 'pkgconf_path_t' {aka 'struct pkgconf_path_'} with size '24' [-Walloc-size] libpkgconf/path.c:237:22: warning: allocation of insufficient size '1' for type 'pkgconf_path_t' {aka 'struct pkgconf_path_'} with size '24' [-Walloc-size] libpkgconf/tuple.c:239:34: warning: allocation of insufficient size '1' for type 'pkgconf_tuple_t' {aka 'struct pkgconf_tuple_'} with size '24' [-Walloc-size] libpkgconf/dependency.c:133:13: warning: allocation of insufficient size '1' for type 'pkgconf_dependency_t' {aka 'struct pkgconf_dependency_'} with size '44' [-Walloc-size] libpkgconf/dependency.c:472:17: warning: allocation of insufficient size '1' for type 'pkgconf_dependency_t' {aka 'struct pkgconf_dependency_'} with size '44' [-Walloc-size] libpkgconf/fragment.c:146:22: warning: allocation of insufficient size '1' for type 'pkgconf_fragment_t' {aka 'struct pkgconf_fragment_'} with size '24' [-Walloc-size] libpkgconf/fragment.c:195:22: warning: allocation of insufficient size '1' for type 'pkgconf_fragment_t' {aka 'struct pkgconf_fragment_'} with size '24' [-Walloc-size] libpkgconf/fragment.c:356:14: warning: allocation of insufficient size '1' for type 'pkgconf_fragment_t' {aka 'struct pkgconf_fragment_'} with size '24' [-Walloc-size] libpkgconf/pkg.c:422:13: warning: allocation of insufficient size '1' for type 'pkgconf_pkg_t' {aka 'struct pkgconf_pkg_'} with size '188' [-Walloc-size] libpkgconf/client.c:164:33: warning: allocation of insufficient size '1' for type 'pkgconf_client_t' {aka 'struct pkgconf_client_'} with size '224' [-Walloc-size] libpkgconf/personality.c:260:11: warning: allocation of insufficient size '1' for type 'pkgconf_cross_personality_t' {aka 'struct pkgconf_cross_personality_'} with size '96' [-Walloc-size] libpkgconf/dependency.c:133:13: warning: allocation of insufficient size '1' for type 'pkgconf_dependency_t' {aka 'struct pkgconf_dependency_'} with size '80' [-Walloc-size] libpkgconf/dependency.c:472:17: warning: allocation of insufficient size '1' for type 'pkgconf_dependency_t' {aka 'struct pkgconf_dependency_'} with size '80' [-Walloc-size] libpkgconf/path.c:105:14: warning: allocation of insufficient size '1' for type 'pkgconf_path_t' {aka 'struct pkgconf_path_'} with size '48' [-Walloc-size] libpkgconf/path.c:237:22: warning: allocation of insufficient size '1' for type 'pkgconf_path_t' {aka 'struct pkgconf_path_'} with size '48' [-Walloc-size] libpkgconf/queue.c:46:33: warning: allocation of insufficient size '1' for type 'pkgconf_queue_t' {aka 'struct pkgconf_queue_'} with size '32' [-Walloc-size] libpkgconf/tuple.c:239:34: warning: allocation of insufficient size '1' for type 'pkgconf_tuple_t' {aka 'struct pkgconf_tuple_'} with size '48' [-Walloc-size] libpkgconf/fragment.c:146:22: warning: allocation of insufficient size '1' for type 'pkgconf_fragment_t' {aka 'struct pkgconf_fragment_'} with size '48' [-Walloc-size] libpkgconf/fragment.c:195:22: warning: allocation of insufficient size '1' for type 'pkgconf_fragment_t' {aka 'struct pkgconf_fragment_'} with size '48' [-Walloc-size] libpkgconf/fragment.c:356:14: warning: allocation of insufficient size '1' for type 'pkgconf_fragment_t' {aka 'struct pkgconf_fragment_'} with size '48' [-Walloc-size] libpkgconf/pkg.c:422:13: warning: allocation of insufficient size '1' for type 'pkgconf_pkg_t' {aka 'struct pkgconf_pkg_'} with size '360' [-Walloc-size] ``` The calloc prototype is: ``` void *calloc(size_t nmemb, size_t size); ``` So, just swap the number of members and size arguments to match the prototype, as we're initialising 1 struct of size `sizeof(struct ...)`. GCC then sees we're not doing anything wrong. The only exception there is for argv which I fixed while at it. Signed-off-by: Sam James <sam@gentoo.org>
Dylan Baker ebe74fd2 2022-08-03T15:24:05 cache: free the cache table when it is empty and set to NULL We do the latter for the benefit of libpkgconf. This cleans up a significant number of memory leaks in the cache handling.
Dylan Baker f5d6bb71 2022-02-04T16:06:08 libpkgconf: remove const modifier from error_handler data pointer Currently, the data pointer is `const void *`, which means that the handler can't modify the data without casting away the constness.
Alexander Tsoy db9c1e96 2019-06-07T19:19:28 fix the order of header includes config.h should be included before stdinc.h, otherwise large file support is not enabled. Downstream bug: https://bugs.gentoo.org/687548
William Pitcock 2d0c1f5c 2019-05-06T15:15:41 lite: disable debug logging
William Pitcock ba1f48e4 2019-03-23T22:17:04 libpkgconf: client: ensure PKG_CONFIG_LIBDIR being empty overrides the default search paths closes #25
Graham Ollis fb08ae2b 2018-06-25T06:36:57 environment variables for system paths should override compiled-in defaults
William Pitcock 25b2105e 2018-05-09T22:52:07 libpkgconf: client: if tracing is disabled, don't try to trace
William Pitcock 6b0e346c 2018-05-09T17:07:26 libpkgconf: refactor building the dir lists into separate concerns
William Pitcock 854490c5 2018-05-09T16:54:21 libpkgconf: add basic support for cross-compile personality objects
Leorize f36ccc1d 2018-04-03T12:46:35 libpkgconf: add support for Haiku client: use BELIBRARIES On Haiku, BELIBRARIES is the equivalent to LIBRARY_PATH on many other systems, while LIBRARY_PATH is instead the LD_LIBRARY_PATH of Haiku. pkg: bootstrap package search paths with Haiku's find_paths This commit adds build_default_pkgconfig_path. The function appends to the list given the default pkgconfig paths, and will supersede get_default_pkgconfig_path
William Pitcock 06abf28d 2017-12-05T17:46:57 libpkgconf: client: handle NULL client in pkgconf_trace calls
William Pitcock e9fd43ca 2017-09-17T23:38:25 libpkgconf: clean up header includes (closes #137)
William Pitcock ebb4c735 2017-09-13T15:02:57 libpkgconf: client: resolve memory leak of filter lists (closes #130)
William Pitcock 47ce9765 2017-09-08T18:44:28 libpkgconf: define SIZE_FMT_SPECIFIER on POSIX and Windows platforms and use it in place of %zu The MSVCRT runtime as used on Windows does not support %zu, but instead recommends %Iu. As we want to remain portable to other runtimes, even on Windows, we do not use %Iu, but instead expand it logically to either %lu or %llu depending on if it's _WIN32 or _WIN64 headers. On POSIX, we assume C99 support is available and always use %zu, as pkgconf has never supported anything earlier than C99 officially. Closes #125.
Jussi Pakkanen 40fd9950 2017-06-19T20:03:00 Experiment to build with Meson (#119) * Initial Meson build definitions. * Install man page and headers.
William Pitcock 16ecf82f 2017-02-04T20:09:21 libpkgconf: client: bring up the default trace handler as early as possible
William Pitcock 2b6bb5a2 2017-02-04T19:50:58 libpkgconf: client: add trace points
William Pitcock d20efff4 2017-02-04T19:49:59 libpkgconf: overhaul pkgconf_trace() a little
William Pitcock bef29308 2017-02-04T18:57:21 libpkgconf: client: add trace logging too
William Pitcock a6755cd7 2017-02-04T18:46:53 libpkgconf: client: add pkgconf_warn()
William Pitcock eb98a1e6 2017-02-04T18:46:33 libpkgconf: client: clean up various aspects of error/warn handlers
William Pitcock d884dc46 2017-02-04T18:41:16 libpkgconf: client: ensure error/warn handlers always have a sane default instead of actually NULL
William Pitcock c0b6a62c 2017-02-04T18:37:58 libpkgconf: client: add warn handler and getter/setter for both warn handler and error handler
William Pitcock 42d65b14 2017-02-01T13:03:06 libpkgconf: client: add INCLUDE environment to the cflags path filter list on windows
William Pitcock ced4f003 2017-01-19T19:16:00 libpkgconf: client: add pkgconf_client_[get|set]_prefix_varname()
William Pitcock 597c3c7f 2017-01-19T17:22:20 libpkgconf: client: add pkgconf_client_t.flags and a get/set interface for it
William Pitcock 23050315 2016-12-30T11:13:04 libpkgconf: path: make the duplicate filtering opt-in. some path lists should not be deduped (compiler path lists, for example)
William Pitcock c916e3a4 2016-12-30T02:39:18 libpkgconf: client: filter all of the path-related GCC environment variables listed in the GCC manual (not just the ones in pkg-config)
William Pitcock 1ece862e 2016-12-30T02:35:36 libpkgconf: client: some toolchains have C_INCLUDE_PATH and CPLUS_INCLUDE_PATH, treat them as PKG_CONFIG_SYSTEM_INCLUDE_PATH.
William Pitcock cd0160a4 2016-12-21T19:54:32 libpkgconf: handle PKG_CONFIG_SYSTEM_INCLUDE_PATH and PKG_CONFIG_SYSTEM_LIBRARY_PATH environment variables at client init time
William Pitcock 21a6d6cd 2016-12-15T22:33:22 libpkgconf: client: set the error handler to default error handler if NULL was provided for the error handler
William Pitcock 568e5bfd 2016-12-15T22:33:01 libpkgconf: client: move pkgconf_error() and pkgconf_default_error_handler() here
William Pitcock 48717195 2016-12-13T12:06:24 libpkgconf: client: fix doc strings up
Graham Ollis fa876089 2016-12-13T13:03:59 pass client and user data to error handler (#100)
William Pitcock 91fbf683 2016-12-10T18:35:17 libpkgconf: document client module
William Pitcock 38e95985 2016-12-09T21:08:53 libpkgconf: client: initialize sysroot and buildroot dirs to reasonable defaults
William Pitcock 02ec215e 2016-12-09T20:41:39 client: introduce pkgconf_client_t.buildroot_dir and pkgconf_client_t.sysroot_dir members This adds buildroot and sysroot dir members to the pkgconf client structure, which will allow us to replace the suboptimal PKGCONF_PKG_PKGF_MUNGE_SYSROOT_PREFIX code.
William Pitcock 3ba3aae7 2016-12-02T00:48:26 libpkgconf: client: clean up cache
William Pitcock 011d8c77 2016-12-02T00:34:48 libpkgconf: audit: migrate to pkgconf_client_t
William Pitcock e7f48465 2016-12-02T00:04:43 libpkgconf: path: add cleanup functions
William Pitcock b7984a79 2016-12-01T15:31:09 libpkgconf: commit missing client.c