From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id wObaBYgTfmM/GgAAbAwnHQ (envelope-from ) for ; Wed, 23 Nov 2022 13:35:20 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id +LPgBIgTfmP8IAEAG6o9tA (envelope-from ) for ; Wed, 23 Nov 2022 13:35:20 +0100 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 AE9773FD55 for ; Wed, 23 Nov 2022 13:35:19 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oxoxp-00035b-LG; Wed, 23 Nov 2022 07:34:53 -0500 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 1oxoxn-00033g-HR for guix-devel@gnu.org; Wed, 23 Nov 2022 07:34:51 -0500 Received: from koszko.org ([93.95.227.159]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oxoxk-000649-T9 for guix-devel@gnu.org; Wed, 23 Nov 2022 07:34:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=koszko.org; s=mail; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=LghyN5dvpwFT9IuYfMfswyTaoQ4ARPbsWGGT6FzKX58=; b=KDyviFpyqy3TvqEJR30sag35iW KM8/84Z4JLRvICsG9L9lsjOzaT2xaQ6e1Mf3+NdB5qgpwgWO6h+daP0XVsS9gaKBVM1toJBRnsiqY 5hFq+2nY4jjfny1AVUeCMW3ZWjP2chMBRydOwM5XEqrAis71HBU+so3hKkfUiodPyYqh8mihBogFf q8hSwYxEhMknQYRjVG/suNosuchB7nIkYYPukSsX+A0y5tyWPJT1vT0aBHj9+mRs1ztwFbhY2uWDM 3vIH9zWfrfHkyQ/IXQZ6yV8RLyiJWUIthetUH32Rt8i+PeqO/laU+SDqCFgjHNlrWymtkocGVW0OF I/w8RKp4CjPdQwY5Ldywd0oHsHeiMIh/z7EKD7D2nhtqzrxbFalNrxNU1/fFoVRi/IO4GK4DQac6v KJov6G+sqf07TGQK/aoTjb7HwpcoCcVuyxBqHmS0Nx0tIRDTQVr5j/PhKsATbMy7qEsdITgivyWAN 2tn1a/YY+hktwA3JTE/OhTyLTpXrAfZs74PbL4fVV/hgfrOg2j3R0eaSXLabWfF6tz5MWtklBE6P7 y4JOZkyr9lP+bKleIBJ/LBn3isOieWTKqXwb5Etb02w3vuz8QOTNqgWvTY8Z4ZXxD13aOTuWKGcih XxEo7MKFweZEzmB3jH3ow3h+asO5NCsPr3xXtAZgc=; Received: from [77.252.47.230] (helo=koszkonutek-tmp.pl.eu.org) by koszko.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oxoxY-0003hr-K6; Wed, 23 Nov 2022 13:34:36 +0100 Date: Wed, 23 Nov 2022 13:34:33 +0100 To: Zhu Zihao Cc: jgart , guix-devel@gnu.org Subject: Re: foreign-distro? Message-ID: <20221123133433.46c5d9ea@koszkonutek-tmp.pl.eu.org> In-Reply-To: <86k03mvtu3.fsf@163.com> References: <20221120145440.GB23557@dismail.de> <86k03mvtu3.fsf@163.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/4uFyOi3x3uYmDdZTV1z7hf6"; protocol="application/pgp-signature"; micalg=pgp-sha256 Received-SPF: pass client-ip=93.95.227.159; envelope-from=koszko@koszko.org; helo=koszko.org 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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Wojtek Kosior From: Wojtek Kosior via "Development of GNU Guix and the GNU System distribution." Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: guix-devel-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1669206919; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=LghyN5dvpwFT9IuYfMfswyTaoQ4ARPbsWGGT6FzKX58=; b=YBTflLGuva9SSz/HHyXlHQYdl2qEyGYITuLw/hwlhk0llc0CPDenOG72DVnOc0hhPX8lbW P+PbsdekiKxdWRK7Tz5exFbOHPFbCygpGSQb3+v3pKuVNTGHGCdfQKYR2so75g2bgmuj7v 5z9Oba2KJXZXyW6XZL4NmU+H72Eo9hXcrPPWdyLPuZj6xoThbsCZGDra+rUrNvVEtyGb1O 6JNYJGhsEUjsTF9oaaoVbrc0VB/hZ7kRrS+6mm29TeXnynlLOLf7aw13U3bv5UrvnIemZc yU6PF7Q4BnaHiTYE/C0A37oUcCsm5fRCyXOh5AHlkfgI5lNae0f2gOymWz39Uw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1669206919; a=rsa-sha256; cv=none; b=Njlv1QQajPdUcpc9e3egsvE1JXwtc+oHnor2nn940zeEQWF3xjqPAS/bNE6KdQ87dtfaTs F9zk6W8gZutPu0FhtiMZlBTu/lTS3kvK8+B408Dj1xDv9Abu0s0R1vw45SNzfX5STgvTX+ +5iNL3WoZPc7sT90Ju8CxfbX3zbZE3IBgYMi/VIVeeWD3JcoNE2n60y9s4vMXJXxVqXXMv vv2webIANNjfjW4lak5xFYTejm72CLHbS2bO6WbhM+hlsqBl9L7RP6u/9v1tuVmbTgyWFY pdF1dEeyV1+nOjCkR24FrBrvZpNuKchKwDrE8Nl8V3WGC8l2LLf050fvTGZk+g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=koszko.org header.s=mail header.b=KDyviFpy; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -2.89 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=koszko.org header.s=mail header.b=KDyviFpy; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: AE9773FD55 X-Spam-Score: -2.89 X-Migadu-Scanner: scn1.migadu.com X-TUID: Dirc6+v2JcZP --Sig_/4uFyOi3x3uYmDdZTV1z7hf6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi all, Sorry to tell this - I don't think something like this would be even possible to implement :/ AFAIK package definition fields like `(inputs)` don't just describe how the package gets installed. They affect the actual build. So if we really wanted this feature, we'd need to build 2 separate variants of a package - one for Guix system and one for foreign distros. In addition to looking like an overkill, such separate build variants could also require changes to existing utilities like `guix copy`. Besides all this, It it not that easy to determine whether Guix is running under a foreign distro. One idea would be to check whether the currently-running init system is Shepherd. But what if the user is running Guix commands inside a Guix system chroot? The Shepherd process is not going to be visible in such case Wojtek -- (sig_start) website: https://koszko.org/koszko.html PGP: https://koszko.org/key.gpg fingerprint: E972 7060 E3C5 637C 8A4F 4B42 4BC5 221C 5A79 FD1A Meet Krak=C3=B3w saints! #18: blessed J=C3=B3zef Kowalski Poznaj =C5=9Bwi=C4=99tych krakowskich! #18: b=C5=82ogos=C5=82awiony J=C3= =B3zef Kowalski https://pl.wikipedia.org/wiki/J=C3=B3zef_Kowalski_(duchowny) -- (sig_end) On Wed, 23 Nov 2022 18:36:49 +0800 Zhu Zihao wrote: > If you want to left the choice to user. You can just don't patch it. Or > you can always patch it because user can still use package transformer > to specify a custom ffmpeg. >=20 >=20 > jgart writes: >=20 > > Does Guix have a declarative Guix API way of knowing if it is installing > > a package into foreign distro versus Guix System? > > > > I'm thinking of a function like `foreign-distro?`: > > > > ``` > > (define-public peek > > (package > > (name "peek") > > ... > > (inputs=20 > > `(,@(if (foreign-distro?) `(("ffmpeg" ,ffmpeg)) '()))) > > ``` > > > > The above includes ffmpeg in the inputs only if installing peek on a > > foreign distro. It could additionally patch the ffmpeg executable in > > a peek package phases if foreign-distro? returns #t. > > > > WDYT =20 >=20 >=20 --Sig_/4uFyOi3x3uYmDdZTV1z7hf6 Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iHUEARYIAB0WIQTpcnBg48VjfIpPS0JLxSIcWnn9GgUCY34TWQAKCRBLxSIcWnn9 GipdAQDR5lCA0qtkf2ixf6PrIi9PHv0Ll2wckM/kJD/VNy6s9QD+MDk64NWZ8OB3 u1MvXTQH8WNm7/pEZsmiin6jTLMVHQ4= =1c7G -----END PGP SIGNATURE----- --Sig_/4uFyOi3x3uYmDdZTV1z7hf6--