From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 20 07:37:21 2024 Received: (at submit) by debbugs.gnu.org; 20 Jun 2024 11:37:21 +0000 Received: from localhost ([127.0.0.1]:53470 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sKG6S-0004rW-Sp for submit@debbugs.gnu.org; Thu, 20 Jun 2024 07:37:21 -0400 Received: from lists.gnu.org ([209.51.188.17]:40130) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sKG6P-0004rL-O8 for submit@debbugs.gnu.org; Thu, 20 Jun 2024 07:37:18 -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 1sKG6L-00053O-KL for bug-guix@gnu.org; Thu, 20 Jun 2024 07:37:13 -0400 Received: from mailgate5.ufz.de ([141.65.7.212] helo=mailgate.ufz.de) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKG6I-0007k6-MU for bug-guix@gnu.org; Thu, 20 Jun 2024 07:37:13 -0400 Received: from imap.intranet.ufz.de (dcs1.intranet.ufz.de [141.65.125.135]) by mailgate.ufz.de (Mailgate5-UFZ) with ESMTP id AD6191602CB for ; Thu, 20 Jun 2024 13:36:57 +0200 (CEST) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; markup=markdown Received: from conversion-daemon.imap.intranet.ufz.de by imap.intranet.ufz.de (Oracle Communications Messaging Server 8.0.2.6.20200227 64bit (built Feb 27 2020)) id <0SFD00300M2UGK00@imap.intranet.ufz.de> for bug-guix@gnu.org; Thu, 20 Jun 2024 13:36:57 +0200 (CEST) Received: from smtp2.ufz.de ([141.65.7.217]) by imap.intranet.ufz.de (Oracle Communications Messaging Server 8.0.2.6.20200227 64bit (built Feb 27 2020)) with ESMTPS id <0SFD00DJGMXLZ540@imap.intranet.ufz.de> for bug-guix@gnu.org; Thu, 20 Jun 2024 13:36:57 +0200 (CEST) Received: from [100.88.251.128] (unknown [141.65.34.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp2.ufz.de (smtp2-UFZ) with ESMTPSA id 86138E0055 for ; Thu, 20 Jun 2024 13:36:57 +0200 (CEST) Date: Thu, 20 Jun 2024 13:36:57 +0200 From: Lars Bilke Subject: guix pack: Cannot pass environment variables via apptainer To: bug-guix@gnu.org Message-id: <9EA54A62-0D54-4992-B8A4-8B625286F605@ufz.de> X-Mailer: MailMate (1.14r5937) Received-SPF: pass client-ip=141.65.7.212; envelope-from=lars.bilke@ufz.de; helo=mailgate.ufz.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) 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.3 (--) I have created a squashfs image with e.g. guix pack --format=squashfs bash coreutils Then I run this image with apptainer / singularity and want to pass environment variables like this: APPTAINERENV_VAR1=FOO apptainer exec --env "VAR2=BAR" /gnu/store/v27n3gwdl3hn01bmm1ad4z1jkw51cz1r-bash-coreutils-squashfs-pack.gz.squashfs env Both VAR1 and VAR2 do not show up in the container but they should. Passing regular environment varialbles work: VAR3=BAZ APPTAINERENV_VAR1=FOO apptainer exec --env "VAR2=BAR" /gnu/store/v27n3gwdl3hn01bmm1ad4z1jkw51cz1r-bash-coreutils-squashfs-pack.gz.squashfs env ... VAR3=BAZ ... Any idea how to fix that? As I understand these variables are directly passed to the process (https://github.com/apptainer/apptainer/blob/317123280e39abcefb309716c07e0af85edbad88/internal/pkg/runtime/engine/apptainer/process_linux.go#L646 and https://github.com/apptainer/apptainer/blob/main/internal/pkg/runtime/engine/config/oci/generate/generate.go#L98) so they should work. Thanks, Lars