ENT-13168: Specified the deployment target to be macOS 15.4#255
ENT-13168: Specified the deployment target to be macOS 15.4#255larsewi merged 1 commit intoNorthernTechHQ:masterfrom
Conversation
b0bc1c3 to
9680abe
Compare
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>
|
There was an error syncing branches, see logs for details. |
craigcomstock
left a comment
There was a problem hiding this comment.
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?
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
@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 😉 |
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>
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)
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)
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)
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)
No description provided.