From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id sCxqOzDqRGZ4CAAAe85BDQ:P1 (envelope-from ) for ; Wed, 15 May 2024 19:00:33 +0200 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id sCxqOzDqRGZ4CAAAe85BDQ (envelope-from ) for ; Wed, 15 May 2024 19:00:33 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=WKI7XSJS; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1715792432; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=WIErx2hYyODB3qog9wxnOjRBZAlOLABbdm1cBK3xluY=; b=u56F9XyGeYfmx5xdyzXRm3WyNxYZDCxx22LzDnq2AyDwYyscKzkWvwfbaFIc41CkVmcWKo Wzxv/pM/3142OlV2I+r+KFoCnySESa6hzsZD3+8jaXro2NDhAoE6DY7TKOSh7Mhqhvz4Ym P9m2f7k1ZAKAPwzF/p0Xjf8GEFagWofTwnt8N3jIy0b2wdkDMym/LxMLuQYFE1ZXlF2w5X qRhhpjrNi4XP/gRdAdyv98GltEOIKj0gc6DYdWY0e3lp9q4z2R4ib3lo6x/M94MYu3IF96 FIVZX8O6zFOawhSP0rg9FlldktfGC9u50EtThAHtG+m0lqhMAHwBvcMAhdhmQg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=WKI7XSJS; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1715792432; a=rsa-sha256; cv=none; b=FVKFuLC/S1imLOSIniPKhPPb/exYdNfVtuUmktUsT1lv10C0y/gRme6cz8A3v1/vMkviGg /VNVNRC5XKxueimChoH0RuMxWk403IOqAggLDez3waQ2Y5xzFMO0VJTM0lk+BxEeo8i+HO LlcLj/ZW8gswEpMEykgNaxYCB88jjSpGZMGAXF900AUMAKegL2vy8Kz63R7yuJLhdiZhvj 2t7P9xw1wYDDTED0jNa5WD9wIMzEJHF3OTCKSrDXmDCiOZ78vek5o/czQpdKo4YmPymrdu 2Kf2w/ObLQuT7C0XnFfR8ez9VaHMynrFUR/fVE90KpJo9yQnHf1FXDVE22cwSg== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id B0BAA51563 for ; Wed, 15 May 2024 19:00:32 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s7HzB-0001rF-Rf; Wed, 15 May 2024 13:00:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s7Hz1-0001nH-V2 for guix-patches@gnu.org; Wed, 15 May 2024 13:00:05 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s7Hz1-0007Fe-CH for guix-patches@gnu.org; Wed, 15 May 2024 13:00:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s7Hz3-0007Br-21 for guix-patches@gnu.org; Wed, 15 May 2024 13:00:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70962] [PATCH 07/14] gnu: Add sysdig. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 15 May 2024 17:00:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70962 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70962@debbugs.gnu.org Cc: Maxim Cournoyer Received: via spool by 70962-submit@debbugs.gnu.org id=B70962.171579236727481 (code B ref 70962); Wed, 15 May 2024 17:00:05 +0000 Received: (at 70962) by debbugs.gnu.org; 15 May 2024 16:59:27 +0000 Received: from localhost ([127.0.0.1]:43161 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s7HyQ-00078y-6i for submit@debbugs.gnu.org; Wed, 15 May 2024 12:59:26 -0400 Received: from mail-qt1-f175.google.com ([209.85.160.175]:47193) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s7HyN-00078I-Ag for 70962@debbugs.gnu.org; Wed, 15 May 2024 12:59:24 -0400 Received: by mail-qt1-f175.google.com with SMTP id d75a77b69052e-43df7f42ac9so41523571cf.2 for <70962@debbugs.gnu.org>; Wed, 15 May 2024 09:59:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715792295; x=1716397095; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WIErx2hYyODB3qog9wxnOjRBZAlOLABbdm1cBK3xluY=; b=WKI7XSJS41foFGSEbH4iU4XTs6XT8BzELDsBFr4FKH6QB5UlZr+wa19KkuIRNp7C8A t7RD6JV6xSiIguIxY8NOnCMDVhQfAIaysicSTZEhAWezLaM/ETVSoChmybmQF/4zUa4X w5coxVvtyhIS4Yp8SKLOJ7JZNdR0hR/1jJjSupIB+iQrlU4Jg5HxLo5gKFBxGwAI26cT MmjfY1UBwi9J1GtyvvZE4hMi9H/+/uko+7D2DzjjTVmibO4vJNvgOmJejlh4cImIvGnC IWLwW2OdauK/GE7dippZnGp7x3Du0xiNTIV3LNUD9vLbHgoJP+pRQauC7+11Foo4cJaf TwHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715792295; x=1716397095; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WIErx2hYyODB3qog9wxnOjRBZAlOLABbdm1cBK3xluY=; b=QtyDLyq6BnPBo6j/3A88Dz/bo4fgZEnGfqZSS2pY3Hz8AQObMZ4ua9EMams1k3Kd43 j3trsjI8FJ4/5xJb5yZeIBYSG6mrCa8oV0HiEouy/106rVUMr92w5NW9HwcqcDQl4+dO PQni1xvIA722bJ81M1lvmbT9F5E241+NsJ38xryFTSREeiyIkJ0PZw1jzKUsUacmVdkX KpIh58PmnQ7l7HKD6oz/iqUgjgfYsTfqZ33+6/RdCJw5wkawGMv8BD2lWktAie0HEqKw LFj2sUb5rYNMfJKvs21Ol2DoB6LsW3wDAWl9Wwgv01TusnZL9qgil2UxadJlqEgZUy+S Laeg== X-Gm-Message-State: AOJu0YyCBjpS1Cds5LktAL4ggFuKUSmuLaauN8SaEuu5tAsuuHPxtoxm mR4xAso7IXVd71BGEtPTCk1IuT1SNQWoxs/gkN9U7zCY8R/1IAu1VgXwQA== X-Google-Smtp-Source: AGHT+IFyoRjNiRzLQ30PB4T8+av+RVM4fMoN/re+ZFQGa4V52ymvUxOq5AvHefZXXQgakV/XlaPC7A== X-Received: by 2002:a05:6214:5f02:b0:6a0:a9dc:b117 with SMTP id 6a1803df08f44-6a1680bf323mr187953286d6.0.1715792295411; Wed, 15 May 2024 09:58:15 -0700 (PDT) Received: from localhost.localdomain (dsl-205-233-125-107.b2b2c.ca. [205.233.125.107]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6a15f194871sm66068896d6.59.2024.05.15.09.58.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 May 2024 09:58:15 -0700 (PDT) From: Maxim Cournoyer Date: Wed, 15 May 2024 12:57:17 -0400 Message-ID: <60acdbbfc5a30227d034368905fb8567c917156b.1715791830.git.maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <7cf609dcf83c85b6897c9fb9af46ce8a854a15c8.1715791830.git.maxim.cournoyer@gmail.com> References: <7cf609dcf83c85b6897c9fb9af46ce8a854a15c8.1715791830.git.maxim.cournoyer@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: 4.63 X-Spam-Score: 4.63 X-Migadu-Queue-Id: B0BAA51563 X-Migadu-Scanner: mx13.migadu.com X-TUID: 66drk+svlt0k * gnu/packages/admin.scm (sysdig): New variable. * gnu/packages/patches/sysdig-shared-falcosecurity-libs.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. Change-Id: I02b64db7a548e17ea83beb1ea27db87d29e99cf1 --- gnu/local.mk | 1 + gnu/packages/admin.scm | 58 +++++++++++++++ .../sysdig-shared-falcosecurity-libs.patch | 71 +++++++++++++++++++ 3 files changed, 130 insertions(+) create mode 100644 gnu/packages/patches/sysdig-shared-falcosecurity-libs.patch diff --git a/gnu/local.mk b/gnu/local.mk index bb7dfa0b12..81960e1c9b 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -2076,6 +2076,7 @@ dist_patch_DATA = \ %D%/packages/patches/slim-login.patch \ %D%/packages/patches/slim-display.patch \ %D%/packages/patches/stex-copy-from-immutable-store.patch \ + %D%/packages/patches/sysdig-shared-falcosecurity-libs.patch \ %D%/packages/patches/syslinux-gcc10.patch \ %D%/packages/patches/syslinux-strip-gnu-property.patch \ %D%/packages/patches/snappy-add-O2-flag-in-CmakeLists.txt.patch \ diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index 22a2c12244..c36e41cbce 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -114,6 +114,7 @@ (define-module (gnu packages admin) #:use-module (gnu packages c) #:use-module (gnu packages check) #:use-module (gnu packages compression) + #:use-module (gnu packages cpp) #:use-module (gnu packages crates-graphics) #:use-module (gnu packages crates-io) #:use-module (gnu packages crates-windows) @@ -5722,6 +5723,63 @@ (define-public seatd that require it.") (license license:expat))) +(define-public sysdig + ;; Use the latest commit for now, as the latest 0.36.1 release does not yet + ;; support the falcosecurity-libs 0.16 API. + (let ((commit "598ad292b659425e475e5814d9e92c3c29188480") + (revision "0")) + (package + (name "sysdig") + (version (git-version "0.36.1" revision commit)) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/draios/sysdig") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0yyins3rb286dfibadfwwp2gwmdj7fsz3pdkpdvx05yvdqfkqds7")) + (patches + (search-patches "sysdig-shared-falcosecurity-libs.patch")))) + (build-system cmake-build-system) + (arguments + (list #:tests? #f ;no test suite + #:configure-flags + #~(list "-DUSE_BUNDLED_DEPS=OFF" + ;; Already built and part of falcosecurity-libs, but + ;; needed for the 'HAS_MODERN_BPF' define. + "-DBUILD_SYSDIG_MODERN_BPF=ON" + #$(string-append "-DSYSDIG_VERSION=" version)))) + (native-inputs (list pkg-config)) + (inputs + (list falcosecurity-libs + luajit + ncurses + nlohmann-json + yaml-cpp + zlib)) + (home-page "https://github.com/draios/sysdig") + (synopsis "System exploration and troubleshooting tool") + (description "Sysdig is a simple tool for deep system visibility, with +native support for containers. It combines features of multiple system +administration tools such as the @command{strace}, @command{tcpdump}, +@command{htop}, @command{iftop} and @command{lsof} into a single interface. +The novel architecture of the tool means that the performance impact of the +tracing on the system is very light, compared to the likes of +@command{strace}. The @command{sysdig} command has an interface similar to +@command{strace}, while the @command{csysdig} command is better suited for +interactive used, and has a user interface similar to @command{htop}. + +If you use Guix System, the kernel Linux has @acronym{BPF, Berkeley Packet +Filter} support, and you should launch this tool using the @samp{--modern-bpf} +argument of the @command{sysdig} or @command{csysdig} commands. The following +Bash alias can be added to your @file{~/.bash_profile} file: + +sysdig=sysdig --modern-bpf alias cysdig=csysdig --modern-bpf +") ;XXX no @example Texinfo support + (license license:asl2.0)))) + (define-public fail2ban (package (name "fail2ban") diff --git a/gnu/packages/patches/sysdig-shared-falcosecurity-libs.patch b/gnu/packages/patches/sysdig-shared-falcosecurity-libs.patch new file mode 100644 index 0000000000..aaa3417f18 --- /dev/null +++ b/gnu/packages/patches/sysdig-shared-falcosecurity-libs.patch @@ -0,0 +1,71 @@ +Upstream status: https://github.com/draios/sysdig/pull/2093 + +diff --git a/cmake/modules/falcosecurity-libs.cmake b/cmake/modules/falcosecurity-libs.cmake +index 7cee8a3c4..dd59c1b32 100644 +--- a/cmake/modules/falcosecurity-libs.cmake ++++ b/cmake/modules/falcosecurity-libs.cmake +@@ -16,6 +16,19 @@ + # limitations under the License. + # + ++option(USE_BUNDLED_FALCOSECURITY_LIBS "Enable building of the bundled falcosecurity libraries" ${USE_BUNDLED_DEPS}) ++ ++if(NOT USE_BUNDLED_FALCOSECURITY_LIBS) ++ find_package(PkgConfig REQUIRED) ++ pkg_check_modules(LIBSINSP REQUIRED IMPORTED_TARGET libsinsp) ++ message(STATUS "Found libsinsp: ++ include: ${LIBSINSP_INCLUDE_DIRS} ++ lib: ${LIBSINSP_LIBRARIES} ++ cflags: ${LIBSINSP_CFLAGS}") ++ return() ++endif() ++ ++# else(): using bundled falcosecurity libs + set(FALCOSECURITY_LIBS_CMAKE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/falcosecurity-libs-repo") + set(FALCOSECURITY_LIBS_CMAKE_WORKING_DIR "${CMAKE_BINARY_DIR}/falcosecurity-libs-repo") + +diff --git a/userspace/sysdig/CMakeLists.txt b/userspace/sysdig/CMakeLists.txt +index 60f8072ad..86edfc91c 100644 +--- a/userspace/sysdig/CMakeLists.txt ++++ b/userspace/sysdig/CMakeLists.txt +@@ -20,7 +20,6 @@ if(NOT WIN32) + include(ncurses) + endif() # NOT WIN32 + +-include(zlib) + include(luajit) + + include_directories("${PROJECT_BINARY_DIR}/userspace/sinspui") +@@ -108,7 +107,7 @@ if(NOT WIN32) + include_directories(${PROJECT_BINARY_DIR}/driver/src) + + target_link_libraries(sysdig +- sinsp ++ $,sinsp,PkgConfig::LIBSINSP> + "${LUAJIT_LIB}" + "${YAMLCPP_LIB}") + +@@ -117,7 +116,7 @@ if(NOT WIN32) + endif() + + target_link_libraries(csysdig +- sinsp ++ $,sinsp,PkgConfig::LIBSINSP> + "${LUAJIT_LIB}" + "${CURSES_LIBRARIES}" + "${YAMLCPP_LIB}") +@@ -140,12 +139,12 @@ else() + add_definitions(-DNOCURSESUI) + + target_link_libraries(sysdig +- sinsp ++ $,sinsp,PkgConfig::LIBSINSP> + "${LUAJIT_LIB}" + "${YAMLCPP_LIB}") + + target_link_libraries(csysdig +- sinsp ++ $,sinsp,PkgConfig::LIBSINSP> + "${LUAJIT_LIB}" + "${YAMLCPP_LIB}") + -- 2.41.0