#53928 closed defect (fixed)
ntpsec @0.9.7: error: POSIX clock_settime(2) is required
| Reported by: | ryandesign (Ryan Carsten Schmidt) | Owned by: | lbschenkel (Leonardo Brondani Schenkel) |
|---|---|---|---|
| Priority: | Normal | Milestone: | |
| Component: | ports | Version: | |
| Keywords: | Cc: | 1-61803 | |
| Port: | ntpsec |
Description
ntpsec builds on Sierra but fails to build on El Capitan and earlier.
https://build.macports.org/builders/ports-10.11_x86_64-builder/builds/22564
../../libntp/clockwork.c:145:2: error: POSIX clock_gettime(2) is required
#error POSIX clock_gettime(2) is required
^
../../libntp/clockwork.c:132:19: warning: unused parameter 'tvs' [-Wunused-parameter]
struct timespec *tvs
^
1 warning and 1 error generated.
(clock_gettime was introduced in Sierra.)
Attachments (2)
Change History (14)
comment:1 Changed 9 years ago by danielluke (Daniel J. Luke)
comment:2 Changed 9 years ago by lbschenkel (Leonardo Brondani Schenkel)
Reported to upstream: https://gitlab.com/NTPsec/ntpsec/issues/261
comment:3 Changed 9 years ago by lbschenkel (Leonardo Brondani Schenkel)
ESR has replied saying that there is a fallback already and it should build: https://gitlab.com/NTPsec/ntpsec/issues/261#note_27103442
Unfortunately I don't have access to a pre-Sierra installation in order to diagnose why the existing fallback is not triggering. Anybody up for the task?
Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)
main.log from my 10.8 test vm
Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)
| Attachment: | config.log added |
|---|
config.log from my 10.8 test vm
comment:4 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)
I've attached log files from my 10.8 test VM in case that's helpful. ESR should be able to reproduce the issue by trying to build ntpsec 0.9.6 on any Mac with OS X 10.11 or earlier.
comment:5 Changed 9 years ago by 1-61803
| Cc: | 1-61803 added |
|---|
comment:6 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)
| Summary: | ntpsec @0.9.6: error: POSIX clock_gettime(2) is required → ntpsec @0.9.7: error: POSIX clock_settime(2) is required |
|---|
The error message in 0.9.6 was wrong; the error message was corrected in 0.9.7. It's clock_settime that's missing, not clock_gettime.
comment:7 Changed 8 years ago by lbschenkel (Leonardo Brondani Schenkel)
| Resolution: | → wontfix |
|---|---|
| Status: | new → closed |
Closing, upstream stated that they won't support old macOS versions below 10.12.
comment:8 Changed 8 years ago by ryandesign (Ryan Carsten Schmidt)
Then please modify the port to error out early with a friendlier error message. Something like:
pre-fetch {
if {${os.platform} eq "darwin" && ${os.major} < 16} {
ui_error "${name} @${version} requires macOS 10.12 or greater."
return -code error "incompatible macOS version"
}
}
comment:9 follow-up: 11 Changed 8 years ago by lbschenkel (Leonardo Brondani Schenkel)
| Resolution: | wontfix → fixed |
|---|
comment:10 Changed 8 years ago by lbschenkel (Leonardo Brondani Schenkel)
Thanks for the snippet. I have included it in the Portfile.
comment:11 Changed 16 months ago by barracuda156
Replying to lbschenkel:
This is not really a fix. Instead, clock_settime should be implemented in legacysupport.
comment:12 Changed 16 months ago by ryandesign (Ryan Carsten Schmidt)
It is really a fix, in that after this change the port would no longer fail to build with an unexpected error message MacPorts but would instead print a message explaining why the port cannot build.
It's not our job to second-guess developers' decisions about what OS versions they will support. If we can easily add or reintroduce support for an old OS without a large maintenance burden, great. If upstream will accept a change to add or reintroduce old OS support, even better. But it's also perfectly fine for a maintainer to configure a port to express the OS limitations intended by the developer.
Adding new OS functions to legacy support is nice to have and what I would consider going above and beyond the call of duty, but MacPorts contributors are not expected to have the knowledge to be able to do that. The expected resolution for ports that cannot build on an OS version is to indicate that the port cannot build on that OS version.
You've filed #71399 to add clock_settime to legacy support; further discussion of that can happen there.
The ntpsec port was later changed in 2018 in #56087 to support old systems again by reverting the upstream change. Our buildbot port health screen shows successful builds on Mac OS X 10.6 and later.

This really should be addressed upstream (but I suspect they'll be hesitant to do anything about it, since part of the point of the ntpsec project is to remove backwards compatibility that adds complexity and could hide security issues).