openziti / ziti-sdk-c

A C-based sdk for delivering secure applications over a Ziti Network
https://docs.openziti.io/docs/reference/developer/sdk/ziti-sdk-c
Apache License 2.0
71 stars 14 forks source link

Issues building library package for CentOS/RHEL 8 #261

Closed dvershinin closed 3 years ago

dvershinin commented 3 years ago

My first attempt at building a library package for ziti sdk shared library fails around libsodium. Since the distribution has already libsodium, I have installed libsodium-devel and essentially running cmake with -DHAVE_LIBSODIUM=ON however that fails with:

Unknown arguments specified

Whether I pass it as a cmd line option to make or change the option to default to ON in CMakeLists.txt, the same thing happens.

ekoby commented 3 years ago

can you post cmake command output?

dvershinin commented 3 years ago

Here's entire RPM build log starting from prep section where I do the necessary things in order to built from a github archive..

Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.UyXgJe
+ umask 022
+ cd /builddir/build/BUILD
+ cd /builddir/build/BUILD
+ rm -rf ziti-sdk-c-0.22.0
+ /usr/bin/gzip -dc /builddir/build/SOURCES/0.22.0.tar.gz
+ /usr/bin/tar -xof -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd ziti-sdk-c-0.22.0
+ /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ sed -i 's@DESTINATION lib@DESTINATION lib64@' CMakeLists.txt
+ sed -i /git.cmake/d CMakeLists.txt
+ sed -ri 's@.*HAVE_LIBSODIUM.*@option(HAVE_LIBSODIUM "use and link installed shared libsodium library" ON)@' CMakeLists.txt
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.LmHtwl
+ umask 022
+ cd /builddir/build/BUILD
+ cd ziti-sdk-c-0.22.0
+ export ver=0.22.0
+ ver=0.22.0
+ mkdir ./build
~/build/BUILD/ziti-sdk-c-0.22.0/build ~/build/BUILD/ziti-sdk-c-0.22.0
+ pushd ./build
+ cmake3 .. -DCMAKE_BUILD_TYPE=Release '-DCMAKE_CXX_FLAGS:STRING=-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' '-DCMAKE_C_FLAGS:STRING=-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -Wno-error=unused-result' -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_INSTALL_LIBDIR:PATH=/usr/lib64
CMake Warning at CMakeLists.txt:4 (project):
  VERSION keyword not followed by a value or was followed by a value that
  expanded to nothing.

-- The C compiler identification is GNU 8.3.1
-- The CXX compiler identification is GNU 8.3.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
project version: 
git info:
   branch : 
     hash : 
          date : 

using Unix Makefiles
cross-compiling FALSE
Project: ziti-sdk@v
using mbedTLS libraries
CMake Warning (dev) at build/_deps/mbedtls-src/CMakeLists.txt:5 (project):
  Policy CMP0048 is not set: project() command manages VERSION variables.
  Run "cmake --help-policy CMP0048" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

  The following variable(s) would be set to empty:

    PROJECT_VERSION
    PROJECT_VERSION_MAJOR
    PROJECT_VERSION_MINOR
    PROJECT_VERSION_PATCH
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found Python3: /usr/bin/python3.6 (found version "3.6.8") found components: Interpreter 
uvlink src = /builddir/build/BUILD/ziti-sdk-c-0.22.0/build/_deps/uv_link-src
CMake Error at CMakeLists.txt:73 (if):
  if given arguments:

    "STREQUAL" "main"

  Unknown arguments specified

-- Configuring incomplete, errors occurred!
See also "/builddir/build/BUILD/ziti-sdk-c-0.22.0/build/CMakeFiles/CMakeOutput.log".

RPM build errors:
error: Bad exit status from /var/tmp/rpm-tmp.LmHtwl (%build)
    Bad exit status from /var/tmp/rpm-tmp.LmHtwl (%build)
Finish: rpmbuild ziti-0.22.0-1.el8.src.rpm
Finish: build phase for ziti-0.22.0-1.el8.src.rpm
ERROR: Exception(ziti-0.22.0-1.el8.src.rpm) Config(gps-8-x86_64) 0 minutes 32 seconds
INFO: Results and/or logs in: .
ERROR: Command failed: 
 # bash --login -c /usr/bin/rpmbuild -bb --target x86_64 --nodeps /builddir/build/SPECS/ziti.spec