From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 2FkXEaBowGBjJQEAgWs5BA (envelope-from ) for ; Wed, 09 Jun 2021 09:07:12 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id wLVQDKBowGAmGwAAB5/wlQ (envelope-from ) for ; Wed, 09 Jun 2021 07:07:12 +0000 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 318BC1DB2E for ; Wed, 9 Jun 2021 09:07:11 +0200 (CEST) Received: from localhost ([::1]:35534 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lqsIv-0002gH-CW for larch@yhetil.org; Wed, 09 Jun 2021 03:07:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60298) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lqsIo-0002fs-QW for guix-patches@gnu.org; Wed, 09 Jun 2021 03:07:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48810) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lqsIo-0007Is-Ep for guix-patches@gnu.org; Wed, 09 Jun 2021 03:07:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lqsIo-0006id-8o for guix-patches@gnu.org; Wed, 09 Jun 2021 03:07:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#48889] [PATCH 4/4] bpftool: new package Resent-From: Ryan Sundberg Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 09 Jun 2021 07:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48889 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxime Devos Cc: 48889@debbugs.gnu.org Received: via spool by 48889-submit@debbugs.gnu.org id=B48889.162322237725773 (code B ref 48889); Wed, 09 Jun 2021 07:07:02 +0000 Received: (at 48889) by debbugs.gnu.org; 9 Jun 2021 07:06:17 +0000 Received: from localhost ([127.0.0.1]:60356 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lqsI1-0006hY-9x for submit@debbugs.gnu.org; Wed, 09 Jun 2021 03:06:17 -0400 Received: from mail.arctype.co ([138.68.9.245]:54603) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lqsHy-0006hK-Nt for 48889@debbugs.gnu.org; Wed, 09 Jun 2021 03:06:12 -0400 Received: from authenticated-user (mail.arctype.co [138.68.9.245]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.arctype.co (Postfix) with ESMTPSA id EB50611F07C; Wed, 9 Jun 2021 00:06:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arctype.co; s=mail; t=1623222365; bh=A0/Pc+yhzRil3ccEhXsL9vQ0xeMoOIAVb3WaV1XZ0Jk=; h=To:References:From:Cc:Subject:Date:In-Reply-To:From; b=Z75Ssh/slkotzzj1LbQpdTA8VSr8qRhDoePFKR8skBv/i5DmXjrECvswOaaKAlAiN EoDKPWNKyqxo4BhHAsnpxCFBHaUiefw8PhGai/N3aobAaWqXozkMUTsJmMhCVf+Z0X 51rCrN73GuqEoS+mlkuvk4m4DtJ8VFLlItn5SnM1BQ9JvH3TwKaMPW+4fwf25u3NOA drXmuIgbmwZkIc7QaCHaBPcIoUWEpPJF8ArBHG/10t32jJyQg/qRxPCor7hBbbmI5V BiSchY6x6MCXVvYlRP/AXS9pf5kDgvpVz72O3fV9la/9/NUV092u4qO8JsBgYJnRKT 1vLaeL5zVCd2w== References: <20210606185204.17617-1-ryan@arctype.co> <20210606185204.17617-4-ryan@arctype.co> <95c21dc7fa0e9c6864df06b307f3375d511847a8.camel@telenet.be> Message-ID: <9f6bfb31-ad8a-a45f-2c80-e4423647aa28@arctype.co> Date: Wed, 9 Jun 2021 00:06:04 -0700 MIME-Version: 1.0 In-Reply-To: <95c21dc7fa0e9c6864df06b307f3375d511847a8.camel@telenet.be> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="RzPwQE9kgMZatucz9vpko1JubAlfdZIec" 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" Reply-to: Ryan Sundberg X-ACL-Warn: , Ryan Sundberg via Guix-patches From: Ryan Sundberg via Guix-patches via X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1623222431; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: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=dwjKkNbbKtjIikxaKVe6UsffqZI3/ueT/WsrN+trpv8=; b=uGO11EuBKJBh2FX0ZCdbAEUx8oFOlj995MVoDEJ6TUmfWMU2oQ3hCDr5BXRI0MI21LbZTr /cGris3FpTgRefVR42QVyISp22Zy0DxuFH2ZUZ3q9ds+3tnFXoOoJZdZA6/RNcOoyNM6Qn FzsDWQ04L8M8eFfUqFJ6+OMuN40MiD4IOeb+Mel9kb+GDjeDof9siCY9c0cZI4vQzuopXg nzkZTLNjrkwk/FJAqRRYubqVCDfEljE4YPjAEOi+gCfTONbv98k3d52mscBZeBTQOCYBv9 dYbviRqzL7AYsWTEUcYMNjG1DSJ0hkVT/hH0OcD/c3jgWulx8Il62FD+I6szjQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1623222431; a=rsa-sha256; cv=none; b=Tb/JZuEgRgR513M9rkC6AYDT1lVqKt4bcX4P3Vce8EPRpuTjhWVVKH/8KovXZ04AQBq9Q3 2Hr9mfrNiJwYr3Uvo4U8zhQEPKvKr2GqqFU4nd2ir1BsgM/yifyy26+sEbVD25f/FU9e50 6XRLqrwh9Xxmmx1zrmJTwCbEHaoO5TyF8W+sXOkwW4D5Y/6GoE1YL/aqTUXfTJN8mzhgBf 3DNHAYGUt0AsSKwQYfZwYWek1/VrBjzbOk5LPAtWXfzbB7zAhP0TGrjzb3rIrpOvzlyq4y dX+bvluKBRGdFsmAyb1tZOXhciZtGS3gtcj/Y8IS2iUjV9rXevl5++jiK8HXIQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=arctype.co header.s=mail header.b="Z75Ssh/s"; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -5.03 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=arctype.co header.s=mail header.b="Z75Ssh/s"; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 318BC1DB2E X-Spam-Score: -5.03 X-Migadu-Scanner: scn1.migadu.com X-TUID: yggUJf5MkxTQ This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --RzPwQE9kgMZatucz9vpko1JubAlfdZIec Content-Type: multipart/mixed; boundary="ia0E5TvZq7M684atCJOCjoPtl5UtfU5wE"; protected-headers="v1" From: Ryan Sundberg To: Maxime Devos Cc: 48889@debbugs.gnu.org Message-ID: <9f6bfb31-ad8a-a45f-2c80-e4423647aa28@arctype.co> Subject: Re: [bug#48889] [PATCH 4/4] bpftool: new package References: <20210606185204.17617-1-ryan@arctype.co> <20210606185204.17617-4-ryan@arctype.co> <95c21dc7fa0e9c6864df06b307f3375d511847a8.camel@telenet.be> In-Reply-To: <95c21dc7fa0e9c6864df06b307f3375d511847a8.camel@telenet.be> --ia0E5TvZq7M684atCJOCjoPtl5UtfU5wE Content-Type: multipart/mixed; boundary="------------B62D333A8DF5097C53D7C68B" Content-Language: en-US This is a multi-part message in MIME format. --------------B62D333A8DF5097C53D7C68B Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Here is the revised bpftool patch. Responses below. -- Sincerely, Ryan Sundberg On 6/7/21 2:50 AM, Maxime Devos wrote: > Ryan Sundberg via Guix-patches via schreef op zo 06-06-2021 om 11:52 [-= 0700]: >> Adds the bpftool package from the Linux kernel source tree. >> --- >> gnu/packages/linux.scm | 40 ++++++++++++++++++++++++++++++++++++++++ >> 1 file changed, 40 insertions(+) >> >> diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm >> index c8ec310665..06bb344475 100644 >> --- a/gnu/packages/linux.scm >> +++ b/gnu/packages/linux.scm >> @@ -54,6 +54,7 @@ >> ;;; Copyright =C2=A9 2020 David Dashyan >> ;;; Copyright =C2=A9 2020 pukkamustard >> ;;; Copyright =C2=A9 2021 B. Wilson >> +;;; Copyright =C2=A9 2021 Ryan Sundberg >> ;;; >> ;;; This file is part of GNU Guix. >> ;;; >> @@ -8108,3 +8109,42 @@ Availability and Serviceability} reports from L= inux kernel trace events. >> These trace events are logged in @file{/sys/kernel/debug/tracing} and=20 reported >> through standard log mechanisms like syslog.") >> (license license:gpl2))) >> + >> +(define-public bpftool >> + (package >> + (name "bpftool") >> + (version (package-version linux-libre)) >> + (source (package-source linux-libre)) >> + (build-system gnu-build-system) >> + (arguments >> + `(#:tests? #f >=20 > Why are tests disabled? This program has no tests. I commented as such in the new patch. >=20 >> + #:phases=20 >> + (modify-phases %standard-phases >> + (add-before 'configure 'chdir=20 >> + (lambda _ (chdir "tools/bpf") #t)) >> + (delete 'configure) >> + (replace 'build=20 >> + (lambda _ (invoke "make" "CC=3Dgcc" "bpftool") #t)) >=20 > Use ,(string-append "CC=3D" (cc-for-target)), to make sure cross-compil= ing bpftools > works. >=20 >> + (replace 'install=20 >> + (lambda* (#:key outputs #:allow-other-keys) >> + (let* ((out (assoc-ref outputs "out")))=20 >> + (mkdir-p (string-append out "/sbin")) >> + (mkdir-p (string-append out "/share/bash-completion/c= ompletions")) >> + (invoke "make"=20 >> + (string-append "prefix=3D" out) >> + (string-append "bash_compdir=3D" out "/share/= bash-completion/completions") >> + "-C" "bpftool" >> + "install") >> + #t)))))) >> + (inputs >> + `(("bison" ,bison) >=20 > Bison looks like a native input to me. >=20 >> + ("python" ,python-3) >=20 > Could be input, could be native-input. I don't know what's appropriate = for bpftools. You are right, python should be a native-input. >=20 > You can check with > ./pre-inst-env guix build bpftools --target=3Daarch64-linux-gnu Cross-compiling produced this linker error I'm not sure how to deal with right now: ld: staticobjs/libbpf.o: error adding symbols: file in wrong format >=20 > If there is "command not found: python" or something like that, > you'll need to move python to native-inputs. >=20 >> + ("readline" ,readline))) >> + (propagated-inputs >> + `(("libcap" ,libcap) >> + ("libelf" ,libelf) >> + ("zlib" ,zlib))) >=20 > bpftool is a tool, and not a library, right? > Then these libraries should be in inputs, not propagated-inputs, > to avoid polluting the profile. >=20 > bpftool should still have access to these libraries by ELF's RPATH > or something like that. >=20 >> + (home-page (package-home-page linux-libre)) >=20 > I don't see anything about bpftools on . > Maybe bpftools has a wiki somewhere? I linked https://lwn.net/Articles/739357/ as the new home-page, which is the closest this program gets to online documentation that I could find. >=20 >> + (synopsis "bpftool is a tool for inspection and simple manipulati= on of eBPF programs and maps") >> + (description "*bpftool* allows for inspection and simple modifica= tion of BPF objects on the system. Note that format of the output of all=20 tools is not guaranteed to be stable and should not be depended upon.") >=20 > Line is too long. Also, what's up with surrounding bpftools with *aster= isks*? Copy-paste error >=20 > Greetings, > Maxime. >=20 --------------B62D333A8DF5097C53D7C68B Content-Type: text/x-patch; charset=UTF-8; name="0001-gnu-Add-bpftool-in-sync-with-the-Linux-kernel-versio.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename*0="0001-gnu-Add-bpftool-in-sync-with-the-Linux-kernel-versio.pa"; filename*1="tch" =46rom 87104ca47671801f34848326a17f4eb453dc3c9a Mon Sep 17 00:00:00 2001 From: Ryan Sundberg Date: Sun, 6 Jun 2021 09:53:43 -0700 Subject: [PATCH] gnu: Add bpftool in sync with the Linux kernel version. * gnu/packages/linux.scm (bpftool): New variable Signed-off-by: Ryan Sundberg --- gnu/packages/linux.scm | 46 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index c8ec310665..5d4d1669c2 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -54,6 +54,7 @@ ;;; Copyright =C2=A9 2020 David Dashyan ;;; Copyright =C2=A9 2020 pukkamustard ;;; Copyright =C2=A9 2021 B. Wilson +;;; Copyright =C2=A9 2021 Ryan Sundberg ;;; ;;; This file is part of GNU Guix. ;;; @@ -8108,3 +8109,48 @@ Availability and Serviceability} reports from Linu= x kernel trace events. These trace events are logged in @file{/sys/kernel/debug/tracing} and re= ported through standard log mechanisms like syslog.") (license license:gpl2))) + +(define-public bpftool + (package + (name "bpftool") + (version (package-version linux-libre)) + (source (package-source linux-libre)) + (build-system gnu-build-system) + (arguments + `(#:tests? #f ; This package has no tests. + #:phases + (modify-phases %standard-phases + (add-before 'configure 'chdir + (lambda _ (chdir "tools/bpf") #t)) + (delete 'configure) + (replace 'build + (lambda _ (invoke "make" + ,(string-append "CC=3D" (cc-for-target)) + "bpftool") + #t)) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out"))) + (mkdir-p (string-append out "/sbin")) + (mkdir-p (string-append out "/share/bash-completion/comp= letions")) + (invoke "make" + (string-append "prefix=3D" out) + (string-append "bash_compdir=3D" out + "/share/bash-completion/completio= ns") + "-C" "bpftool" + "install") + #t)))))) + (inputs + `(("readline" ,readline) + ("libcap" ,libcap) + ("libelf" ,libelf) + ("zlib" ,zlib))) + (native-inputs + `(("bison" ,bison) + ("python" ,python-3))) + ; This tool does not have a proper web page. + (home-page "https://lwn.net/Articles/739357/") + (synopsis "Tool for inspection and simple manipulation of eBPF progr= ams and maps") + (description "bpftool allows for inspection and simple modification = of BPF +objects on the system.") + (license (package-license linux-libre)))) --=20 2.31.1 --------------B62D333A8DF5097C53D7C68B-- --ia0E5TvZq7M684atCJOCjoPtl5UtfU5wE-- --RzPwQE9kgMZatucz9vpko1JubAlfdZIec Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wsB5BAABCAAjFiEEyVG5Gm1pvFAzyXC2aiMi+MCr96sFAmDAaFwFAwAAAAAACgkQaiMi+MCr96sh jwf/a7l4EK5SqB+t1vwt5aLYCioT2N1PBR2gstpk6+6pRk+dUBAJmm+rOEkybHA7cVX29f3GOclb zMrBqF/uS1BllaJL0t/A09d8FzMLtPstg9UMkZ1/ygYO40Vmc8PVLAuSSRo8Ybhq4DBwhXdDDRbT KQGyL7RCLk1gy6iyTPl9xCLmtsESLy/7spJ2Y+FEpUzQR4+rWhWpnodhJjFSDMrUmcDcb5aKdXc0 7U4jLd9+ITaqMg5YqkMnUN+HABGoprWotC9sVZGO0a6dKDjpw+C6ytWmeA4a/21+jp7V32etdhrD XLrHKuvFP6gaItrT+hZbvySeAne9NmyLv3q6J0yMdQ== =DI/e -----END PGP SIGNATURE----- --RzPwQE9kgMZatucz9vpko1JubAlfdZIec--