Skip to content

ENT-13168: Specified the deployment target to be macOS 15.4#255

Merged
larsewi merged 1 commit intoNorthernTechHQ:masterfrom
larsewi:macos
Aug 19, 2025
Merged

ENT-13168: Specified the deployment target to be macOS 15.4#255
larsewi merged 1 commit intoNorthernTechHQ:masterfrom
larsewi:macos

Conversation

@larsewi
Copy link
Contributor

@larsewi larsewi commented Aug 18, 2025

No description provided.

@larsewi larsewi changed the title Dummy commit to trigger GHActions ENT-13168: Dummy commit to trigger GHActions Aug 18, 2025
@larsewi larsewi changed the title ENT-13168: Dummy commit to trigger GHActions ENT-13168: Specified deployment target macOS 15.4 Aug 18, 2025
@larsewi larsewi changed the title ENT-13168: Specified deployment target macOS 15.4 ENT-13168: Specified the deployment target to be macOS 15.4 Aug 18, 2025
@larsewi larsewi force-pushed the macos branch 2 times, most recently from b0bc1c3 to 9680abe Compare August 18, 2025 12:14
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.
```

Ticket: ENT-13168
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
@larsewi larsewi marked this pull request as ready for review August 18, 2025 12:21
@mender-test-bot
Copy link

There was an error syncing branches, see logs for details.

@larsewi larsewi requested a review from craigcomstock August 18, 2025 12:21
Copy link
Contributor

@craigcomstock craigcomstock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we have to keep changing this hard coded value maybe? When other functions we use are introduced. Doesn't seem horrible but feels kind of weird.

Could we instead query what the latest is installed and hard-code for that?

https://github.com/actions/runner-images/blob/macos-15-arm64/20250811.2170/images/macos/macos-15-arm64-Readme.md#installed-sdks

mentions that 15.5 SDK is available as well as 26.0 (beta).

Maybe this command we could use to force the latest?

$ clang --version
Apple clang version 17.0.0 (clang-1700.0.13.5)
Target: x86_64-apple-darwin24.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

@larsewi
Copy link
Contributor Author

larsewi commented Aug 19, 2025

So we have to keep changing this hard coded value maybe? When other functions we use are introduced. Doesn't seem horrible but feels kind of weird.

@craigcomstock I guess we want to keep as much backwards compatibility as possible?

I think the background story here is that 'strchrnul' is a GNU extension that they added to macosx 15.4. We have this function in libntech/libcompat. So, that is probably why it has always worked for us? However, they probably recently added a check to warn against it when the compiler comes across it. I.e., if the deployment target is less than 15.4. Since we compile with -Werror, it causes the build to fail.

^ This is pure speculation though 😉

@larsewi larsewi merged commit b13dc7d into NorthernTechHQ:master Aug 19, 2025
6 checks passed
victormlg added a commit to victormlg/core that referenced this pull request Sep 2, 2025
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>
craigcomstock pushed a commit to craigcomstock/core that referenced this pull request Sep 22, 2025
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)
craigcomstock pushed a commit to craigcomstock/core that referenced this pull request Sep 23, 2025
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)
craigcomstock pushed a commit to craigcomstock/core that referenced this pull request Sep 23, 2025
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)
(cherry picked from commit 7498e8d)
craigcomstock pushed a commit to craigcomstock/core that referenced this pull request Sep 23, 2025
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants