Cannot find source file: tipc.c while compiling on Debian 10

Hi,
I just run into a CMake error when I tried to compile swipl on Debian 10:


– Configuring done
CMake Error at packages/cmake/PrologPackage.cmake:145 (add_library):
Cannot find source file:

tipc.c

Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm
.hpp .hxx .in .txx
Call Stack (most recent call first):
packages/tipc/CMakeLists.txt:16 (swipl_plugin)

CMake Error at packages/cmake/PrologPackage.cmake:145 (add_library):
No SOURCES given to target: plugin_tipc
Call Stack (most recent call first):
packages/tipc/CMakeLists.txt:16 (swipl_plugin)


Where should I find tipc.c? I tried to search linux kernel source files but failed to see it.

Thanks for any help in advance.
Arthur Wang

tipc.c is simply part of the package source (packages/tipc/tipc.c). Did you checkout the submodule?

Thank you Jan.
I did ‘git submodule update —init’ under the source root. That’s not enough?

Jan Wielemaker via SWI-Prolog swiprolog@discoursemail.com 于2020年3月29日周日 下午4:38写道:

It seems ok now after I re-pulled the repository except http:proxy and ssl:ssl errors in ctest.
Than you very much!

Failing http:proxy is suspicious. Ssl is probably related to Debugging failing SSL test

Although ninja runs to end without panic stop, there are really some abnormal messages output in cmake as follows with filtering ‘not found’ and ‘Failed’:

-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads - not found
-- Looking for dl.h - not found
-- Looking for dmalloc.h - not found
-- Looking for floatingpoint.h - not found
-- Looking for ieeefp.h - not found
-- Looking for libloaderapi.h - not found
-- Looking for ncurses/curses.h - not found
-- Looking for ncurses/term.h - not found
-- Looking for shlobj.h - not found
-- Looking for sys/ndir.h - not found
-- Looking for sys/termio.h - not found
-- Looking for valgrind/valgrind.h - not found
-- Looking for vfork.h - not found
-- Looking for mach/thread_act.h - not found
-- Looking for crt_externs.h - not found
-- Looking for qsort_s - not found
-- Looking for stricmp - not found
-- Looking for strlwr - not found
-- Looking for mbcasescoll - not found
-- Looking for _NSGetEnviron - not found
-- Looking for shl_load - not found
-- Looking for sgttyb - not found
-- Looking for fpclass - not found
-- Looking for fpresetsticky - not found
-- Looking for fpsetmask - not found
-- Looking for localtime_s - not found
-- Looking for delay - not found
-- Looking for dossleep - not found
-- Performing Test SYS_CPUSET_H_FOUND - Failed
-- Looking for pthread_np.h - not found
-- Looking for pthread_getw32threadhandle_np - not found
-- Looking for sema_init - not found
-- Performing Test HAVE_PTHREAD_SETNAME_NP_WITH_TID_AND_ARG - Failed
-- Performing Test HAVE_GETTID_MACRO - Failed
-- Looking for WSAPoll - not found
-- Looking for WinExec - not found
-- Looking for socket in socket - not found
-- Looking for crypt - not found
-- Looking for io.h - not found
-- Performing Test HAVE_SET_RPC_SERVER - Failed
-- Performing Test HAVE_SET_SERVER - Failed
-- Looking for Security/Security.h - not found
-- Performing Test HAVE_KSECCLASS - Failed
-- Looking for CRYPTO_THREADID_get_callback - not found
-- Looking for CRYPTO_THREADID_set_callback - not found
-- Looking for OPENSSL_zalloc - not found
-- Performing Test HAVE_X509_VERIFY_PARAM_ID - Failed
-- Looking for frame.h - not found
-- Looking for siginfo.h - not found
-- Looking for bstring.h - not found
-- Looking for conio.h - not found
-- Looking for sys/access.h - not found
-- Looking for XmIsMotifWMRunning - not found

Would you please give me any hints to solve the test errors?
BTW, the openssl version is 1.1.1d that should be ok according to the reference you gave above.

$ openssl version
OpenSSL 1.1.1d  10 Sep 2019

With regards,
Arthur

It is pretty much the same list I see on Ubuntu 19.10. Most of the stuff are functions that once upon a time were commonly found or still exists on notably Windows and MacOS. No reason to panic. Failing tests are dubious in your case. Note that some of the HTTP and SSL tests test access to external servers and thus fail if you have no internet access from the box or only have HTTP using a proxy. You can disable these using

 USE_PUBLIC_NETWORK_TESTS=false ctest
1 Like

Just the same result:

97% tests passed, 2 tests failed out of 62

Total Test time (real) =  13.04 sec

The following tests FAILED:
	 38 - http:proxy (Failed)
	 62 - ssl:ssl (Failed)
Errors while running CTest

The good side is the built swipl works quite well now. I’ll do some research on the issue if necessary.

Thank you very much again for help.
With best wishes,
Arthur

1 Like

Thanks. First step (and likewise for ssl):

ctest -V -R http:proxy

Next step is (sometimes) to copy/paste the test command and run it in a terminal after removing -q from the command line to get more verbose output.

Here is the outputs:

/home/laowang/Downloads/swipl-devel/build/src/swipl "-p" "foreign=:/home/laowang/Downloads/swipl-devel/build/packages/clib:/home/laowang/Downloads/swipl-devel/build/packages/sgml:/home/laowang/Downloads/swipl-devel/build/packages/plunit:/home/laowang/Downloads/swipl-devel/build/packages/ssl:/home/laowang/Downloads/swipl-devel/build/packages/zlib" "-f" "none" "--no-packs" "-s" "/home/laowang/Downloads/swipl-devel/packages/http/test_proxy.pl" "-g" "test_proxy" "-t" "halt"
% PL-Unit: proxy
% Started server at http://localhost:36667/
ERROR: /home/laowang/Downloads/swipl-devel/packages/http/test_proxy.pl:418:
	test Direct connection for TCP: received error: SSL(140AB18F) SSL_CTX_use_certificate: ee key too small
ERROR: /home/laowang/Downloads/swipl-devel/packages/http/test_proxy.pl:429:
	test All connections via SOCKS: received error: Socket error: Address already in use
ERROR: /home/laowang/Downloads/swipl-devel/packages/http/test_proxy.pl:442:
	test Some TCP connections via SOCKS: received error: Socket error: Address already in use
ERROR: /home/laowang/Downloads/swipl-devel/packages/http/test_proxy.pl:460:
	test First try SOCKS then fall back to direct: received error: Socket error: Address already in use
ERROR: /home/laowang/Downloads/swipl-devel/packages/http/test_proxy.pl:474:
	test First try direct to a nonexistent-host then fall back to SOCKS: received error: Socket error: Address already in use
ERROR: /home/laowang/Downloads/swipl-devel/packages/http/test_proxy.pl:490:
	test All TCP connections via HTTP: received error: Socket error: Address already in use
.
ERROR: /home/laowang/Downloads/swipl-devel/packages/http/test_proxy.pl:515:
	test Request URL directly: received error: Socket error: Address already in use
ERROR: /home/laowang/Downloads/swipl-devel/packages/http/test_proxy.pl:527:
	test Request URL when all connections go via SOCKS: received error: Socket error: Address already in use
ERROR: /home/laowang/Downloads/swipl-devel/packages/http/test_proxy.pl:540:
	test Request URL when all connections go via HTTP: received error: Socket error: Address already in use
.
ERROR: /home/laowang/Downloads/swipl-devel/packages/http/test_proxy.pl:565:
	test Request HTTPS url via proxy - should get HTTP CONNECT and not HTTP GET: received error: Socket error: Address already in use
ERROR: /home/laowang/Downloads/swipl-devel/packages/http/test_proxy.pl:599:
	test Test an exotic application-level proxy - http with authentication: received error: Socket error: Address already in use
 done
% 11 tests failed
% 2 tests passed
ERROR: -g test_proxy: false

I seems like the address in use. The address in test is fixed?

ssl seems concerning with CA issue:

/home/laowang/Downloads/swipl-devel/build/src/swipl "-p" "foreign=:/home/laowang/Downloads/swipl-devel/build/packages/clib:/home/laowang/Downloads/swipl-devel/build/packages/sgml:/home/laowang/Downloads/swipl-devel/build/packages/http" "-f" "none" "--no-packs" "-s" "/home/laowang/Downloads/swipl-devel/packages/ssl/test_ssl.pl" "-g" "test_ssl" "-t" "halt"
% PL-Unit: ssl_options
ERROR: /home/laowang/Downloads/swipl-devel/packages/ssl/test_ssl.pl:181:
	test cert_mismatch: wrong answer (compared using ==)
ERROR:     Expected: 'key values mismatch'
ERROR:     Got:      'ee key too small'
ERROR: /home/laowang/Downloads/swipl-devel/packages/ssl/test_ssl.pl:187:
	test cert_mismatch: wrong answer (compared using ==)
ERROR:     Expected: 'key values mismatch'
ERROR:     Got:      'ee key too small'
ERROR: /home/laowang/Downloads/swipl-devel/packages/ssl/test_ssl.pl:194:
	test cert_mismatch: wrong answer (compared using ==)
ERROR:     Expected: 'key values mismatch'
ERROR:     Got:      'ee key too small'
..
ERROR: /home/laowang/Downloads/swipl-devel/packages/ssl/test_ssl.pl:217:
	test missing_key: wrong answer (compared using ==)
ERROR:     Expected: 'no private key assigned'
ERROR:     Got:      'ee key too small'
ERROR: /home/laowang/Downloads/swipl-devel/packages/ssl/test_ssl.pl:220:
	test missing_key: wrong answer (compared using ==)
ERROR:     Expected: 'no private key assigned'
ERROR:     Got:      'ee key too small'
 done
% PL-Unit: ssl_server
ERROR: /home/laowang/Downloads/swipl-devel/packages/ssl/test_ssl.pl:229:
	test server: received error: ssl:'_ssl_context'/4: file `'tests/test_certs/rootCA/cacert.pem'' does not exist
 done
% PL-Unit: ssl_keys
ERROR: /home/laowang/Downloads/swipl-devel/packages/ssl/test_ssl.pl:120:
	test private_key: received error: open/4: source_sink `'tests/test_certs/server-key.pem'' does not exist (No such file or directory)
ERROR: /home/laowang/Downloads/swipl-devel/packages/ssl/test_ssl.pl:124:
	test certificate: received error: open/4: source_sink `'tests/test_certs/server-cert.pem'' does not exist (No such file or directory)
ERROR: /home/laowang/Downloads/swipl-devel/packages/ssl/test_ssl.pl:130:
	test trip_private_public: received error: open/4: source_sink `'tests/test_certs/server-key.pem'' does not exist (No such file or directory)
ERROR: /home/laowang/Downloads/swipl-devel/packages/ssl/test_ssl.pl:141:
	test trip_private_public: received error: open/4: source_sink `'tests/test_certs/server-key.pem'' does not exist (No such file or directory)
ERROR: /home/laowang/Downloads/swipl-devel/packages/ssl/test_ssl.pl:153:
	test trip_public_private: received error: open/4: source_sink `'tests/test_certs/server-key.pem'' does not exist (No such file or directory)
 done
% PL-Unit: https_open . done
% PL-Unit: ssl_certificates
ERROR: /home/laowang/Downloads/swipl-devel/packages/ssl/test_ssl.pl:567:
	test Valid certificate, correct hostname in CN, signed by trusted CA: wrong answer (compared using ==)
ERROR:     Expected: [verified,verified]:true
ERROR:     Got:      []:error(error(existence_error(file,'tests/test_certs/rootCA/cacert.pem'),context(ssl:'_ssl_context'/4,A)))
ERROR: /home/laowang/Downloads/swipl-devel/packages/ssl/test_ssl.pl:570:
	test Valid certificate, correct hostname in SAN, signed by trusted CA: wrong answer (compared using ==)
ERROR:     Expected: [verified,verified]:true
ERROR:     Got:      []:error(error(existence_error(file,'tests/test_certs/rootCA/cacert.pem'),context(ssl:'_ssl_context'/4,A)))
ERROR: /home/laowang/Downloads/swipl-devel/packages/ssl/test_ssl.pl:573:
	test Valid certificate, incorrect hostname in CN, signed by trusted CA: wrong answer (compared using ==)
ERROR:     Expected: [hostname_mismatch,verified,verified]:true
ERROR:     Got:      []:error(error(existence_error(file,'tests/test_certs/rootCA/cacert.pem'),context(ssl:'_ssl_context'/4,A)))
ERROR: /home/laowang/Downloads/swipl-devel/packages/ssl/test_ssl.pl:576:
	test Valid certificate, incorrect hostname in SAN and CN, signed by trusted CA: wrong answer (compared using ==)
ERROR:     Expected: [hostname_mismatch,verified,verified]:true
ERROR:     Got:      []:error(error(existence_error(file,'tests/test_certs/rootCA/cacert.pem'),context(ssl:'_ssl_context'/4,A)))
ERROR: /home/laowang/Downloads/swipl-devel/packages/ssl/test_ssl.pl:579:
	test Valid certificate, correct wildcard hostname in SAN, signed by trusted CA: wrong answer (compared using ==)
ERROR:     Expected: [verified,verified]:true
ERROR:     Got:      []:error(error(existence_error(file,'tests/test_certs/rootCA/cacert.pem'),context(ssl:'_ssl_context'/4,A)))
ERROR: /home/laowang/Downloads/swipl-devel/packages/ssl/test_ssl.pl:582:
	test Valid certificate, incorrect wildcard hostname in SAN, signed by trusted CA: wrong answer (compared using ==)
ERROR:     Expected: [hostname_mismatch,verified,verified]:true
ERROR:     Got:      []:error(error(existence_error(file,'tests/test_certs/rootCA/cacert.pem'),context(ssl:'_ssl_context'/4,A)))
ERROR: /home/laowang/Downloads/swipl-devel/packages/ssl/test_ssl.pl:585:
	test Valid certificate, wildcard hostname in SAN with wildcard too high, signed by trusted CA: wrong answer (compared using ==)
... ...
(too long, looks like similar)

Thanks. This probably relates to this github issue: https://github.com/SWI-Prolog/packages-ssl/issues/153

Note that this merely breaks the tests that are not using long enough RSA keys. Applications can still safely use the SSL library (as long as they generate strong enough keys). At least, that is my current understanding.

Thank you Jan! Ok, then how about the proxy test issue?

The first one is caused by the same SSL issue. I guess the failing test doesn’t clean up properly and then the subsequent fail as they use the same address. The tests first try to bind 4 ports using to an OS selected port number. Then it releases these ports and run the tests using these ports. That should be fine as long as each test nicely cleans up (and nothing else on the same machine uses dynamically assigned ports).

Ok, I see now. Thank you very much for your time. :slightly_smiling_face:

With regards,
Arthur

Matt did this piece of magic as well. Both build and tests now passed in a Debian Buster VM!

1 Like

Wonderful!


100% tests passed, 0 tests failed out of 62

Total Test time (real) =   9.79 sec

Thank you and Matt very much !

Jan Wielemaker via SWI-Prolog swiprolog@discoursemail.com 于2020年4月1日周三 下午9:01写道:

1 Like