Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No system package for njson #1879

Open
dadav opened this issue Jun 11, 2022 · 1 comment
Open

No system package for njson #1879

dadav opened this issue Jun 11, 2022 · 1 comment

Comments

@dadav
Copy link

dadav commented Jun 11, 2022

Hello ppl. from the internet,

I'm running archlinux with kernel 5.18.3-arch1-1 and couldn't build sysdig with my system libraries because there is no system package for njson. Using USE_BUNDLED_DEPS=ON also doesn't work because of some GSASL ERROR, see here: falcosecurity/falco#2040

I used the following commands

mkdir build
cd build
cmake .. -DBUILD_BPF=ON -DUSE_BUNDLED_DEPS=OFF
make -j12 sysdig

To make this thing work, I need to modify the cmake/modules/nlohmann-json.cmake file to basically exclude this library from the USE_BUNDLED_DEPS=OFF option...like this:

if(NOT USE_BUNDLED_DEPS)
  find_path(NJSON_INCLUDE_DIR NAMES nlohmann/json.hpp)
  if(NJSON_INCLUDE_DIR)
    message(STATUS "Found njson: include: ${NJSON_INCLUDE_DIR}")
  else()
    message(FATAL_ERROR "Couldn't find system njson")
  endif()
else()
  set(NJSON_SRC "${PROJECT_BINARY_DIR}/njson-prefix/src/njson")
  message(STATUS "Using bundled nlohmann-json in '${NJSON_SRC}'")
  set(NJSON_INCLUDE_DIR "${NJSON_SRC}/single_include")
  ExternalProject_Add(
    njson
    URL "https://github.com/nlohmann/json/archive/v3.3.0.tar.gz"
    URL_HASH "SHA256=2fd1d207b4669a7843296c41d3b6ac5b23d00dec48dba507ba051d14564aa801"
    CONFIGURE_COMMAND ""
    BUILD_COMMAND ""
    INSTALL_COMMAND "")
endif()

to

  set(NJSON_SRC "${PROJECT_BINARY_DIR}/njson-prefix/src/njson")
  message(STATUS "Using bundled nlohmann-json in '${NJSON_SRC}'")
  set(NJSON_INCLUDE_DIR "${NJSON_SRC}/single_include")
  ExternalProject_Add(
    njson
    URL "https://github.com/nlohmann/json/archive/v3.3.0.tar.gz"
    URL_HASH "SHA256=2fd1d207b4669a7843296c41d3b6ac5b23d00dec48dba507ba051d14564aa801"
    CONFIGURE_COMMAND ""
    BUILD_COMMAND ""
    INSTALL_COMMAND "")

Proposal

Add a cmake option to exclude njson from the USE_BUNDLED_DEPS=OFF effects.

What do you think?

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Feb 22, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 2, 2023
@therealbobo therealbobo reopened this Mar 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants