From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id +I9DNG0981+jHwAA0tVLHw (envelope-from ) for ; Mon, 04 Jan 2021 16:08:13 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id SHUDMG098182PQAAbx9fmQ (envelope-from ) for ; Mon, 04 Jan 2021 16:08:13 +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 62F6C9402A8 for ; Mon, 4 Jan 2021 16:08:13 +0000 (UTC) Received: from localhost ([::1]:38124 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kwSOy-0007Tc-94 for larch@yhetil.org; Mon, 04 Jan 2021 11:08:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39970) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kwSOo-0007TO-2o for guix-patches@gnu.org; Mon, 04 Jan 2021 11:08:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:48472) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kwSOn-0000Or-Rr for guix-patches@gnu.org; Mon, 04 Jan 2021 11:08:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kwSOn-00021F-MP for guix-patches@gnu.org; Mon, 04 Jan 2021 11:08:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#45403] [PATCH] gnu: zfs: Split into packages specific for each of our major supported kernel versions. Resent-From: raid5atemyhomework Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 04 Jan 2021 16:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45403 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Danny Milosavljevic X-Debbugs-Original-Cc: Tobias Geerinckx-Rice , "45403@debbugs.gnu.org" <45403@debbugs.gnu.org>, Tobias Geerinckx-Rice via Guix-patches via Received: via spool by submit@debbugs.gnu.org id=B.16097764487720 (code B ref -1); Mon, 04 Jan 2021 16:08:01 +0000 Received: (at submit) by debbugs.gnu.org; 4 Jan 2021 16:07:28 +0000 Received: from localhost ([127.0.0.1]:60018 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kwSOF-00020S-QI for submit@debbugs.gnu.org; Mon, 04 Jan 2021 11:07:28 -0500 Received: from lists.gnu.org ([209.51.188.17]:59878) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kwSOD-00020K-Qw for submit@debbugs.gnu.org; Mon, 04 Jan 2021 11:07:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39930) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kwSOB-0006q2-M4 for guix-patches@gnu.org; Mon, 04 Jan 2021 11:07:23 -0500 Received: from mail-40130.protonmail.ch ([185.70.40.130]:13875) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kwSO6-0008OB-Qj for guix-patches@gnu.org; Mon, 04 Jan 2021 11:07:23 -0500 Date: Mon, 04 Jan 2021 16:07:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1609776433; bh=pshoaocx7EiF6T8OAoy2mmlBLjXcF3oJ8X6+OQUEhwM=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=sQfiZX5ZbToKy+f4HtMyFGaUReJFEJHnK614YhFEV4UVxK5VbnBUi/3q3n5KH9Bgc vX4eL+pZiPX8hRZF4RAnYIVnOWS3YrrMNRohaCUI21xoH3I9iYvBC6GOyJi7Iy5f4U gv1x5runJUsp5T3RjYNs1Mz7OntfDDZ5KHskOpY8= Message-ID: In-Reply-To: References: <87tusaa5mf.fsf@nckx> <20210104145818.0fcd9a0d@scratchpost.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.70.40.130; envelope-from=raid5atemyhomework@protonmail.com; helo=mail-40130.protonmail.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: , Cc: 45403@debbugs.gnu.org Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" Reply-to: raid5atemyhomework , raid5atemyhomework via Guix-patches From: raid5atemyhomework via Guix-patches via X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -2.83 Authentication-Results: aspmx1.migadu.com; dkim=fail (headers rsa verify failed) header.d=protonmail.com header.s=protonmail header.b=sQfiZX5Z; 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: 62F6C9402A8 X-Spam-Score: -2.83 X-Migadu-Scanner: scn1.migadu.com X-TUID: RUMNNN/6LxAq Here's another alternative: * Remove the separate "module" output and put the `.ko` file in the "out" o= utput. * Create a separate `zfs-guix-tools` which provides `zpool`, `zfs`, `zed`, = `arc_summary`, `arcstat`, `dbufstat`, `raidz_test`, `zgenhostid`, `zvol_wai= t`, `fsck.zfs`, `mount.zfs`, `zdb`, `zhack`, `zinject`, `zstreamdump`, `zte= st`. * What the provided binaries do is: * It looks at `/run/booted-system/kernel/manifest` and looks for a `"zf= s"` package. * It `exec`s into the corresponding file in the `/gnu/store` for that p= ackage. This way, we can have a separate package for ZFS userspace tools, which jus= t calls the corresponding tools in the actual ZFS that gets installed. It's somewhat magical, though. Thanks raid5atemyhomework > This doesn't work, for two reasons: > > - The kernel-module is in the output "module" of the `zfs` package. The= code specifically checks for `(package? module)`, but we have to specify i= t as `(list system-zfs "module")`. > - ZFS is primarily managed via userspace tools, that's what ZFS users k= now how to use, and we should support that so that Guix users can ask non-G= uix ZFS users for help with their ZFS problems. The userspace tools are inc= luded in the package. If the base `zfs` package cannot compile because it's= incompatible with the default kernel, then the userspace tools are nonexis= tent and there is no way to manage ZFS. > - So, for example we can't just remove the "module" output and have= the `.ko` installed in the default "out" output, our core problem is we ne= ed to compile a ZFS module and userspace tools. > - We can try to split the compilation to separate the ZFS module fr= om the userspace tool, but that risks brittleness and subtle incompatibilit= ies between a ZFS module compiled for your local kernel (which cannot be th= e latest and greatest kernel since the kernel does not maintain interface c= ompatibility with kernel modules and the ZFS module is always having to cat= ch up), and ZFS userspace tool compiled for the default latest-and-greatest= kernel (even if we somehow manage to compile just the userspace tools with= the latest kernel, there may be implicit assumptions about kernel constant= s and so on passed from the userspace tools to the kernel module, which may= cause problems and birttleness). > > So it's just safer to always override the `zfs` `#:linux` with th= e system kernel, and install it in `(packages ...)` and in `(kernel-loadabl= e-modules ...)`. > > - We get compileability as long as older kernel is used. > - We ensure that the userspace tool is built for the same kernel module= for a compatible kernel, at all generations of the `guix system`. > > Thanks > raid5atemyhomework > > > > Why is this needed? KERNEL-LOADABLE-MODULES are already automatically > > adapted in this way. > > See this in gnu/system.scm : > > (define* (operating-system-directory-base-entries os) > > "Return the basic entries of the 'system' directory of OS for use as th= e > > value of the SYSTEM-SERVICE-TYPE service." > > (let* ((locale (operating-system-locale-directory os)) > > (kernel (operating-system-kernel os)) > > (hurd (operating-system-hurd os)) > > (modules (operating-system-kernel-loadable-modules os)) > > (kernel (if hurd > > kernel > > (profile > > (content (packages->manifest > > > > (cons kernel > > (map (lambda (module) > > (if (package? module) > > (package-for-kernel k= ernel <----- > > m= odule) > > module)) > > modules)))) > > (hooks (list linux-module-database))))) > > (initrd (and (not hurd) (operating-system-initrd-file os))) > > (params (operating-system-boot-parameters-file os))) > > `(("kernel" ,kernel) > > ,@(if hurd `(("hurd" ,hurd)) '()) > > ("parameters" ,params) > > ,@(if initrd `(("initrd" ,initrd)) '()) > > ("locale" ,locale)))) ;used by libc > >