From patchwork Thu Jun 27 16:52:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Noah Wager X-Patchwork-Id: 1953508 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W94RW6Thmz20Xg for ; Fri, 28 Jun 2024 02:54:31 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1sMsO1-0007vh-5x; Thu, 27 Jun 2024 16:54:17 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1sMsNz-0007va-6j for kernel-team@lists.ubuntu.com; Thu, 27 Jun 2024 16:54:15 +0000 Received: from mail-pf1-f197.google.com (mail-pf1-f197.google.com [209.85.210.197]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 8C1173F6BC for ; Thu, 27 Jun 2024 16:54:14 +0000 (UTC) Received: by mail-pf1-f197.google.com with SMTP id d2e1a72fcca58-706645f6ef3so7522868b3a.0 for ; Thu, 27 Jun 2024 09:54:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719507251; x=1720112051; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=g+ygW9Er0bb+G3nRFaNljfpQlw255AdKduq++b+F5Zc=; b=eybB+Jg65RSOmW6V39tssJg/ep4eofDY/k800eZ2gvN5dRJzbudEVWPfpmz6l/55iI BH16ZYAceJNyTMuF6O9ydB7i+wClgv1KsIo9KeHnYPXuYYcQrfoBogm8J++rwcoSTsCS qFkaGUdBbiJgzRbg2aCmZ6oRnWSsOOl8Jy8BpQb4xMIjOoYU2q7sfh1n0UK/outs0+Jj /3SSVl0/kk+aL/aqMb+KT+ZDpKmTahdWi1xYNqJnRq4rp9koRfBz74L7FTLjF3URZxqU QBt0tsIPT/IHkx1Y7ZL8mL5cvX9sF5w5oGMu3DnO0RihTNWU3IlvGAA0cu4hZVVzf8T1 g8Qg== X-Gm-Message-State: AOJu0YxOGyOeDJ88YKaZPI3ElcAFkCN/NdYqwfGdLrO12Z85qOwrAO3b FhWSfbKxzCKs8RK8KA0jlZzm+Qo5Cwm8kU5swXvcCuNJ7zshnjfashNOMbstEpCD6Lw/YCLMWDD rICq6IiAgOu5LDLHccMZOjS659a8ZRVbuD3RQxqFh2SKbyzTUMrksCVLbYBpooFac2mF2i7YWZh +Oli76KU3orw== X-Received: by 2002:a05:6a20:7a1d:b0:1bd:1a06:7ef3 with SMTP id adf61e73a8af0-1bd1a068015mr7624048637.3.1719507251355; Thu, 27 Jun 2024 09:54:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHr97GhtHeHb+QXLCGmg2lthtTaKfE6NMnwQCnqvvPOawJ2KG/tiXa3t5P8em7+wW47HZ6h8Q== X-Received: by 2002:a05:6a20:7a1d:b0:1bd:1a06:7ef3 with SMTP id adf61e73a8af0-1bd1a068015mr7624035637.3.1719507250943; Thu, 27 Jun 2024 09:54:10 -0700 (PDT) Received: from localhost ([2601:602:8c00:a08:556e:7a0f:49ce:687a]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-706b4a34ef0sm1588080b3a.164.2024.06.27.09.54.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jun 2024 09:54:10 -0700 (PDT) From: Noah Wager To: kernel-team@lists.ubuntu.com Subject: [Unstable][PATCH 0/1] UBUNTU: [Packaging] Check do_lib_rust before linking Rust lib files Date: Thu, 27 Jun 2024 09:52:37 -0700 Message-ID: <20240627165346.78336-1-noah.wager@canonical.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" [Impact] Commit: "UBUNTU: [Packaging] introduce do_lib_rust and enable it only on generic amd64" introduces the "do_lib_rust" variable in rules.d/ that avoids generating the extra rust package when unset/false. However, this is not checked when inserting a symlink to the linux-lib-rust package directory in the headers, resulting in a dangling symlink when rust is turned off. This can cause issues when e.g. building dkms modules against the headers, where the build will fail due to not finding the directory. [How to reproduce it] 1. Build linux-headers-* package for kernel with rust disabled (e.g. realtime) 2. Install (or extract) the package 3. View corresponding /usr/src/linux-headers-*/ directory 4. Observe /usr/src/linux-headers-*/rust -> ../linux-lib-rust-* but linux-lib-rust is never built and installed [Fix] Check the existing do_lib_rust variable is true before trying to symlink the linux-lib-rust files. [Test plan] 1. Apply the fix and rebuild the kernel headers packages 2. Install or inspect the headers 3. Ensure /usr/src/linux-headers-*/rust points to an existing directory [Regression potential] Very low. This is a simple fix, and it only impacts rust packaging for kernels with do_lib_rust unset/false so the visibility is low. Noah Wager (1): UBUNTU: [Packaging] Check do_lib_rust before linking Rust lib files debian/rules.d/2-binary-arch.mk | 2 ++ 1 file changed, 2 insertions(+) Acked-by: Paolo Pisati