From patchwork Sun Jun 13 14:32:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 1491446 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=smtp2.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=nG1ZmT0Q; dkim-atps=neutral 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 RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4G2xqm2S7dz9sRf for ; Mon, 14 Jun 2021 00:32:19 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 3AD3D40193; Sun, 13 Jun 2021 14:32:17 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id L3aR7ipJQVGJ; Sun, 13 Jun 2021 14:32:16 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id 72F37400F1; Sun, 13 Jun 2021 14:32:15 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 19BBE1BF41A for ; Sun, 13 Jun 2021 14:32:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 08D056076F for ; Sun, 13 Jun 2021 14:32:14 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp3.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cn8Vlnep3mRb for ; Sun, 13 Jun 2021 14:32:13 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by smtp3.osuosl.org (Postfix) with ESMTPS id 38BC360758 for ; Sun, 13 Jun 2021 14:32:13 +0000 (UTC) Received: by mail-wm1-x335.google.com with SMTP id k5-20020a05600c1c85b02901affeec3ef8so11359643wms.0 for ; Sun, 13 Jun 2021 07:32:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=VALCPYDwJd4fmjY5dKf7lYdDsfT/vfJdgTC3UP5ffnQ=; b=nG1ZmT0QvJbpFPU3eIpCBL53H2IrN8xOpZ72XhH6SKra9rXTkOc55u5OymRxIcRkij eFk5ozJKGPliD1Xqf6QJ+8JFkbuGbzNX42gZVGJ9QE2LUjbQz01TaVM0YReoVQRwM9RF +f/1RtWM0XZkNQbV888SdYKINBd+g2Vx5VzbfUbYtSraXMnwSmcYLkGASpVfMxpM06eG OeSNzgC3m84R48LbfZa4gbfrYvUYsFVs6evqd8DOQG+dz4tr1he84XtkkNf9Lx1HsK/G 9R52OAki29u4eg2C8GHY8kyqSd2wIy4xO2zAlD3StKqk+kCvVUrYJherPySPF3UW7VzZ ouzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=VALCPYDwJd4fmjY5dKf7lYdDsfT/vfJdgTC3UP5ffnQ=; b=O+l6N/mxKdlqAVjkHvLjBcQQ2hJdcn6H+D6DJbagMFrgU/QpzOZ1UgWAljQEh79OEA e0DngmkP0GMKaWmuPedzNI5pGBqNeXbJPk5WJtJ+WKrDHBjQxinBpzSfUi1Sg7q8bN4C RMb3T20gK5bdWMmHTCqVld8wGdolhVtB6junjEA/dBy8UGWR1BnaQ/NcTRDF37h1Ag/1 z6QGEroUxSCVQ0g7taTHuCOF5SJ0VXGlunuvDnjoQ2bYKLwkVWp0Txw6fhMNUMvm1T8p JUZIzBw0U2iyCz6RTKKs5KKpq89XCU5hxO2K/0SjqPPtpxyLBLhLvq6UUUX1BakAfcn8 EN0Q== X-Gm-Message-State: AOAM531/5TK2o9UUDWfPxNT5a9EyPTaNCLvvkPjaJtDgVmNv/Rc3WMm6 v5/rSjNiVAY7D9wTkRxJQclX/d+dDHI= X-Google-Smtp-Source: ABdhPJxPSVjgpbxl/T1lQ6WftkonBjyD/fPgptWqYJQpPXNUpM8oCYKYQFydMV267y8tr6M+DAgmDA== X-Received: by 2002:a1c:b782:: with SMTP id h124mr28697381wmf.168.1623594731242; Sun, 13 Jun 2021 07:32:11 -0700 (PDT) Received: from scaer.home ([2a01:cb19:8b51:cb00:a401:2397:6ad:89d0]) by smtp.gmail.com with ESMTPSA id l16sm18414102wmj.47.2021.06.13.07.32.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Jun 2021 07:32:10 -0700 (PDT) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Sun, 13 Jun 2021 16:32:07 +0200 Message-Id: <20210613143207.2445691-1-yann.morin.1998@free.fr> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH] core/pkg-generic: fix instrumentation for packages that install nowhere X-BeenThere: buildroot@busybox.net 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: "Yann E. MORIN" , Thomas Petazzoni , "Weber, Matthew L Collins" Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" A (target [0]) package can independently declare installing in various locations: target, staging, or images. The default is to only install in target. When a package opts out from installing to target, but does not opts in to install in any other location, the package is not downloaded, extracted, patched, configured, nor built at all. As a consequence, none of the per-step instrumentation is not executed, specifically the listing of files before/after the package sequence. Down the line, the package infra does not cope well with that situation, because the gathering-install step, the one that synchronises all the optional target, staging, or images install steps, still gets run. And as #13836 shows, this does not go well: /bin/sh: /home/tbuild/myboard/build/foo/.files-list.after: No such file or directory make[1]: *** [/home/tbuild/myboard/build/foo/.stamp_installed] Error 1 make: *** [_all] Error 2 So, we should have ensured that the gathering-install step itself depends on the build step, which would have solved the issue. However, this bug really illustrates a more fundamental issue: does it even make sense to have a package that installs nothing in any location? Indeed, why even bother with that package to begin with if it will not provide anything at all? It turns out that yes, this makes sense. We have some packages, that do not install anything at all, and do not even build anything; they are there just to ensure that we can download something that will ultimately be used by another package. This is the case for example for packages that provide linux extensions, like aufs [1]. Additionally, some ugly out-of-tree packages could conceivably install things during the build (or even configure!) steps. That's not unheard of... [2] So, the solution is to ensure that the gathering-install step does depend on the build step, to trigger the proper dependency chain and have the instrumentation hooks properly run even in that degenerate case. Fixes: #13836 [0] a host package can't opt out of installing anything. [1] that one is actually missing AUFS_INSTALL_TARGET = NO, so this hides the issue. [2] even us are not 100% clean on that topic: gcc will install files in staging and target as part of the same step (not the build, granted, but still...) Reported-by: "Weber, Matthew L Collins" Signed-off-by: Yann E. MORIN Cc: Thomas Petazzoni Tested-by: Matthew Weber