From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id KOrrON7sGWWh5QAA9RJhRA:P1 (envelope-from ) for ; Mon, 02 Oct 2023 00:04:15 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id KOrrON7sGWWh5QAA9RJhRA (envelope-from ) for ; Mon, 02 Oct 2023 00:04:15 +0200 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 5EAE145EAB for ; Mon, 2 Oct 2023 00:04:14 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=mIoMrVG2; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1696197854; h=from:from:sender:sender: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=eLHOEFdW/t2D0XTwHN+oZLe+Tlb1kfz3k3AewkeA0mw=; b=c2xnK/0sw9AkylUkv0uLXFnDR2RHNXXRN3LXMEiRMNUiH/BkqFB9wGDKGqxNh7TVAHuGF5 LatZo3Xj9Xt6/fB0CyHlwkbn1KmaW5pVG/n8vx+EtKvCtu89tdbpLph2xZupDVguNp3JK4 7VgceQYlalwdX2wGFkbeb8C8M/LbuIIi2/JPw/1eUbFwMUPfs7CFnDyPRwYv2j1hIHSlqy Njt6VVseYrD0Fx/PTqqbOrxKjW7s++DbNdbg4NlLBc6VBrzKvF9fI83EAZOImIDP0xc4dv 5RpapvCaLtXkMoNZGzYaRB9JlZh9woo4Ebi8u3h/un75zG2PbyPhnTQ375DcAg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1696197854; a=rsa-sha256; cv=none; b=DX8j40MysuuTv7RBJV5Y6QP6EgiqHv0BxiZ/++uio6Ub4514ew2JFrpfhvNp8tyFBWj/jL HPXmpmu+hW09tPhKtUZ3E10f8nLWGHwufJ87elRb8rtOj0smirUmZ87QuU8gwclbDyKS6b uwdfCtIvJcqUmPrexPIrBf4FP5FM2eiuCtBbzMw8XZokBnUj/kdROPNd0kXR0twspmTeFX q/2dMjzrTwGrmU05+3A6FN8dhxdpCZVQ+Q/Jj/XoD+8lJ2LFQW2zcog2lonCo2+KuvGRNU wpfJ7F8/up9PyybV81e0vyf/nHtoaiiMBjRlBAa2pw/XFTEsJ+1vAuplkxkghw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=mIoMrVG2; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qn4XV-0001D3-98; Sun, 01 Oct 2023 18:03:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qn4XT-0001C2-5n for guix-patches@gnu.org; Sun, 01 Oct 2023 18:03:47 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qn4XS-00086M-RP for guix-patches@gnu.org; Sun, 01 Oct 2023 18:03:46 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qn4Xi-00046z-KK for guix-patches@gnu.org; Sun, 01 Oct 2023 18:04:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#66099] [PATCH gnome-team v3 1/3] gnu: eudev: Update libudev version to 251. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 01 Oct 2023 22:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66099 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Vivien Kraus Cc: 66099@debbugs.gnu.org, Liliana Marie Prikler , rg@raghavgururajan.name Received: via spool by 66099-submit@debbugs.gnu.org id=B66099.169619779815745 (code B ref 66099); Sun, 01 Oct 2023 22:04:02 +0000 Received: (at 66099) by debbugs.gnu.org; 1 Oct 2023 22:03:18 +0000 Received: from localhost ([127.0.0.1]:35521 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qn4Wz-00045s-W4 for submit@debbugs.gnu.org; Sun, 01 Oct 2023 18:03:18 -0400 Received: from mail-qk1-x72e.google.com ([2607:f8b0:4864:20::72e]:61901) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qn4Ww-00045d-VR for 66099@debbugs.gnu.org; Sun, 01 Oct 2023 18:03:16 -0400 Received: by mail-qk1-x72e.google.com with SMTP id af79cd13be357-7742be66bd3so835923685a.3 for <66099@debbugs.gnu.org>; Sun, 01 Oct 2023 15:02:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696197773; x=1696802573; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=eLHOEFdW/t2D0XTwHN+oZLe+Tlb1kfz3k3AewkeA0mw=; b=mIoMrVG2EMO7nBY3xiA0xKskhkNTbzNbUB0tfNuJwE6totsjrhLiOVr6+SvAazj866 3RCE7U3nrG0vtrvVYUf1SLNKsB9DjMnpYFvVPdL+1US0dEmF+8bPWTQD4qY0QiLY7E8C kW6l3smgxkX9Z5osZ5LmwiDSfqJ9idPQd1DWgXbPbcx/30zWSGNPFAxwpCLWflUaEqCq ItOmtS6v1th+UnsS7vCHm4djsuc/3zBAolj1vY0H6pj83ddmtB7tw3vidhgNMdiwJLXV Auqgu2QjmVKDFEGpeKqMHBuQp9oWSRqKEgE0IfCRX4m/HhS2LJJp370yydloG03C5b4I YNYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696197773; x=1696802573; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=eLHOEFdW/t2D0XTwHN+oZLe+Tlb1kfz3k3AewkeA0mw=; b=AJ0YyMzUjNpqvzZG5ybsNVYrwMRFH38DPxQbQc+pPKZUtG916n3gDSk6ElxYTtGXz5 DtChsm3Ftr1TQuCK83DKvHTiGFZkpR0a4VRIR3+hdcmqHPcEnhqRBWqVqGzSMPJOGknT ruvSlThDEPaCU+x7Y24EmXZJ+EOaylj1jqyxCsWrdIL7zaTVnZJFjIOdO1m6q2nxTvlq 1GWMYsE+fofOpKtuFxAYpZ+Tlv9m6U+1MyLMuJOSZNEG02LjtHtxYZL4JSQ/1hLYCoSs 6U8qfNtu4AUSGukbEXxKCJ41xz9cXKNwwQsZ7ftxdHT1it4x5VekW9S/PcEO8R4u5UJJ L1xQ== X-Gm-Message-State: AOJu0Yw1UhlmINJ/w77JJlFZrmfVv21fX0HtNKnF5AotygATm869thG9 UM5Dl1xeGmrSrBZB5Vd3eeU= X-Google-Smtp-Source: AGHT+IG6i4Ugtjs+fWzpPqXhTEOji3S2ISEhWLaK7MVnCQEriPSrWfz+BHN4QbqHfwFgRGCDlEN9gg== X-Received: by 2002:a05:620a:d93:b0:767:c572:ab10 with SMTP id q19-20020a05620a0d9300b00767c572ab10mr10543930qkl.35.1696197772925; Sun, 01 Oct 2023 15:02:52 -0700 (PDT) Received: from hurd (dsl-10-136-90.b2b2c.ca. [72.10.136.90]) by smtp.gmail.com with ESMTPSA id w15-20020ae9e50f000000b0077423f849c3sm6753729qkf.24.2023.10.01.15.02.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Oct 2023 15:02:52 -0700 (PDT) From: Maxim Cournoyer References: Date: Sun, 01 Oct 2023 18:02:51 -0400 In-Reply-To: (Vivien Kraus's message of "Tue, 19 Sep 2023 13:23:22 +0200") Message-ID: <87o7hi57ck.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx0.migadu.com X-Migadu-Spam-Score: -0.63 X-Spam-Score: -0.63 X-Migadu-Queue-Id: 5EAE145EAB X-TUID: BkQt5EuxvrSz Hi, Vivien Kraus writes: > Support for version 251 is only provided as a merge request for now: > > https://github.com/eudev-project/eudev/pull/253 > > This merge request bumps the eudev version to 3.2.14, but it has not been > released yet. > > Eudev now has a hardware database that installs descriptions of hardware in > /etc, but they should go to /lib prior to being used. I added a phase to copy > all the /etc files to /lib. > > I submitted 3 patches to make udev hwdb more guix-friendly, fused in > eudev-hwdb-bin-path.patch. libudev requires an indexed binary file that knows > about all devices, and this file is generated by udevadm hwdb --update -o > /lib/udev/hwdb.bin. This udevadm hwdb command respects the > UDEV_HWDB_PATH to collect all entries for the hwdb. Then, libudev can use > UDEV_HWDB_BIN to select the database at run-time. > > Another unreleased patch for PR 255 is also included. > > I think everything could work out for Guix if we add a new profile hook that: > 1. Calls udevadm hwdb --update -o /lib/udev/hwdb.bin; > 2. Set UDEV_HWDB_BIN to /lib/udev/hwdb.bin. > > This is why there are actually 2 search paths: one for UDEV_HWDB_PATH, and one > for UDEV_HWDB_BIN (the latter accepting only 1 value). > > * gnu/packages/linux.scm (eudev): Update to v3.2.12, but bump version to > 3.2.14.beta. > [#:phases] : New phase. > : Update accordingly. > [native-search-paths]: Add UDEV_HWDB_PATH. > * gnu/packages/patches/eudev-bump-to-251.patch: New file. > * gnu/packages/patches/eudev-hwdb-bin-path.patch: New file. > * gnu/packages/patches/eudev-pr-255.patch: New file. > * gnu/packages/linux.scm (eudev): Use them here. > * gnu/local.mk (dist_patch_DATA): Register them here. > * guix/profiles.scm (udev-hwdb-bin): New profile hook to generate hwdb.bin. > (%default-profile-hooks): Register it here. Impressive work! It seems your patches were warmly welcomed (already merged!) in eudev, which is excellent (and should mean a v4 doesn't need patches anymore, using a specific commit with a git-version computed version. [...] > (build-system gnu-build-system) > (arguments > (list > @@ -4297,18 +4300,25 @@ (define-public eudev > (substitute* (string-append #$output "/lib/libudev.la") > (("old_library=.*") > "old_library=''\n"))))) > - (add-after 'install 'build-hwdb > + (add-after 'install 'allow-eudev-hwdb > (lambda _ > - ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and > - ;; similar tools to display product names. > - ;; > - ;; XXX: This can't be done when cross-compiling. Find another way > - ;; to generate hwdb.bin for cross-built systems. > - #$@(if (%current-target-system) > - #~(#t) > - #~((invoke (string-append #$output "/bin/udevadm") > - "hwdb" "--update")))))) > + ;; eudev distributes the hwdb, but each file has to be enabled > + ;; by being copied under /lib/udev/hwdb.d. We accept all of > + ;; them. > + (symlink (string-append #$output "/etc/udev/hwdb.d") > + (string-append #$output "/lib/udev/hwdb.d"))))) > #:configure-flags #~(list "--enable-manpages"))) > + (native-search-paths > + (list (search-path-specification > + (variable "UDEV_HWDB_PATH") > + (files '("lib/udev/hwdb.d"))) > + ;; Never install a hwdb.bin file, always let the udev-hwdb-bin > + ;; profile hook generate it. > + (search-path-specification > + (variable "UDEV_HWDB_BIN") > + (files '("lib/udev/hwdb.bin")) > + (file-type 'regular) > + (separator #f)))) Maybe add a ;singled valued comment to the end of the above line. Note that given that file is to be generated in a profile hook, UDEV_HWDB_BIN would never be set at *build* time, but that should not matter much (the build environment being containerized and all).) [...] > diff --git a/guix/profiles.scm b/guix/profiles.scm > index c88672c25a..d308e7fb88 100644 > --- a/guix/profiles.scm > +++ b/guix/profiles.scm > @@ -1905,6 +1905,34 @@ (define (texlive-font-maps manifest) > (hook . texlive-font-maps))) > (return #f)))) > > +(define (udev-hwdb-bin manifest) > + "Return a derivation that builds lib/udev/hwdb.bin." ^ @file{lib/udev/hwdb.bin} > + (define eudev > + (module-ref (resolve-interface '(gnu packages linux)) 'eudev)) > + (define build > + (with-imported-modules > + (source-module-closure '((guix build utils))) > + #~(begin > + (use-modules (guix build utils)) > + (let* ((inputs '#$(manifest-inputs manifest)) > + (hwdb-directories > + (filter > + file-exists? > + (map (lambda (directory) > + (string-append directory "/lib/udev/hwdb.d")) > + inputs)))) > + (setenv "UDEV_HWDB_PATH" > + (string-join hwdb-directories ":"))) It'd be nicer to user 'evaluate-search-paths' with the UDEV_HWDB_PATH search path. > + (invoke #$(file-append eudev "/bin/udevadm") > + "hwdb" "--update" > + "-o" (string-append #$output "/lib/udev/hwdb.bin"))))) > + (gexp->derivation "udev-hwdb-bin" build > + #:substitutable? #f > + #:local-build? #t > + #:properties > + `((type . profile-hook) > + (hook . udev-hwdb-bin)))) > > (define %default-profile-hooks > ;; This is the list of derivation-returning procedures that are called by > ;; default when making a non-empty profile. > @@ -1919,6 +1947,7 @@ (define %default-profile-hooks > gtk-icon-themes > gtk-im-modules > texlive-font-maps > + udev-hwdb-bin > xdg-desktop-database > xdg-mime-database)) My only issue with this hook is that it introduces 'eudev' as a hard dependency for generating guix profiles. Would it make sense to follow the approach used in 'gdk-pixbuf-loaders-cache-file', which is to look if eudev is already part of the profile inputs (transitively), and skip the hook if it isn't? -- Thanks, Maxim