Commit Graph

133 Commits (35b1a62314df6524f5fdc6f744df312ec747abc4)

Author SHA1 Message Date
Ariadne Conill 35b1a62314 update libpkgconf version to 10905
Signed-off-by: Ariadne Conill <ariadne@dereferenced.org>
2023-05-02 12:09:55 -07:00
Taylor R Campbell 212c85863a Avoid undefined behaviour with the ctype(3) functions.
ci/woodpecker/push/woodpecker Pipeline was successful Details
fix https://github.com/pkgconf/pkgconf/issues/291

As defined in the C standard:

        In all cases the argument is an int, the value of which shall
        be representable as an unsigned char or shall equal the value
        of the macro EOF.  If the argument has any other value, the
        behavior is undefined.

This is because they're designed to work with the int values returned
by getc or fgetc; they need extra work to handle a char value.

If EOF is -1 (as it almost always is), with 8-bit bytes, the allowed
inputs to the ctype(3) functions are:

        {-1, 0, 1, 2, 3, ..., 255}.

However, on platforms where char is signed, such as x86 with the
usual ABI, code like

        char *ptr = ...;
        ... isspace(*ptr) ...

may pass in values in the range:

        {-128, -127, -126, ..., -2, -1, 0, 1, ..., 127}.

This has two problems:

1. Inputs in the set {-128, -127, -126, ..., -2} are forbidden.

2. The non-EOF byte 0xff is conflated with the value EOF = -1, so
   even though the input is not forbidden, it may give the wrong
   answer.

Casting char to unsigned int first before passing the result to
ctype(3) doesn't help: inputs like -128 are unchanged by this cast,
because (on a two's-complement machine with 32-bit int and unsigned
int), converting the signed char with integer value -128 to unsigned
int gives integer value 2^32 - 128 = 0xffffff80, which is out of
range, and which is converted in int back to -128, which is also out
of range.

It is necessary to cast char inputs to unsigned char first; you can
then cast to unsigned int if you like but there's no need because the
functions will always convert the argument to int by definition.  So
the above fragment needs to be:

        char *ptr = ...;
        ... isspace((unsigned char)*ptr) ...

This patch changes unsigned int casts to unsigned char casts, and
adds unsigned char casts where they are missing.
2023-05-02 11:43:56 -07:00
Ariadne Conill f7305434eb libpkgconf: bump API version to 10904 2023-01-22 04:56:06 +00:00
Ariadne Conill 6a66b312b4 libpkgconf: increase API level to 10903 2022-08-16 19:49:42 +00:00
Ariadne Conill 80bc5ac3b9 tuple: if a global tuple is explicitly defined with --define-variable, prefer it
ci/woodpecker/push/woodpecker Pipeline was successful Details
fixes github #259
2022-08-16 19:39:05 +00:00
Ariadne Conill 5044491f43 queue: add function to free a compiled solution
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-08-16 19:27:35 +00:00
Ariadne Conill aa99ddf789 pkg: add Copyright and Maintainer fields
ci/woodpecker/push/woodpecker Pipeline was successful Details
These are helpful pieces of information for BOM documents
generated by pkgconf.
2022-08-11 15:52:33 +00:00
Ariadne Conill 69a3d458ef libpkgconf: revise API revision to 10902
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-08-08 09:59:50 +00:00
Ariadne Conill 7e9aa7e1fc pkg: do not break cycles across dependency lists
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-08-08 09:56:28 +00:00
Ariadne Conill 5b10a85a82 queue: add pkgconf_queue_solve API 2022-08-08 09:08:27 +00:00
Ariadne Conill d8d669f637 pkgconf 1.9.0.
ci/woodpecker/push/woodpecker Pipeline was successful Details
ci/woodpecker/tag/woodpecker Pipeline was successful Details
2022-08-07 04:47:04 +00:00
Ariadne Conill 1389aa05ba pkg: add pkgconf_pkg_t.license field
ci/woodpecker/push/woodpecker Pipeline was successful Details
The pkgconf_pkg_t.license field maps to the new License keyword, and
should be an SPDX license expression.
2022-08-07 04:21:22 +00: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 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 5817e8848f pkg: track the number of hits a package has gotten while solving for dependencies
ci/woodpecker/push/woodpecker Pipeline failed Details
2022-06-26 07:22:56 +00:00
Ariadne Conill 464672404e cache: refactor to use a continguous table and bsearch
ci/woodpecker/push/woodpecker Pipeline was successful Details
cache functions are the hottest part of the pkgconf code when
profiled, by removing the linked list for lookups, we can turn
lookups into an O(k) operation
2022-06-26 04:30:35 +00:00
Dylan Baker f5d6bb71f8 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.
2022-02-07 09:34:09 -08:00
Ariadne Conill 2b82a4f63e use a serial instead of PKGCONF_PKG_PROPF_SEEN 2021-10-07 00:27:32 -06:00
Ariadne Conill 7d8cc1e4ce dependency: add pkgconf_dependency_copy() 2021-10-06 13:13:34 -06:00
Ariadne Conill c547edd07f deconst the client on pkgconf_dependency_add() 2021-10-06 11:52:18 -06:00
Ariadne Conill 4144d506bb implement dependency refcounting 2021-10-06 11:48:37 -06:00
Ariadne Conill 8130dd159e dependency: add pkgconf_dependency_free_one 2021-10-06 11:29:18 -06:00
Stone Tickle d688a7bd03 implement pkgconf_cross_personality_deinit 2021-07-24 06:08:25 -05:00
Ariadne Conill fd1b8ccca6 main: if PKG_CONFIG_FDO_SYSROOT_RULES is set, or DESTDIR matches PKG_CONFIG_SYSROOT_DIRS, disable the automatic sysroot rewriting
Closes #205.
2021-03-18 06:22:11 -06:00
Ariadne Conill f9531ce9fe add support for pkgconf_cross_personality_t.want_default_pure 2021-03-18 06:02:00 -06:00
Ariadne Conill dd57abfe9f pkgconf 1.7.0. 2020-05-24 14:55:02 -06:00
Ariadne Conill 4fb7683c3e add support for the PKGCONF_PKG_PKGF_DONT_MERGE_SPECIAL_FRAGMENTS flag used in build2. 2020-05-24 14:40:47 -06:00
Ariadne Conill 48dc665ae3 personality: add support for WantDefaultStatic setting 2019-10-19 00:56:17 -05:00
Ariadne Conill 19aa93e371 prepare for pkgconf 2.0 development 2019-08-04 15:54:24 -05:00
Ariadne Conill c862e030cf pkgconf 1.6.3. 2019-07-12 06:53:37 -05:00
Ariadne Conill c816ce6969 pkgconf 1.6.2. (closes #38, #40, #41) 2019-07-11 03:50:00 -05:00
William Pitcock 2d0c1f5cb7 lite: disable debug logging 2019-05-06 15:17:08 -05:00
William Pitcock 3afd14c49e libpkgconf: path: use realpath(3) to deduplicate the search path
closes #24
2019-03-23 22:27:05 -05:00
William Pitcock 183e68df39 libpkgconf: add LIBPKGCONF_VERSION macro 2019-01-14 13:52:04 -06:00
William Pitcock 36a5b7acbd libpkgconf: fragment: add pkgconf_fragment_copy_list() 2019-01-14 13:48:02 -06:00
William Pitcock 40897f246b libpkgconf: personality: remove const from the default personality, since it's not really const 2018-05-09 22:52:27 -05:00
William Pitcock e6ce6c8edd libpkgconf: personality: fixups 2018-05-09 22:39:39 -05:00
William Pitcock 1244f8f8e7 libpkgconf: refactor out the rfc822 message parser so that the cross-personality code can share it 2018-05-09 21:21:39 -05:00
William Pitcock f702967d0a libpkgconf: pkg: refactor pkgconf_pkg_new_from_file to prepare to factor out the rfc822 parser 2018-05-09 19:56:30 -05:00
William Pitcock 6b0e346c28 libpkgconf: refactor building the dir lists into separate concerns 2018-05-09 17:07:26 -05:00
William Pitcock 854490c5b9 libpkgconf: add basic support for cross-compile personality objects 2018-05-09 16:54:21 -05:00
William Pitcock 43e8c7b44d libpkgconf: path: add path list copying function 2018-05-09 16:35:21 -05:00
William Pitcock 7e9ed6922d libpkgconf: pkg: skip over -I cflags from Requires.internal nodes when building a cflags list 2018-03-18 18:05:55 -05:00
William Pitcock ad65bc4a71 libpkgconf: dependency: allow dependency nodes to be colored with traits 2018-03-18 18:03:33 -05:00
TingPing 83eea876b0 meson: Fix defining PKGCONF_API (#174) 2018-03-06 23:27:54 -06:00
William Pitcock e0bf4009cb libpkgconf: pkg: rename pkgconf_pkg_t.requires to pkgconf_pkg_t.required (closes #154)
C++20 makes requires a keyword, so we need to not use it in headers.
2017-12-12 00:21:21 -06:00
William Pitcock 7274357565 libpkgconf: fragment: track merged fragments, as they should never be quoted 2017-12-10 00:39:39 -06:00
William Pitcock 19d91e90e5 libpkgconf: fragment: allow for overriding the default fragment rendering behaviour 2017-12-07 19:13:35 -06:00