Skip to content

Conversation

craigcomstock
Copy link
Contributor

No description provided.

…bundle-fix/3.21.x

examples/services: Fix service_bundle example (3.21)
@craigcomstock craigcomstock marked this pull request as draft September 22, 2025 22:08
victormlg and others added 8 commits September 23, 2025 11:24
The function 'strchrnul' has been marked as being introduced in macOS
15.4, although it seems to have been working for as long as we have been
testing on macOS. Since warnings are treated as errors, the build will
fail. Hence, the simplest way to silence the warning is, it to specify
the deployment target to be a minimum of macOS 15.4.

```
logging.c:651:28: error: 'strchrnul' is only available on macOS 15.4 or newer [-Werror,-Wunguarded-availability-new]
  651 |         char *next_token = strchrnul(token, ',');
  CC       queue.lo
      |                            ^~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/_string.h:198:9: note: 'strchrnul' has been marked as being introduced in macOS 15.4 here, but the deployment target is macOS 15.0.0
  198 |         strchrnul(const char *__s, int __c);
  CC       rb-tree.lo
      |         ^
logging.c:651:28: note: enclose 'strchrnul' in a __builtin_available check to silence this warning
  651 |         char *next_token = strchrnul(token, ',');
      |                            ^~~~~~~~~
1 error generated.
```

It has been done similarly here: NorthernTechHQ/libntech#255

Signed-off-by: Victor Moene <victor.moene@northern.tech>
(cherry picked from commit f1c9a91)
(cherry picked from commit 6ae1a56)
Signed-off-by: Ole Herman Schumacher Elgesem <ole@northern.tech>
(cherry picked from commit 1486c24)

 Conflicts:
	.github/workflows/macos_unit_tests.yml

Use of librsync (cfengine#5629) was not cherry picked to 3.24.x

(cherry picked from commit d91eebd)

 Conflicts:
	.github/workflows/macos_unit_tests.yml

Had to adjust as 3.21 uses pcre not pcre2 as the commit from newer branch had.
Check for Homebrew if we're on Darwin and use brew's --prefix.

Ticket: CFE-4385
(cherry picked from commit 7e88d4b)

 Conflicts:
	.github/workflows/macos_unit_tests.yml
	configure.ac

using librsync (cfengine#5629) was not cherry-picked to 3.24.x so adjustments were needed.

(cherry picked from commit faf08d9)

 Conflicts:
	.github/workflows/macos_unit_tests.yml
	configure.ac

Needed some finesse as rsync and pcre2 were in commit and not used in 3.21.
The argument checking has been present for a while.
Interestingly 3 days ago there was a commit to silence many of these warnings: curl/curl@92f215f

Ticket: CFE-3429
Changelog: none
(cherry picked from commit c952969)
@cf-bottom
Copy link

Thank you for submitting a PR! Maybe @larsewi can review this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

6 participants