net/ntpsec fails to build with ports-mgmt/synth

Hi,

I've been trying to switch from ports-mgmt/portmaster to ports-mgmt/synth for building ports,
Mostly synth works fine, thanks to those who suggested synth here.

However, there is a specific port which always fails to build with synth in my environments: net/ntpsec.
portmaster and making directly from ports would succeed with no issue.
Does anyone here got the same problem?
And if this is a bug of synth, where should I report it?
Thank you.
 
Can you turn DOCS on? Just for test, it builds on the FreeBSD clusters[*] with the option turned on. It might be that the error is caused because this option is disabled on your build. It should be fixed but the issue might have been missed because the option defaults to "ON".

[*] https://pkg-status.freebsd.org/beef...t/20261027_0121f370d86d/logs/ntpsec-1.2.6.log
Unfortunately the build still failed with DOCS option turned on. The tests failed are exactly the same as the log attached above.

And I noticed that FreeBSD clusters build the port with Poudriere instead of synth.
When I build ntpsec with portmaster or directly from ports, the build succeeded, so I would assume this issue is related to synth.
Also, according to the log attached above, the build itself succeeded, but tests failed. But I don't see any testing phase while building with portmaster or from ports.
Seems synth runs tests while portmaster doesn't?
 
This is a synth bug. The port builds and installs fine directly from the ports tree (/usr/ports/net/ntpsec).

With the help of a chatbot (Chatgpt) the issue was identified as the absence of certain udp/tcp services from /etc/services in the synth build environment.

According to the chatbot analysis of the net___ntpdsec.log [1], the port test requires /etc/services 123/udp and 123/tcp, which is missing in the synth build environments services file:
Code:
# env ENTERAFTER=build synth test net/ntpsec
Stand by, updating external repository catalogs ... done.
After inspection, it has been determined that there are no packages that
require rebuilding; the task is therefore complete.
Starting interactive build of net/ntpsec
Stand by, building up to the point requested ...
Entering interactive test mode at the builder root directory.
Type 'exit' when done exploring.
#
# cat /etc/services
ftp    21/tcp
ftp    21/udp
ssh    22/tcp
ssh    22/udp
http   80/tcp
http   80/udp
https 443/tcp
https 443/udp

Host:
Code:
# grep -e 123/udp -e 123/tcp /etc/services
ntp        123/tcp       #Network Time Protocol
ntp        123/udp       #Network Time Protocol

I managed to synth build net/ntpsec successfully, copying host /etc/services to the synth build environment during the synth fetch, extract, build phase [2].

There seems no permanent workaround, since the build environment under /usr/obj/synth-live/ is created and destroy without the possibility to influence the build environment.

If you want the problem solved, you need to open an issue on https://github.com/jrmarino/synth.


[1]
Chatgpt:
Code:
Two tests in tests/test_libntp fail:

    decodenetnum, Services — the test expects a service name to resolve, but the returned error is 9 (EBADF on FreeBSD).

    decodenetnum, IPv4AddressWithPort2 — the same error occurs while parsing an IPv4 address with a port.

The other 152 tests pass. The failure is concentrated in NTPsec's decodenetnum() networking tests, which exercise service-name and socket-address handling.


1. Most likely cause: the ntp service is missing from Synth's build environment

I checked the actual NTPsec 1.2.6 test source. It confirms the following:

    Services calls getaddrinfo(NULL, "ntp", NULL, &res).

    IPv4AddressWithPort2 parses 192.168.2.2:ntp and expects the service name to resolve to UDP port 123.

    The implementation of decodenetnum() explicitly requests SOCK_DGRAM and IPPROTO_UDP.
    GitHub
    +1

On FreeBSD, error code 9 is EAI_SERVICE: Service was not recognized for socket type. It is not EBADF, as I initially suggested.
GitHub
+1

The standard FreeBSD /etc/services contains ntp entries for both TCP and UDP port 123.


[2]
Code:
# synth build net/ntpsec
...
From another console:
Code:
# cp /etc/services  /usr/obj/synth-live/SL01/etc/
! Or  .../SL09/etc

Code:
# synth build net/ntpsec
...
The task is complete.  Final tally:
Initial queue size: 1
    packages built: 1
           ignored: 0
           skipped: 0
            failed: 0

Duration: 00:00:24

#
# ls /var/synth/live_packages/All/ | grep ntpsec
ntpsec-1.2.6.pkg
 
Back
Top