Commit Graph

1323 Commits (90232914cd2044ddc51b1515075f827c8e2e3f9b)

Author SHA1 Message Date
Dylan Baker 90232914cd ci: run meson test with the address sanitizer enabled
ci/woodpecker/pr/woodpecker Pipeline was successful Details
Set the ASAN_OPTION so that the exitcode is not 1, this avoids asan
returning the exitcode that the tests already expect from a normal
pkgconf error
2022-08-04 15:22:29 -07:00
Dylan Baker 576ef1b949 pkg: prevent circular ownership
Otherwise in a case where A references B, and B references A, A and B
will have mutual ownership of each other and prevent each other from
being free'd.
2022-08-04 15:21:52 -07:00
Dylan Baker d3237407c4 queue: free unused dependencies when flattening 2022-08-04 15:21:52 -07:00
Dylan Baker 3bcf96dd01 dependency: zero list after freeing 2022-08-04 15:19:19 -07:00
Dylan Baker 1ac1cb51af dependency: add debug information for dependency refcounting 2022-08-04 15:19:19 -07:00
Dylan Baker c8933409aa pkg: add name of pkg being refed/unrefed to debug outpu 2022-08-04 15:19:19 -07:00
Dylan Baker f083d8d448 queue: when collecting dependents don't iterate private twice
Currently, the private field is iterated collecting private deps and
normal deps. It should only be iterated when collecting private deps.
2022-08-04 15:19:14 -07:00
Dylan Baker 7c671b155d main: do cleanup when checking required version 2022-08-04 15:19:05 -07:00
Dylan Baker 7fe770bec7 pkg: use goto cleanup idiom 2022-08-04 15:19:05 -07:00
Dylan Baker b26f19cebf main: goto cleanup in validate case too
This fixes leaks in two tests
2022-08-04 15:19:05 -07:00
Dylan Baker 2133830c21 cache: clear the cache with pkgconf_cache_remove
Which results in more code re-use.
2022-08-04 15:19:05 -07:00
Dylan Baker 2b310c570f queue: when flattening do nothing if the flattened deps are empty 2022-08-04 15:19:05 -07:00
Dylan Baker 43d5328575 queue: unref dependency in all cases 2022-08-04 15:19:05 -07:00
Dylan Baker 04a3346b8e queue: ensure cleanup happens when applying 2022-08-04 15:19:05 -07:00
Dylan Baker 388bd61a61 dependency: Fix reference counting of dependency_addraw
We only want a reference to be added for the value inserted into the
list, not the one returned. The returned one is unowned until it reaches
the public dependency_add function, which returns an owned pointer
instead. This makes things semantically more correct.

Unfortunately, this means in a few cases we have to write some ugly
code like:
```c
pkgconf_dependency_t *dep = pkgcond_dependency_add("args");
pkgconf_dependency_unref(dep->owner, dep);
```
2022-08-04 15:19:05 -07:00
Dylan Baker e41e464152 cache: when removing a package from the cache unset the cached flag 2022-08-03 15:53:16 -07:00
Dylan Baker 01c3e6f8b5 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.
2022-08-03 15:53:16 -07:00
Dylan Baker 125a13d3b9 meson: add -Wmisleading-indentation
ci/woodpecker/pr/woodpecker Pipeline was successful Details
A useful warning when loop and conditional statements are allowed
without braces.
2022-08-03 12:03:15 -07:00
Dylan Baker 96c61cbab0 libpkgconf: remove trailing ; from macro definition
GCC has a lovely bug (which I will report as soon as I have an account),
which causes -Wmisleading-indentation to miss cases of misleading
indentation after a `;;`, since the macro adds `;`, and in call cases
the caller also adds `;`, we end up with a double macro and gcc fails to
warn.
2022-08-03 12:03:15 -07:00
Ariadne Conill a042827951 Merge pull request 'meson cleanups and fixes' (#240) from dcbaker/pkgconf:submit/meson-cleanups into master
ci/woodpecker/push/woodpecker Pipeline was successful Details
Reviewed-on: #240
2022-08-02 23:09:24 +00:00
Dylan Baker dd779ad9f8 meson: add check to run_command
ci/woodpecker/pr/woodpecker Pipeline was successful Details
Because we really should be checking that it succeeds, and because not
setting it is deprecated.
2022-08-01 09:40:08 -07:00
Dylan Baker c04097e491 meson: pass configured files idiomatically
Instead of attempting to figure out what the paths will be, take the
returned file object and pass that around, meson will then automatically
figure out the correct paths.
2022-08-01 09:40:08 -07:00
Dylan Baker 06fe2e23b0 meson: use current_source_dir and current_build_dir instead of *_root
The latter doesn't work correctly when being used as a subproject, as it
returns the *absolute* root. So if pkgconf is being built as part of
muon, then it will return muon's source root. current_source_dir, on the
other hand returns the directory correctly whether being built as a
subproject or superproject.
2022-08-01 09:40:08 -07:00
Dylan Baker 1f993bc095 meson: use string methods to avoid repeating data
Instead of writing `['HAVE_FOO_H', 'foo.h']`, use meson's string methods
to just write `['foo.h']`, and let meson create `HAVE_FOO_H` for us.
2022-08-01 09:40:08 -07:00
Dylan Baker f947af057f meson: use str.format for improved readability 2022-08-01 09:40:08 -07:00
Dylan Baker 5ba74dec93 meson: use straight indexing instead of array.get()
It's more terse, and we don't need the support of a fallback value.
2022-08-01 09:40:08 -07:00
Dylan Baker bf307c1d95 ci: set meson to build with -Werror
This will help catch any new warnings added in CI.
2022-08-01 09:40:08 -07:00
Dylan Baker 4a2c9c285f meson: use C99 as the standard
autoconf uses either C99 or Gnu99. Meson does not provide a graceful way
to select gnu99 if possible or c99 (though there are several proposals
currently happening to get there), so I've selected c99 as the
conservative default. Without this, the compiler uses whatever it's
default happens to be, which may or may not work out correctly, and
hides bugs from CI that are present with c99 as the default.
2022-07-29 10:23:18 -07:00
Dylan Baker 40ec08594e meson: add warning for implicit-function-declarations
This would be triggered without the previous addition of -D_BSD_SOURCE
for strdup, among others
2022-07-29 10:23:18 -07:00
Dylan Baker 71974d8c54 meson: Add _BSD_SOURCE and _DEFAULT_SOURCE
To avoid warnings about string functions like strdup which are otherwise
undefined, but succeed at linking anyway when the C standard is c99.
2022-07-29 10:23:02 -07:00
Ariadne Conill 918b660992 woodpecker: track debian testing for autoconf 2.71
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-07-26 18:15:50 +00:00
Ariadne Conill f93870efd9 tests: add testcase for legacy FDO rules plus pc_sysrootdir
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-07-26 18:05:31 +00:00
Ariadne Conill 18e2406002 tests: add omg-sysroot-uninstalled fixture 2022-07-26 18:03:15 +00:00
Ariadne Conill 6c70781aad introduce PKG_CONFIG_PKGCONF1_SYSROOT_RULES for legacy pkgconf behavior 2022-07-26 18:00:22 +00:00
Ariadne Conill f8aefea7ec pkg: add flags argument to pkgconf_pkg_new_from_file 2022-07-26 17:13:15 +00:00
Ariadne Conill 297e18f2c8 tuple: add flags parameter to pkgconf_tuple_parse 2022-07-26 17:08:48 +00:00
Ariadne Conill d9ec3ee642 tests: add testcases for confirming desired sysroot behavior regarding -uninstalled packages 2022-07-26 16:46:39 +00:00
Ariadne Conill b0802cb3d1 Revert "pkgconf_pkg_parser_value_set(): fix code-path ordering bug."
ci/woodpecker/push/woodpecker Pipeline was successful Details
This reverts commit 13fe4c8c58.
2022-06-26 19:41:31 +00:00
Ariadne Conill b602e33141 github actions: use debian testing
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-06-26 19:39:09 +00:00
Ariadne Conill 72e429ae70 tuple: use ${pc_sysrootdir} instead of client->sysroot_dir where relevant
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-06-26 19:35:19 +00:00
Ariadne Conill 7fa632a658 tests: sysroot: add additional tests 2022-06-26 19:34:54 +00:00
Ariadne Conill 9950312fde tests: add additional test fixtures 2022-06-26 19:34:39 +00:00
Ariadne Conill 19b1befb5d add additional sysroot testcase fixtures
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-06-26 19:21:52 +00:00
Ariadne Conill a61193c723 pkg: fix sysroot_dir logic for github 213
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-06-26 19:16:00 +00:00
Ariadne Conill d68a867dc0 tuple: fall back to using globals rather than preferring them 2022-06-26 19:15:07 +00:00
Ariadne Conill bc272e4e9f autoconf: run autoupdate
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-06-26 18:58:08 +00:00
Ariadne Conill 623b8f7851 tests: further fixups 2022-06-26 18:56:36 +00:00
Ariadne Conill fdd7d192e0 queue: fix ISO C conformance for fallthrough label
ci/woodpecker/push/woodpecker Pipeline failed Details
2022-06-26 18:39:00 +00:00
Ariadne Conill 11164376f7 main: handle --personality load failure
ci/woodpecker/push/woodpecker Pipeline failed Details
2022-06-26 18:34:22 +00:00
Ariadne Conill ab352222a2 tests: fix up some test changes from the solver optimizations
ci/woodpecker/push/woodpecker Pipeline failed Details
the output of pkgconf is basically functionally equivalent in both cases
2022-06-26 18:22:04 +00:00