From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 04 05:13:46 2021 Received: (at submit) by debbugs.gnu.org; 4 Feb 2021 10:13:46 +0000 Received: from localhost ([127.0.0.1]:39776 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l7bdy-0006HZ-0P for submit@debbugs.gnu.org; Thu, 04 Feb 2021 05:13:46 -0500 Received: from lists.gnu.org ([209.51.188.17]:47102) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l7bdw-0006HR-4t for submit@debbugs.gnu.org; Thu, 04 Feb 2021 05:13:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55752) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7bds-000411-3w for guix-patches@gnu.org; Thu, 04 Feb 2021 05:13:42 -0500 Received: from mout-p-102.mailbox.org ([2001:67c:2050::465:102]:57598) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1l7bdn-0006f2-HT for guix-patches@gnu.org; Thu, 04 Feb 2021 05:13:39 -0500 Received: from smtp2.mailbox.org (smtp2.mailbox.org [80.241.60.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4DWZBX5KkHzQlZq for ; Thu, 4 Feb 2021 11:13:24 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6xq.net; s=MBO0001; t=1612433602; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NLd5OvZwHM8iokglGYCQfdrtEr8w2Ztr2rrsMIwAo6U=; b=C1l4bF+Qr9sNIUI6VzwWN7RVi903gb5DBapxEhP8nPiELzIb+4lyFGrfbr2jh96nc2p5bk CMm0YVO1J1UC34ht5UboX4+XhOic58xa/SCaAtlpryJb8MMHU/QmRRTVLTJyiuuhTuaoPx 2Zx5yzgKXBzfJLqKFwfauHjI/TWIp/VoMP8mPsjxBo5AegqGRi3Bhmh3TS892GsMkWKGYx a/vwh20aBXtWYOqtO0aA8K0HdRfYE5zdLTUWaGAk/gwkDtSm2Z6/EYN5yLl5OJ3OEnLjLQ kMCns1fh4eVnNOf+N846HQQ6AP5FXWW8Hwaeb1Ofn2UTlGGQFcB90JNBiLv7Ug== Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter05.heinlein-hosting.de (spamfilter05.heinlein-hosting.de [80.241.56.123]) (amavisd-new, port 10030) with ESMTP id k-V0xkOgPSXu for ; Thu, 4 Feb 2021 11:13:21 +0100 (CET) Date: Thu, 4 Feb 2021 11:13:20 +0100 From: Lars-Dominik Braun To: guix-patches@gnu.org Subject: [PATCH] environment: Allow starting from existing profile Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="aQMJvOm/NQRL2por" Content-Disposition: inline Content-Transfer-Encoding: 8bit X-MBO-SPAM-Probability: X-Rspamd-Score: -6.49 / 15.00 / 15.00 X-Rspamd-Queue-Id: C7C2D17F5 X-Rspamd-UID: 3dd4ce Received-SPF: pass client-ip=2001:67c:2050::465:102; envelope-from=lars@6xq.net; helo=mout-p-102.mailbox.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.6 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) --aQMJvOm/NQRL2por Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit Hi everyone, the attched patch allows starting a `guix environment` from an existing profile. Our use-case is this: We have profiles, created by guix package -p /path -i … because we need to parse desktop files in /path/share/applications. Also this does the heavy-lifting (substitutes/building/grafting) upfront once and not when starting an environment. Then we start an application from this profile using guix environment -C […] -p /path -- jupyterlab […] This is much faster (10x) for large profiles (i.e. JupyterLab) than guix environment -C […] -m manifest.scm -- jupyterlab […] and makes sure the environment is exactly the same as source /path/etc/profile I think there have been many discussions about how `guix environment` should work and this is certainly not the silver bullet, but it’s a huge improvement for us with very limited code changes required. Cheers, Lars --aQMJvOm/NQRL2por Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-environment-Allow-starting-from-existing-profile.patch" >From 3010cea7273f02e33f65dd5d78390f0f5b7e4698 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Thu, 4 Feb 2021 10:43:45 +0100 Subject: [PATCH] environment: Allow starting from existing profile * guix/scripts/environment.scm (%options): Add -p/--profile switch. (show-help): Document new switch. (guix-environment): Handle new 'profile switch. --- guix/scripts/environment.scm | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm index f4d12f89bf..25bc208489 100644 --- a/guix/scripts/environment.scm +++ b/guix/scripts/environment.scm @@ -21,6 +21,7 @@ (define-module (guix scripts environment) #:use-module (guix ui) #:use-module (guix store) + #:use-module (guix utils) #:use-module ((guix status) #:select (with-status-verbosity)) #:use-module (guix grafts) #:use-module (guix derivations) @@ -136,6 +137,8 @@ COMMAND or an interactive shell in that environment.\n")) FILE evaluates to")) (display (G_ " -m, --manifest=FILE create environment with the manifest from FILE")) + (display (G_ " + -p, --profile=PATH create environment from profile at PATH")) (display (G_ " --ad-hoc include all specified packages in the environment instead of only their inputs")) @@ -269,6 +272,10 @@ use '--preserve' instead~%")) (option '(#\P "link-profile") #f #f (lambda (opt name arg result) (alist-cons 'link-profile? #t result))) + (option '(#\p "profile") #t #f + (lambda (opt name arg result) + (alist-cons 'profile arg + (alist-delete 'profile result eq?)))) (option '(#\u "user") #t #f (lambda (opt name arg result) (alist-cons 'user arg @@ -706,6 +713,7 @@ message if any test fails." (user (assoc-ref opts 'user)) (bootstrap? (assoc-ref opts 'bootstrap?)) (system (assoc-ref opts 'system)) + (profile (assoc-ref opts 'profile)) (command (or (assoc-ref opts 'exec) ;; Spawn a shell if the user didn't specify ;; anything in particular. @@ -735,8 +743,15 @@ message if any test fails." #:dry-run? (assoc-ref opts 'dry-run?)) (with-status-verbosity (assoc-ref opts 'verbosity) - (define manifest + (define manifest-from-opts (options/resolve-packages store opts)) + (when (and profile (> (length (manifest-entries manifest-from-opts)) 0)) + (leave (G_ "'--profile' cannot be used with package options~%"))) + + (define manifest + (if profile + (profile-manifest profile) + manifest-from-opts)) (set-build-options-from-command-line store opts) @@ -755,7 +770,9 @@ message if any test fails." system)) (prof-drv (manifest->derivation manifest system bootstrap?)) - (profile -> (derivation->output-path prof-drv)) + (profile -> (if profile + (readlink* profile) + (derivation->output-path prof-drv))) (gc-root -> (assoc-ref opts 'gc-root))) ;; First build the inputs. This is necessary even for -- 2.26.2 --aQMJvOm/NQRL2por-- From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 11 05:00:09 2021 Received: (at 46291-done) by debbugs.gnu.org; 11 Feb 2021 10:00:09 +0000 Received: from localhost ([127.0.0.1]:57829 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lA8ld-0006sW-K2 for submit@debbugs.gnu.org; Thu, 11 Feb 2021 05:00:09 -0500 Received: from mail-oln040092253080.outbound.protection.outlook.com ([40.92.253.80]:16888 helo=APC01-SG2-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lA8lb-0006qT-6e for 46291-done@debbugs.gnu.org; Thu, 11 Feb 2021 05:00:09 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AeEoRZVLlAJ4XX9DVdHEFlU+A7I8EXrvxR3z3GkMXaVntHhMylkh00ls+rgAJTl4KTW7r7zXRW9esd/eC3BYTmS51bjPlJl8SWkPJXVCCMQN0lATZ7EkV1aPTWoWxVUcCsuGU2+vVdZdpdV63WtkgzIXuuQSbCQst7ZWxbysjrzQR5yNivgBtoPYthzPeVa6V8MeiutK3ZGXeuW1JO0d7UicttQjazeXpDWA0Jp5mig0142R8Pn50OI4nE4xzhSZJ5qX+HqcIFlh7uRVBS4r5YdMaBFEtpBA4OV+6x4KMN1+D2FYwFEsQmcnv+wSEr3ik1E/P/kP/50JUbF4i8NLJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kXV4wobdT9CPqrYumJZUgtZ52XQulYtTYDz/BKMkhz4=; b=RNz3KG0P7o8saquTvry0cwCChR1Q3Irqp6W5+/jgS08GdbLYGnoI8R+oPhiAoEyopsO/UnBkYPH8VZ4Fp4gsqs46r0upb0VJdGTD3lRS2xf47vMv9nGsl7URiG+FBo6Zltc9lH+tKWy5dbMpkPEUuLERxb+2Q79UoLxz4ZTRoB3s/5z2ODEqShz6Xy7tY1Fhu89DeAcFpRUzDo6Eo4PgyEA/Ib3lABohh9LSP+LNu+d2G2sD4rSsHuI55+OuNd/J0Ytt24PUKL7dXLwlXz/bZ6ShNsXErsnhKJSfQtOK2eVHUinD+JU28JBxDTp7HTQ6cAcnuA8S+FXp/6JL3do+7g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kXV4wobdT9CPqrYumJZUgtZ52XQulYtTYDz/BKMkhz4=; b=ouNrs215DvdAUnG/qfk7swU0H86emHNA600EWzygn4Tcl0f84ASJBEUGc4K7MTFrgdF9I9OeUPst0I7NsmW1vHF0BBddxJ2SicTEp7cevN4X7ZIW14GZzLlHlYaCngHHxktlgka5yxotZ7S7aazS0yEG8Vj/F/VmddcSY4hSC5bdePhruXWxM84SIvZ/hHBbYSBOMQQ/+BqaM9Qav5gDH4AmC9KJYWCLvmMosqxLK4spql5zkE42/SNdlFjA+pv/D7YfyECS6YjlPOIlNJwA+/GHDj9UYlcLo7ETk7tXA2OR297lpgyoCN1CAKnAHVQA/xt6Hvvtmnjpt9UQ1qGnlg== Received: from SG2APC01FT060.eop-APC01.prod.protection.outlook.com (2a01:111:e400:7ebd::46) by SG2APC01HT217.eop-APC01.prod.protection.outlook.com (2a01:111:e400:7ebd::339) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.11; Thu, 11 Feb 2021 09:59:54 +0000 Received: from OSZP286MB0664.JPNP286.PROD.OUTLOOK.COM (2a01:111:e400:7ebd::47) by SG2APC01FT060.mail.protection.outlook.com (2a01:111:e400:7ebd::409) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.25 via Frontend Transport; Thu, 11 Feb 2021 09:59:54 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:C9CB321E5253A3CD30A981132654B1E9897873C568A2D2137880EC8C6234E965; UpperCasedChecksum:3ACA8D1790CE6370A2AE93C1582A4DD78FFBD0443C4DB8A23EE55913AFC8D6B4; SizeAsReceived:7534; Count:46 Received: from OSZP286MB0664.JPNP286.PROD.OUTLOOK.COM ([fe80::4987:bbf2:2bff:6b22]) by OSZP286MB0664.JPNP286.PROD.OUTLOOK.COM ([fe80::4987:bbf2:2bff:6b22%5]) with mapi id 15.20.3846.031; Thu, 11 Feb 2021 09:59:54 +0000 From: =?utf-8?B?5a6L5paH5q2m?= To: Lars-Dominik Braun Subject: Re: [bug#46291] [PATCH] environment: Allow starting from existing profile References: Date: Thu, 11 Feb 2021 18:01:31 +0800 In-Reply-To: (Lars-Dominik Braun's message of "Thu, 4 Feb 2021 11:13:20 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) Content-Type: text/plain X-TMN: [YKPmFtM7pEbpGtBTr1N5rLt/Ecdw947J2kdPoahdRC5Vv9abIG+kFRCf+XsdCUaE] X-ClientProxiedBy: AM0PR10CA0054.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:150::34) To OSZP286MB0664.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:ec::11) X-Microsoft-Original-Message-ID: <877dneditg.fsf@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost (2409:8a62:378:f4a0:2f1:f5ff:fe18:6bb) by AM0PR10CA0054.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:150::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.26 via Frontend Transport; Thu, 11 Feb 2021 09:59:52 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 46 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: bb904efb-78c6-4d5c-df33-08d8ce73c7b5 X-MS-TrafficTypeDiagnostic: SG2APC01HT217: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: j/XZ7elZRAX8quATAGLcIJHqc9/4G9+YECKuH0KPggaFSzOmSrxjU1HdurPfSS1MJnENi6J8N4OaCAqLV9kitiIEgC7gi2cDoMOoEXgr/nQIrMExgsb3qjz7zJwoggbiqQ1JPKKP0RaLYvHQ2orYJWwHYv+JvnwD89SNzIX6zS4V97cO/nJD0+rOIJZdm8sQtmmq1aAtBn4+TtkljQ7pFz9WTuzWxl5b3AJRyNMTQhYOZkrVyRjiz0CnEEqP9EnUdpnnbanLHqYm4aASAWCGd9XTfD/43/IkfCMdOmHwvr+ETirXXbqAczywO6Qgj17JaYf1Jg4jBj4QgTQBvWXS+lgl9ZAI55JrRakeYguh8L5jOloeIIH/cIhmcYNZDwj3RLWqgrzEHFlqD2D+bI4TFA== X-MS-Exchange-AntiSpam-MessageData: +yM3XCOMBz798Y28Dg46NppEQU74Gd9fkAl5fLuNtVYrwVWuRqZ66MDhP/yqjqw/0lNY1xsk1ADxr6E041RGG6AdVhewxDIzwek/8bk2ZzbfsLTAp9Z7WskB/PSyvmINte5H4P5/RHvSzR1gdnZAq7/eZn1gyrIBkFW+QKyzYja/Hffq4czznaacd4w3ppBgiaVGS5nYkp+PcYOMkrxG7w== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: bb904efb-78c6-4d5c-df33-08d8ce73c7b5 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Feb 2021 09:59:54.5447 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: SG2APC01FT060.eop-APC01.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2APC01HT217 X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 46291-done Cc: 46291-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Lars-Dominik Braun writes: > Hi everyone, > > the attched patch allows starting a `guix environment` from an existing > profile. Our use-case is this: We have profiles, created by > > guix package -p /path -i & > > because we need to parse desktop files in /path/share/applications. Also > this does the heavy-lifting (substitutes/building/grafting) upfront once > and not when starting an environment. Then we start an application from > this profile using > > guix environment -C [&] -p /path -- jupyterlab [&] > > This is much faster (10x) for large profiles (i.e. JupyterLab) than > > guix environment -C [&] -m manifest.scm -- jupyterlab [&] > > and makes sure the environment is exactly the same as > > source /path/etc/profile > > I think there have been many discussions about how `guix environment` > should work and this is certainly not the silver bullet, but it.s a huge > improvement for us with very limited code changes required. Look excellent to me, pushed, thank you! From unknown Sun Jun 22 04:31:24 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 11 Mar 2021 12:24:09 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator