Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cygwin compatibility #197

Open
FGasper opened this issue Dec 6, 2022 · 0 comments
Open

Cygwin compatibility #197

FGasper opened this issue Dec 6, 2022 · 0 comments

Comments

@FGasper
Copy link
Contributor

FGasper commented Dec 6, 2022

The test suite fails under Cygwin:

--------------- Start Output: 04-run-normal ------------------
!! FAILED !!     !! FAILED !!
DateRunEnd: 0
BaseName: 04-run-normal
Description: run drill and don't do anything fancy
DateRunStart: 0
--------------- Test Output ------------------
Error: @server ip could not be converted
exit code: 1
--------------- End Output: 04-run-normal ------------------
--------------- Start Output: 12-unit-tests-dnssec ------------------
!! FAILED !!     !! FAILED !!
DateRunEnd: 0
BaseName: 12-unit-tests-dnssec
Description: Run unit tests on dnssec.c
DateRunStart: 0
--------------- Test Output ------------------
--------- Start Pre Output -------------------
autoconf: /usr/bin/autoconf
autoheader: /usr/bin/autoheader
make: /cygdrive/c/Strawberry/c/bin/gmake
options:
config.status: creating 12-unit-tests-dnssec.Makefile
gmake[1]: Entering directory 'C:/cygwin64/home/cpanel/ldns/test/12-unit-tests-dnssec.o6zLo2'
gcc -I../.. -fno-strict-aliasing -Wunused-function -Wstrict-prototypes -Wwrite-strings -W -Wall -g -O2 -c ./12-unit-tests-dnssec.c
gcc -fno-strict-aliasing -Wunused-function -Wstrict-prototypes -Wwrite-strings -W -Wall -g -O2 -L../../.libs -o 12-unit-tests-dnssec 12-unit-tests-dnssec.o -lssl  -lcrypto -lldns
gmake[1]: Leaving directory 'C:/cygwin64/home/cpanel/ldns/test/12-unit-tests-dnssec.o6zLo2'
----------- End Pre Output -------------------
C:/cygwin64/home/cpanel/ldns/test/12-unit-tests-dnssec.o6zLo2/12-unit-tests-dnssec.exe: error while loading shared libraries: cygldns-3.dll: cannot open shared object file: No such file or directory
exit code: 127
--------------- End Output: 12-unit-tests-dnssec ------------------

All of the failures track with the above: either a) a failure to find cygldns-3.dll, or b) @server ip could not be converted.

A. cygldns-3.dll

This can be fixed by symlinking to the .libs directory from within the test directory. Alternatively, it could be fixed by making the test link to the static libldns.a rather than the dynamic library.

(NB: Cygwin lacks “rpath”, so it’s not possible to hard-code the path to cygldns-3.dll in the compiled executable.)

B. @server ip could not be converted

This comes from drill.c, which is calling ldns_resolver_new_frm_file but getting a failure. The failure isn’t reported very well, but that is its own problem.

The filename argument given to ldns_resolver_new_frm_file is NULL, which causes that function to look in /etc/resolv.conf—which doesn’t exist in Cygwin.

Assumedly, then, LDNS’s resolver just doesn’t work in Cygwin … ?

FGasper added a commit to FGasper/ldns that referenced this issue Dec 6, 2022
Issue NLnetLabs#197: Cygwin fails these tests because it’s dicey to link
dynamically to a library version that isn’t installed in the $PATH.
Rather than adding platform-specific logic, this changeset alters the
test suite to link statically rather than dynamically, which alleviates
the problem.

Notably, this doesn’t resolve all problems with Cygwin in the test suite;
other tests fail for other reasons. (See the GitHub issue for details.)
FGasper added a commit to FGasper/ldns that referenced this issue Dec 6, 2022
Issue NLnetLabs#197: Cygwin fails these tests because it’s dicey to link
dynamically to a library version that isn’t installed in the $PATH.
Rather than adding platform-specific logic, this changeset alters the
test suite to link statically rather than dynamically, which alleviates
the problem.

Notably, this doesn’t resolve all problems with Cygwin in the test suite;
other tests fail for other reasons. (See the GitHub issue for details.)
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

No branches or pull requests

1 participant