Ziti-tunnel-sdk-c cmake build process doesn't pull in tertiary dependencies

Previously (February 2023), the ziti-tunnel-sdk-c build would automatically fetch and compile dependencies. Attempting a cross-compile build today (May 5th), the process fails, reporting:

using Unix Makefiles
cross-compiling FALSE
Project: tlsuv@v0.23.1
CMake Error at build-amd64/_deps/tlsuv-src/CMakeLists.txt:75 (find_package):
Could not find a package configuration file provided by "llhttp" with any
of the following names:

llhttpConfig.cmake
llhttp-config.cmake

Add the installation prefix of "llhttp" to CMAKE_PREFIX_PATH or set
"llhttp_DIR" to a directory containing one of the above files. If "llhttp"
provides a separate development package or SDK, be sure it has been
installed.

-- Configuring incomplete, errors occurred!
See also "/mnt/build-amd64/CMakeFiles/CMakeOutput.log".

Are there revised build instructions someone can point me to?

Resolving llhttp leads me to:

CMake Error at build-amd64/_deps/ziti-sdk-c-src/library/CMakeLists.txt:1 (find_package):
By not providing "Findunofficial-sodium.cmake" in CMAKE_MODULE_PATH this
project has asked CMake to find a package configuration file provided by
"unofficial-sodium", but CMake did not find one.

Could not find a package configuration file provided by "unofficial-sodium"
with any of the following names:

unofficial-sodiumConfig.cmake
unofficial-sodium-config.cmake

Add the installation prefix of "unofficial-sodium" to CMAKE_PREFIX_PATH or
set "unofficial-sodium_DIR" to a directory containing one of the above
files. If "unofficial-sodium" provides a separate development package or
SDK, be sure it has been installed.

Hi @tomc, Welcome to the community! Thanks for the feedback.

The ziti-tunnel-sdk-c repo is most definitely in a state of flux… The ziti-sdk-c was updated to use vcpkg and it’s causing a wee bit of churn for people, for sure. We don’t have anything written up yet, but I’m sure we can get you building again until we settle it out…

@scareything or @ekoby anything else you want to add?

@tomc what OS are you building on and targetting?

@TheLumberjack I’m building for ubuntu jammy amd64.

Thanks. I’ll get you a short list of commands after I make sure they work and shoot them over.

Ok here’s a condensed list of steps… I just used these locally.

export VCPKG_ROOT=/path/to/where/you/want/to/put/vcpkg
mkdir -p $VCPKG_ROOT
git clone git@github.com:microsoft/vcpkg.git $VCPKG_ROOT
sudo apt install zip -y
sudo apt-get install pkg-config -y
$VCPKG_ROOT/bootstrap-vcpkg.sh
cd /to/wherever/you/have/ziti-tunnel-sdk-c/
mkdir build
cd build
cmake --preset ci-linux-x64 ..
cmake build .

Note that cmake will now require you have env var VCPKG_ROOT and it’s expected that this is the root of the vcpkg checkout (as shown in the steps listed above). Stating the obvious, but most of these are ‘one-time’ steps you’ll need to run.

You can also read up on vcpkg presets if you’re interested or need to change away from the ‘ci-linux-x64’ preset. The first time you do this

Hope that helps!

fyi the file HACKING.md talks about the conventional way to define your own presets, which may inherit from the presets in CMakePresets.json. Note I’ve seen the "$comment" field confuse some versions of cmake, so I’d omit that line from your preset file.

Stumbled upon this very issue and lo- the answer be-ith here! I utilize a little utility I wrote for automation of openwrt building. (NetFoundry/Utilities/OpenZITI-OWRT at main · NicFragale/NetFoundry · GitHub) and I’ll be making the appropriate update there to it as well. Thanks for asking this @tomc, and thank you for the answer @TheLumberjack !

Hacking.md has been moved to https://github.com/openziti/ziti-sdk-c/blob/main/BUILD.md

1 Like