Skip to content

Commit

Permalink
fix(ci,userspace): install latest nlohmann json in install-deps script.
Browse files Browse the repository at this point in the history
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
  • Loading branch information
FedeDP committed Aug 22, 2024
1 parent a9a7f97 commit 451d94e
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
20 changes: 20 additions & 0 deletions .github/install-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,23 @@ popd
echo "=== Downloading uthash.h (1.9.8) ==="

wget -P "/usr/include" "https://raw.githubusercontent.com/troydhanson/uthash/v1.9.8/src/uthash.h"

# === Nlohmann json ===
echo "=== Building and installing njson v3.11.3 ==="

wget "https://github.com/nlohmann/json/archive/refs/tags/v3.11.3.tar.gz"

tar xzf v3.11.3.tar.gz
pushd json-3.11.3

mkdir -p build
cd build

cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DJSON_BuildTests=OFF \
../

make install -j
popd
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
steps:
- name: Install deps ⛓️
run: |
apt update && apt install -y --no-install-recommends ca-certificates cmake build-essential git clang llvm pkg-config autoconf automake libtool libelf-dev wget libc-ares-dev libcurl4-openssl-dev libssl-dev libtbb-dev libjq-dev nlohmann-json3-dev libgrpc++-dev protobuf-compiler-grpc libgtest-dev libprotobuf-dev linux-headers-${{ matrix.arch }}
apt update && apt install -y --no-install-recommends ca-certificates cmake build-essential git clang llvm pkg-config autoconf automake libtool libelf-dev wget libc-ares-dev libcurl4-openssl-dev libssl-dev libtbb-dev libjq-dev libgrpc++-dev protobuf-compiler-grpc libgtest-dev libprotobuf-dev linux-headers-${{ matrix.arch }}
- name: Checkout Libs ⤵️
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand Down
2 changes: 1 addition & 1 deletion userspace/libscap/engine/gvisor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ add_custom_command(
)

if(USE_BUNDLED_NLOHMANN_JSON)
add_dependencies(scap njson)
add_dependencies(scap nlohmann_json)
endif()

if (BUILD_SHARED_LIBS)
Expand Down
3 changes: 1 addition & 2 deletions userspace/libsinsp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ set(SINSP_PKGCONFIG_LIBRARIES
scap
"${ZLIB_LIB}"
"${CURL_LIBRARIES}"
nlohmann_json::nlohmann_json
"${RE2_LIB}"
)

Expand All @@ -195,7 +194,7 @@ if(USE_BUNDLED_RE2)
endif()

if(USE_BUNDLED_NLOHMANN_JSON)
add_dependencies(sinsp njson)
add_dependencies(sinsp nlohmann_json)
endif()

function(prepare_cri_grpc api_version)
Expand Down

0 comments on commit 451d94e

Please sign in to comment.