Edgio / hurl

http(s)+h2 server load tester

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Building 1.8.2 gives error in Centos

miranlau opened this issue · comments

I download 1.8.2 source code and try to build and install in Centos7 but get following compilation error, please help:

Linking C static library libnghttp2.a
[ 51%] Built target nghttp2
Scanning dependencies of target hurlcore
[ 53%] Building CXX object src/core/CMakeFiles/hurlcore.dir///ext/http_parser/http_parser.cc.o
[ 55%] Building CXX object src/core/CMakeFiles/hurlcore.dir///ext/hostcheck/hostcheck.cc.o
[ 56%] Building CXX object src/core/CMakeFiles/hurlcore.dir///ext/base64/base64.cc.o
[ 58%] Building CXX object src/core/CMakeFiles/hurlcore.dir/evr/evr.cc.o
[ 60%] Building CXX object src/core/CMakeFiles/hurlcore.dir/evr/evr_select.cc.o
[ 62%] Building CXX object src/core/CMakeFiles/hurlcore.dir/support/ndebug.cc.o
[ 63%] Building CXX object src/core/CMakeFiles/hurlcore.dir/support/file_util.cc.o
[ 65%] Building CXX object src/core/CMakeFiles/hurlcore.dir/support/string_util.cc.o
[ 67%] Building CXX object src/core/CMakeFiles/hurlcore.dir/support/time_util.cc.o
[ 68%] Building CXX object src/core/CMakeFiles/hurlcore.dir/support/tls_util.cc.o
In file included from /home/centos/lmy/hurl-1.8.2/src/core/support/tls_util.cc:17:0:
/home/centos/lmy/hurl-1.8.2/src/core/support/tls_util.h:34:1: error: ‘int32_t’ does not name a type
int32_t tls_cleanup(void);
^
/home/centos/lmy/hurl-1.8.2/src/core/support/tls_util.h:35:1: error: ‘int32_t’ does not name a type
int32_t get_tls_options_str_val(const std::string a_options_str, long &ao_val);
^
/home/centos/lmy/hurl-1.8.2/src/core/support/tls_util.h:37:39: error: ‘int32_t’ was not declared in this scope
const char get_tls_info_protocol_str(int32_t a_version);
^
/home/centos/lmy/hurl-1.8.2/src/core/support/tls_util.h:38:1: error: ‘int32_t’ does not name a type
int32_t get_tls_info_protocol_num(SSL a_ssl);
^
/home/centos/lmy/hurl-1.8.2/src/core/support/tls_util.h:39:1: error: ‘int32_t’ does not name a type
int32_t validate_server_certificate(SSL a_tls, const char a_host, bool a_disallow_self_signed);
^
/home/centos/lmy/hurl-1.8.2/src/core/support/tls_util.cc: In function ‘const char
ns_hurl::get_tls_info_protocol_str(int32_t)’:
/home/centos/lmy/hurl-1.8.2/src/core/support/tls_util.cc:311:56: error: ‘const char
ns_hurl::get_tls_info_protocol_str(int32_t)’ redeclared as different kind of symbol
const char get_tls_info_protocol_str(int32_t a_version)
^
In file included from /home/centos/lmy/hurl-1.8.2/src/core/support/tls_util.cc:17:0:
/home/centos/lmy/hurl-1.8.2/src/core/support/tls_util.h:37:13: error: previous declaration of ‘const char
ns_hurl::get_tls_info_protocol_str’
const char *get_tls_info_protocol_str(int32_t a_version);
^
make[2]: *** [src/core/CMakeFiles/hurlcore.dir/support/tls_util.cc.o] Error 1
make[1]: *** [src/core/CMakeFiles/hurlcore.dir/all] Error 2
make: *** [all] Error 2
~/lmy/hurl-1.8.2

And my openssl version is:
[centos@onecloud-vm hurl-1.8.2]$ openssl version
OpenSSL 1.0.2k-fips 26 Jan 2017
[centos@onecloud-vm hurl-1.8.2]$

Thanks!

Looks like I'm missing an include for the fixed width types ie

#include <stdint.h>

Fixed in commit:
c86e7e9

Let me know if this fixes your build.

Thanks so much reaching out!

There are still error when building:

Linking C static library libnghttp2.a
[ 51%] Built target nghttp2
Scanning dependencies of target hurlcore
[ 53%] Building CXX object src/core/CMakeFiles/hurlcore.dir///ext/http_parser/http_parser.cc.o
[ 55%] Building CXX object src/core/CMakeFiles/hurlcore.dir///ext/hostcheck/hostcheck.cc.o
[ 56%] Building CXX object src/core/CMakeFiles/hurlcore.dir///ext/base64/base64.cc.o
[ 58%] Building CXX object src/core/CMakeFiles/hurlcore.dir/evr/evr.cc.o
[ 60%] Building CXX object src/core/CMakeFiles/hurlcore.dir/evr/evr_select.cc.o
[ 62%] Building CXX object src/core/CMakeFiles/hurlcore.dir/support/ndebug.cc.o
[ 63%] Building CXX object src/core/CMakeFiles/hurlcore.dir/support/file_util.cc.o
[ 65%] Building CXX object src/core/CMakeFiles/hurlcore.dir/support/string_util.cc.o
[ 67%] Building CXX object src/core/CMakeFiles/hurlcore.dir/support/time_util.cc.o
[ 68%] Building CXX object src/core/CMakeFiles/hurlcore.dir/support/tls_util.cc.o
[ 70%] Building CXX object src/core/CMakeFiles/hurlcore.dir/support/uri.cc.o
[ 72%] Building CXX object src/core/CMakeFiles/hurlcore.dir/support/nbq.cc.o
[ 74%] Building CXX object src/core/CMakeFiles/hurlcore.dir/support/trace.cc.o
[ 75%] Building CXX object src/core/CMakeFiles/hurlcore.dir/nconn/nconn.cc.o
[ 77%] Building CXX object src/core/CMakeFiles/hurlcore.dir/nconn/nconn_tcp.cc.o
In file included from /home/centos/lmy/hurl/src/core/nconn/nconn_tcp.h:15:0,
from /home/centos/lmy/hurl/src/core/nconn/nconn_tcp.cc:15:
/home/centos/lmy/hurl/src/core/nconn/nconn.h: In member function ‘int32_t ns_hurl::nconn::set_alpn_result(char*, uint32_t)’:
/home/centos/lmy/hurl/src/core/nconn/nconn.h:209:40: error: ‘free’ was not declared in this scope
free(m_alpn_buf);
^
/home/centos/lmy/hurl/src/core/nconn/nconn.h:212:54: error: ‘malloc’ was not declared in this scope
m_alpn_buf = (char *)malloc(a_buf_len);
^
make[2]: *** [src/core/CMakeFiles/hurlcore.dir/nconn/nconn_tcp.cc.o] Error 1
make[1]: *** [src/core/CMakeFiles/hurlcore.dir/all] Error 2
make: *** [all] Error 2
~/lmy/hurl

BTW @tinselcity is there some executable package that I can use directly? thanks.

It looks like CentOS isn't yet a support GitHub runner for GitHub actions:
see: https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources

We have Debian "debs" lying around for Ubuntu 20.04 and 18.04 I believe.

I have committed a fix for the missing:

#include <stdlib.h>

Commit: 10d1457

In the tcp connection class header.
Can you give it a try and see if you get further? I really appreciate these findings.

Thanks so much again!