From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id sAxSMjV3qV4LaAAA0tVLHw (envelope-from ) for ; Wed, 29 Apr 2020 12:46:45 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id cBnrOj13qV7AdQAAB5/wlQ (envelope-from ) for ; Wed, 29 Apr 2020 12:46:53 +0000 Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:470:142::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 54A00941C23 for ; Wed, 29 Apr 2020 12:46:53 +0000 (UTC) Received: from localhost ([::1]:49348 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTm73-0001S3-Aj for larch@yhetil.org; Wed, 29 Apr 2020 08:46:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58130) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTm6m-0001Q4-Gw for guix-devel@gnu.org; Wed, 29 Apr 2020 08:46:37 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:54085) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTm6j-0008BX-To; Wed, 29 Apr 2020 08:46:36 -0400 Received: from 2001-1c02-0b03-a700-f532-4553-7f2a-9b68.cable.dynamic.v6.ziggo.nl ([2001:1c02:b03:a700:f532:4553:7f2a:9b68]:59648) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jTm6c-0000f8-FU; Wed, 29 Apr 2020 08:46:32 -0400 Message-ID: Subject: Re: Adding a subcommand "load-profile" From: Roel Janssen To: zimoun Date: Wed, 29 Apr 2020 14:47:08 +0200 In-Reply-To: References: <490f77b9f9b0829f985ba717f6fbe008f54a816d.camel@gnu.org> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.1 (3.36.1-1.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Guix Devel Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Scanner: scn0 X-Spam-Score: -1.01 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 2001:470:142::17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Scan-Result: default: False [-1.01 / 13.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; GENERIC_REPUTATION(0.00)[-0.49324665239018]; DWL_DNSWL_FAIL(0.00)[2001:470:142::17:server fail]; R_SPF_ALLOW(-0.20)[+ip6:2001:470:142::/48:c]; IP_REPUTATION_HAM(0.00)[asn: 22989(0.18), country: US(-0.00), ip: 2001:470:142::17(-0.49)]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.50)[cached: eggs.gnu.org]; RCPT_COUNT_TWO(0.00)[2]; MAILLIST(-0.20)[mailman]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:22989, ipnet:2001:470:142::/48, country:US]; MID_RHS_MATCH_FROM(0.00)[]; TAGGED_FROM(0.00)[larch=yhetil.org]; ARC_NA(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; FROM_NEQ_ENVFROM(0.00)[roel@gnu.org,guix-devel-bounces@gnu.org]; FROM_HAS_DN(0.00)[]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[gnu.org]; HAS_LIST_UNSUB(-0.01)[]; DNSWL_BLOCKED(0.00)[2001:470:142::17:from]; R_DKIM_NA(0.00)[]; FORGED_SENDER_MAILLIST(0.00)[] X-TUID: YS2kjbjbj3wj Dear Simon, Thank you for your ideas! On Tue, 2020-04-28 at 18:54 +0200, zimoun wrote: > > [...] > > > Would there be any interest from others to have this as well? And also, the > > shell implementation heavy relies on Bash. What other shells should I > > attempt > > to implement? > > It would be cool! > However, if I remember correctly the previous discussion on such > topic, the issue was to respect the user's shell ($SHELL). This > argument is mitigated by the fact that "guix environment" already uses > Bash to spawn the new shell, if I understand correctly. I think we can respect the user's shell for the implementation of "load- profile". We could use Guile's "getenv" and "setenv" to prepare the shell environment in Guile, and then spawn the $SHELL in such a way that it doesn't load the user's default configuration. > Well, I find annoying to not able to "go in" and "go out" in one > profile and I prefer having a Bash specific implementation than > nothing. > So, thank you for the initiative. :-) > > > > If there is interest in having this as a "load-profile" subcommand, I will > > post > > an initial implementation to the mailing list ASAP. > > Instead of another subcommand, I would suggest to add an option to > "guix environment". > Then an another further step should maybe combine "--load-profile" and > "--ad-hoc" in order to create a temporary "augmented" profile. I would strongly prefer to keep it backwards-compatible for our local HPC users. Also, the "environment" command generates a new profile, whereas the proposed "load-profile" merely applies the environment variables of an existing profile to a newly spawned shell. I think the way they work differs enough to warrant a separate subcommand. Kind regards, Roel Janssen