From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 0JxaGmpL2l+3PwAA0tVLHw (envelope-from ) for ; Wed, 16 Dec 2020 18:01:14 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id kCKiFGpL2l8RVAAA1q6Kng (envelope-from ) for ; Wed, 16 Dec 2020 18:01:14 +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 909579402B0 for ; Wed, 16 Dec 2020 18:01:13 +0000 (UTC) Received: from localhost ([::1]:35354 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kpb6u-00036n-1J for larch@yhetil.org; Wed, 16 Dec 2020 13:01:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57352) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kpb6Y-00034z-27 for Help-Guix@gnu.org; Wed, 16 Dec 2020 13:00:50 -0500 Received: from box.euandre.org ([46.101.160.115]:33965) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kpb6V-0006HG-He for Help-Guix@gnu.org; Wed, 16 Dec 2020 13:00:49 -0500 Received: from authenticated-user (box.euandre.org [46.101.160.115]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by box.euandre.org (Postfix) with ESMTPSA id 46007FC4A6; Wed, 16 Dec 2020 15:00:11 -0300 (-03) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=euandre.org; s=mail; t=1608141613; bh=zZ6twBf5GqrrlCz/1JuWS5GTnf0efMDcMkdsfJzq5d8=; h=From:To:Cc:Subject:Date:From; b=mmuHK7UA7gN8Pp8vLqgfsWU3hhReUsecRXrPK3PugUg3wKCVE+f8260nxzwMotrfO uiF63Eo1SVyHpQTHV/qd2OEEJH2uGVOxtqLQ0BoHV9LUzKi87FiCOTg7tGTb2PzrqB lJGpcKd4O2EJpQU7KMiPb5fJ+kBIZixe7dIiu5PwH+dsUsxPJlzTdG5CLDSFDPpQk4 JtOBRr1wI6cKfhNcjN4CwIX1zR6pG6b16ZmE6O5q0I1gakYmr7EP1HUgAcxxMgh5qV xfGZN+iGBQawqMNnXDXbTU9LYgIGBskX/0ZsXmvIxv7oj4PhNWShCiMnRvy+U59hjt 51VxPzQ7vIS3Q== From: EuAndreh To: help-guix Cc: Subject: etc/profile from Guix pack is a noop when $GUIX_PROFILE is defined Date: Wed, 16 Dec 2020 14:21:51 -0300 Message-ID: <87a6ud8y4w.fsf@euandre.org> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=46.101.160.115; envelope-from=eu@euandre.org; helo=box.euandre.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: help-guix@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -2.01 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=euandre.org header.s=mail header.b=mmuHK7UA; dmarc=pass (policy=quarantine) header.from=euandre.org; spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Migadu-Queue-Id: 909579402B0 X-Spam-Score: -2.01 X-Migadu-Scanner: scn0.migadu.com X-TUID: zNeRa3qHPjM/ Hi Guix! In a chat with civodul on IRC the other day we discussed about the generated etc/profile profile created by the "guix pack" command. It is my understanding that it falls just a very tiny bit short on making tarballs a great application bundle. This happens because of how $GUIX_PROFILE is treated on the generated profile. Here's the output of an interactive session: --8<---------------cut here---------------start------------->8--- $ echo $GUIX_PROFILE /home/andreh/.config/guix/current $ tar xf `guix pack -RR -S /bin=bin -S /etc=etc guile gnutls guile-json` $ cat etc/profile # Source this file to define all the relevant environment variables in Bash # for this profile. You may want to define the 'GUIX_PROFILE' environment # variable to point to the "visible" name of the profile, like this: # # GUIX_PROFILE=/path/to/profile ; \ # source /path/to/profile/etc/profile # # When GUIX_PROFILE is undefined, the various environment variables refer # to this specific profile generation. export PATH="${GUIX_PROFILE:-/gnu/store/8yjf5dypd0fw3va2y5hfdigfjxr6fpy6-profile}/bin${PATH:+:}$PATH" export GUILE_LOAD_PATH="${GUIX_PROFILE:-/gnu/store/8yjf5dypd0fw3va2y5hfdigfjxr6fpy6-profile}/share/guile/site/3.0${GUILE_LOAD_PATH:+:}$GUILE_LOAD_PATH" export GUILE_LOAD_COMPILED_PATH="${GUIX_PROFILE:-/gnu/store/8yjf5dypd0fw3va2y5hfdigfjxr6fpy6-profile}/lib/guile/3.0/site-ccache:${GUIX_PROFILE:-/gnu/store/8yjf5dypd0fw3va2y5hfdigfjxr6fpy6-profile}/share/guile/site/3.0${GUILE_LOAD_COMPILED_PATH:+:}$GUILE_LOAD_COMPILED_PATH" $ echo $GUILE_LOAD_PATH /home/andreh/.config/guix/current/share/guile/site/3.0 $ source etc/profile $ echo $GUILE_LOAD_PATH /home/andreh/.config/guix/current/share/guile/site/3.0:/home/andreh/.config/guix/current/share/guile/site/3.0 $ GUIX_PROFILE= source etc/profile $ echo $GUILE_LOAD_PATH /gnu/store/8yjf5dypd0fw3va2y5hfdigfjxr6fpy6-profile/share/guile/site/3.0:/home/andreh/.config/guix/current/share/guile/site/3.0:/home/andreh/.config/guix/current/share/guile/site/3.0 --8<---------------cut here---------------end--------------->8--- By using $GUIX_PROFILE and falling back to the /gnu/store/...-profile path, the environment variables declarations won't work in a case: when $GUIX_PROFILE is already defined. In my case, what ended up happening is that $GUILE_LOAD_PATH wasn't being enriched by the file, and ended up with a duplicate entry of $HOME/.config/guix/current. I was able to achieve the desired behaviour by making $GUIX_PROFILE undefined, but it felt like a pitfall to me. I was left with the impression that this wasn't the desired behaviour. My previous mental model was that I could take a tarball generated by "guix pack", source the profile and the binaries would be added to $PATH. Now I feel I have to remember this detail: remember to prefix the "source" command with "GUIX_PROFILE= ", and this should work regardless of the environment. Is this the desired behaviour? Am I missing something?