From patchwork Fri Apr 19 21:18:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Angelo Compagnucci X-Patchwork-Id: 1925708 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=140.211.166.133; helo=smtp2.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=patchwork.ozlabs.org) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VLnZQ5Tkkz1yZP for ; Sat, 20 Apr 2024 07:18:54 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id A0E5241AB9; Fri, 19 Apr 2024 21:18:51 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id Qfq89QV6FE3D; Fri, 19 Apr 2024 21:18:50 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.34; helo=ash.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 710D041ABD Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id 710D041ABD; Fri, 19 Apr 2024 21:18:50 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 7280B1BF302 for ; Fri, 19 Apr 2024 21:18:46 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 6CC8780BF1 for ; Fri, 19 Apr 2024 21:18:46 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id Arznc4gSZixM for ; Fri, 19 Apr 2024 21:18:45 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2a00:1450:4864:20::136; helo=mail-lf1-x136.google.com; envelope-from=angelo.compagnucci@gmail.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp1.osuosl.org 37A4B80BD5 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 37A4B80BD5 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by smtp1.osuosl.org (Postfix) with ESMTPS id 37A4B80BD5 for ; Fri, 19 Apr 2024 21:18:45 +0000 (UTC) Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-51abd9fcbf6so2064104e87.1 for ; Fri, 19 Apr 2024 14:18:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713561522; x=1714166322; 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=Xr98DQNmLm8rX3W960dXU8G2uoVrSi+Qo7N6gd2P5GA=; b=B2kfTfygnhtwotz7SEUvYoEVrO7OAuO0JYN3rB3ixDBQziJpW9y21f/rvGN71ymrto c/XXRd05qnNtWwBzlhVa+r27A7KtU5JLzGIZ7TI7sbuSpLaDd4cUWt2aMtp9trxv4KTt nAsvQJjLiU8YINRERn2yeKJCHWQg1Th1eAz0MfOB8OMPfCVClcQ2+ta3oRIiNWdd4vti 0awAITxYjSnn6E5scRUWhabB0mIYkhunMYCFE/i2xuZ9uvpkyWASe3bC4xYZZyAziRpY d/JysQwOOVa6K3q1g19eebRRVEr8o0Vs0IpuGbNr0avzqTY6vVtsjBNb14JfnUF3LTpp J4aQ== X-Gm-Message-State: AOJu0YwKhEGS4tmyOYTKtTABtvKeIRGlu9sOM081MVZbYBKdFyOSj353 DbSd3H7WtPC599GmzHrADaVwGBO5fA+v5eIiUiwdfVm0uVlHki+Hu2PAmA== X-Google-Smtp-Source: AGHT+IHOuCu6rHq4ZbSbH06YYlSOiR5xZdRs7zuQcfaYh9oingn+ssU/Go79/O2Mh1Gmk7CZ1s341w== X-Received: by 2002:a05:6512:2158:b0:518:8c8c:db58 with SMTP id s24-20020a056512215800b005188c8cdb58mr2678820lfr.65.1713561521733; Fri, 19 Apr 2024 14:18:41 -0700 (PDT) Received: from localhost.localdomain ([212.22.152.70]) by smtp.gmail.com with ESMTPSA id w23-20020a170907271700b00a556f2f18d6sm2556934ejk.57.2024.04.19.14.18.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 14:18:40 -0700 (PDT) From: Angelo Compagnucci To: buildroot@buildroot.org Date: Fri, 19 Apr 2024 23:18:32 +0200 Message-Id: <20240419211833.498273-2-angelo.compagnucci@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240419211833.498273-1-angelo.compagnucci@gmail.com> References: <20240419211833.498273-1-angelo.compagnucci@gmail.com> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713561522; x=1714166322; darn=buildroot.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=Xr98DQNmLm8rX3W960dXU8G2uoVrSi+Qo7N6gd2P5GA=; b=HyT5tivmh7uZfCE2yfVXTpTmIT74Updy9fdGUXToN6xsAcQWk3M39MYunN0172fBeU gHR0jcn7szI0eJ9t/fFBMhGoHYGd0UaSXAUV3I097gQ4tNRKSKW0qWTfAsc6O+o5y0DZ JZa/vJWddac8Ia8ANgWiB51ApjRv8pNZn0SSjOV1RHf2ahsngPNKFz8C3y5RFXr4M+Gj xiATlWMqCJ2FTmsM3ZALnKaUauDhgeuE9qH+daqbu7irOqytIfFosN+8zIaO3HZwNyb9 fgsvpnkQG0u8hJ2XXPuoRu/VSplj44Ob1Sa7tCsDi99DPkqWuDwFxMAMJKS3bUL43qzL dq7g== X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dmarc=pass (p=none dis=none) header.from=gmail.com X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=HyT5tivm Subject: [Buildroot] [PATCH 1/2] package/fail2ban: fix data_files installation path X-BeenThere: buildroot@buildroot.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Angelo Compagnucci , Thomas Petazzoni , Angelo Compagnucci Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" From: Angelo Compagnucci When packaging data_files in a wheel, those files shall have the destination path expressed as relative to the wheel installation. The reason for that is the wheel installation shall be contained inside a specific folder and/or in site-packages. When building the wheel file by the bdist_wheel command, python will package files with absolute pats as python files ending up installing them in site-packages. Fixes: http://autobuild.buildroot.net/results/36ac5278d19195a21c3d02d087965e08f49228ef Signed-off-by: Angelo Compagnucci --- ...001-setup.py-fix-data-relative-paths.patch | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 package/fail2ban/0001-setup.py-fix-data-relative-paths.patch diff --git a/package/fail2ban/0001-setup.py-fix-data-relative-paths.patch b/package/fail2ban/0001-setup.py-fix-data-relative-paths.patch new file mode 100644 index 0000000000..e1b5bc490b --- /dev/null +++ b/package/fail2ban/0001-setup.py-fix-data-relative-paths.patch @@ -0,0 +1,73 @@ +From 7b7fa3c02d4575c09362336bc310835c37859f1a Mon Sep 17 00:00:00 2001 +From: Angelo Compagnucci +Date: Fri, 19 Apr 2024 22:47:20 +0200 +Subject: [PATCH] setup.py: fix data relative paths +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +As per distutils documentation: + +The directory should be a relative path. It is interpreted relative to the +installation prefix (Python’s sys.prefix for system installations; +site.USER_BASE for user installations). Distutils allows directory to be an +absolute installation path, but this is discouraged since it is incompatible +with the wheel packaging format [1]. + +When packaging to a bdist_wheel indeed, the files in the "data_files" dictionary +are not picked at all as data files if they have an absolute path, +but they are instead added to the wheel as python files. +This has the effect of installing them as part of python files in the +site-packages folder when the wheel is installed. + +This patch cannot be sent upstream because it breaks the legacy way of +installing the package with *python setup.py install* and it is needed only to +comply with the pep517 buildroot compatibility layer. + +[1] https://docs.python.org/3.10/distutils/setupscript.html#installing-additional-files +Signed-off-by: Angelo Compagnucci +--- + setup.py | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/setup.py b/setup.py +index 91f71cf2..99ba2e32 100755 +--- a/setup.py ++++ b/setup.py +@@ -238,26 +238,26 @@ setup( + for f in w[2]] + } if with_tests else {}, + data_files = [ +- ('/etc/fail2ban', ++ ('etc/fail2ban', + glob("config/*.conf") + ), +- ('/etc/fail2ban/filter.d', ++ ('etc/fail2ban/filter.d', + glob("config/filter.d/*.conf") + ), +- ('/etc/fail2ban/filter.d/ignorecommands', ++ ('etc/fail2ban/filter.d/ignorecommands', + [p for p in glob("config/filter.d/ignorecommands/*") if isfile(p)] + ), +- ('/etc/fail2ban/action.d', ++ ('etc/fail2ban/action.d', + glob("config/action.d/*.conf") + + glob("config/action.d/*.py") + ), +- ('/etc/fail2ban/fail2ban.d', ++ ('etc/fail2ban/fail2ban.d', + '' + ), +- ('/etc/fail2ban/jail.d', ++ ('etc/fail2ban/jail.d', + '' + ), +- ('/var/lib/fail2ban', ++ ('var/lib/fail2ban', + '' + ), + ] + data_files_extra, +-- +2.34.1 + From patchwork Fri Apr 19 21:18:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angelo Compagnucci X-Patchwork-Id: 1925712 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=2605:bc80:3010::133; helo=smtp2.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=patchwork.ozlabs.org) Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VLnZT6Jtlz1yb2 for ; Sat, 20 Apr 2024 07:18:57 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id D11CE41AE7; Fri, 19 Apr 2024 21:18:55 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id m509sWtY1GwV; Fri, 19 Apr 2024 21:18:53 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.34; helo=ash.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 4F2AB41AD3 Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id 4F2AB41AD3; Fri, 19 Apr 2024 21:18:53 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 58EDF1BF302 for ; Fri, 19 Apr 2024 21:18:48 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 45E8680D44 for ; Fri, 19 Apr 2024 21:18:48 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 2sZwccDaZxZs for ; Fri, 19 Apr 2024 21:18:47 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2a00:1450:4864:20::130; helo=mail-lf1-x130.google.com; envelope-from=angelo.compagnucci@gmail.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp1.osuosl.org 2CE3C80C53 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 2CE3C80C53 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by smtp1.osuosl.org (Postfix) with ESMTPS id 2CE3C80C53 for ; Fri, 19 Apr 2024 21:18:47 +0000 (UTC) Received: by mail-lf1-x130.google.com with SMTP id 2adb3069b0e04-518b9527c60so2828533e87.0 for ; Fri, 19 Apr 2024 14:18:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713561524; x=1714166324; 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=+485J7px480Ml4KOYEQCmWXtbNNnzHzupDZv59BhYqY=; b=ftEQ/pLigLQgBGXV/I1jyENfZYe2WP9yucMdGOIBY4kARa33SspLugal9CReU8UnHM nQ4X/92D/hS4a40tUJxrCXSvxonxaqYS11AbjZefqk6Hp2vE/heR6XpwA9R4WuKZcLaZ WH0MxpLO1WVeBeoF2JFs1Sd+hHTmigfeseDdITk3LTO7EaPK3zwFChJJuxFIKT6kdHyl bs67eJ2HfAyOdUriF/WeWEp2NRoS01/TbPQwjW0s5corcO3ZilzdDz8MS+itXImOmvpT fFntBjlUKgKoTOgco/pxcxmdxMEi4jZdD57ARcSSETiZeIs1JWSQnuk1rmTGlcdXI7i6 b67g== X-Gm-Message-State: AOJu0YwQHgAKDhl2KoVy7CBHaSwtZJ7XpOAUhCcC/XoJHdT5J5v2ECq9 4IVgTNMgOVrpYgEnIDzTUrnR57CMy6jwzHlj+aF90oKfJ+8n0G9Zap+wBA== X-Google-Smtp-Source: AGHT+IFdFkE2ZCK3fHmzLMzFDHfzvAjx42OtTwgG3EcOecoKnp3Tdj3DuII69gZcYrxdYVbRwltnmQ== X-Received: by 2002:ac2:522f:0:b0:51a:c6c0:9dfa with SMTP id i15-20020ac2522f000000b0051ac6c09dfamr1947618lfl.18.1713561523940; Fri, 19 Apr 2024 14:18:43 -0700 (PDT) Received: from localhost.localdomain ([212.22.152.70]) by smtp.gmail.com with ESMTPSA id w23-20020a170907271700b00a556f2f18d6sm2556934ejk.57.2024.04.19.14.18.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 14:18:42 -0700 (PDT) From: Angelo Compagnucci To: buildroot@buildroot.org Date: Fri, 19 Apr 2024 23:18:33 +0200 Message-Id: <20240419211833.498273-3-angelo.compagnucci@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240419211833.498273-1-angelo.compagnucci@gmail.com> References: <20240419211833.498273-1-angelo.compagnucci@gmail.com> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713561524; x=1714166324; darn=buildroot.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=+485J7px480Ml4KOYEQCmWXtbNNnzHzupDZv59BhYqY=; b=MjqtlrAdmdVICKz/IULFKNU1d1ziUW2eCxUC/7nHpuXYzPtrv6ZZFu7l8eKa6U5EAz 7Fpf2Xe2UYTGH4nljMUD8OCeST4LJefUTRMeySI7EIuQhkT+/WRRBbNXUjNY1rAERETr ONn+D0WBRGa1sJT+6fo0ZU2PzOQUGmfEeGU89Hk70/9jv2LK3p1IPZKlzcBOs24A61Co mEp3brEzXmeP4D4gSzWVH1dLx/l8VtgKR107Dm3cE7uPvRpnQ/SDIIMp5LhdYWgw80Dd +T0I5pae4EzpyIQXqRXUFIPIOVfcpQNnQRR0VpRKfZCE4YEuT8+iXnR9wZNZ+1ff3tVR 9/Ow== X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dmarc=pass (p=none dis=none) header.from=gmail.com X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=MjqtlrAd Subject: [Buildroot] [PATCH 2/2] package/pkg-python: fix pep517 data files installation X-BeenThere: buildroot@buildroot.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Angelo Compagnucci , Thomas Petazzoni , Angelo Compagnucci Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" From: Angelo Compagnucci When installing a wheel in pep517 compatibility mode, the pyinstaller.py is invoked with the --data parameter which point to the directory in which data files should be installed. Actually the --data parameter points to the /usr subdirectory which is indeed wrong cause it shall point to the root directory where the wheel will be installed. This fixes the problem of having configuration files installed in /usr/etc instead of /etc. Fixes: http://autobuild.buildroot.net/results/36ac5278d19195a21c3d02d087965e08f49228ef Signed-off-by: Angelo Compagnucci --- package/pkg-python.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/pkg-python.mk b/package/pkg-python.mk index 839f728e2f..4f9bee4b90 100644 --- a/package/pkg-python.mk +++ b/package/pkg-python.mk @@ -70,7 +70,7 @@ PKG_PYTHON_PEP517_INSTALL_TARGET_CMD = \ --purelib=$(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \ --headers=$(TARGET_DIR)/usr/include/python$(PYTHON3_VERSION_MAJOR) \ --scripts=$(TARGET_DIR)/usr/bin \ - --data=$(TARGET_DIR)/usr + --data=$(TARGET_DIR) PKG_PYTHON_PEP517_INSTALL_STAGING_CMD = \ $(TOPDIR)/support/scripts/pyinstaller.py \ @@ -79,7 +79,7 @@ PKG_PYTHON_PEP517_INSTALL_STAGING_CMD = \ --purelib=$(STAGING_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \ --headers=$(STAGING_DIR)/usr/include/python$(PYTHON3_VERSION_MAJOR) \ --scripts=$(STAGING_DIR)/usr/bin \ - --data=$(STAGING_DIR)/usr + --data=$(STAGING_DIR) PKG_PYTHON_PEP517_DEPENDENCIES = \ host-python-pypa-build \