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 qD5JG8Baol8wOQAA0tVLHw (envelope-from ) for ; Wed, 04 Nov 2020 07:39:44 +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 sOs9F8Baol+DHgAA1q6Kng (envelope-from ) for ; Wed, 04 Nov 2020 07:39:44 +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 343B59403A9 for ; Wed, 4 Nov 2020 07:39:44 +0000 (UTC) Received: from localhost ([::1]:39716 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kaDOQ-00039F-UM for larch@yhetil.org; Wed, 04 Nov 2020 02:39:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59802) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kaDNG-0002eV-37 for guix-devel@gnu.org; Wed, 04 Nov 2020 02:38:30 -0500 Received: from mailrelay.tugraz.at ([129.27.2.202]:41282) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kaDNC-00060Q-Kc for guix-devel@gnu.org; Wed, 04 Nov 2020 02:38:29 -0500 Received: from nijino.local (217-149-162-161.nat.highway.telekom.at [217.149.162.161]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4CQz6367vyz1LWpP; Wed, 4 Nov 2020 08:38:19 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 mailrelay.tugraz.at 4CQz6367vyz1LWpP DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1604475500; bh=aURjg4xRlV6QiHhZALCBiyJq6ME05yw6ex5XwgvFmCs=; h=Subject:From:To:Cc:Date:In-Reply-To:From; b=rkQvA38jHzUB6+R1qZxpYmc4YG/LHwNDsWVaP5RnbDpE0MxRgpQouOMZrx3UPUmhI BaNPWaDjc0A5L1BDemHYQaPm0vI+xir5Hh66iPGyTrG1vy+97k1yNMqEXKLWNuvvPZ BVx7kDHKHph4glVn1hiRh8jSpA4fEU3CibOH0EM0= Message-ID: <33db285c56516bac910112344b7c9766221bdaf3.camel@student.tugraz.at> Subject: A public Lisp programming interface provide feature like `guix environment --container` From: Leo Prikler To: all_but_last@163.com Date: Wed, 04 Nov 2020 08:38:19 +0100 In-Reply-To: 86a6vx7pdq.fsf@163.com Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUG-Backscatter-control: bt4lQm5Tva3SBgCuw0EnZw X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.116 Received-SPF: pass client-ip=129.27.2.202; envelope-from=leo.prikler@student.tugraz.at; helo=mailrelay.tugraz.at X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/04 02:38:21 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=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.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@gnu.org Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Scanner: ns3122888.ip-94-23-21.eu Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=tugraz.at header.s=mailrelay header.b=rkQvA38j; dmarc=pass (policy=none) header.from=student.tugraz.at; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Spam-Score: -0.21 X-TUID: misH9K7p1IRj Hello, Am Mittwoch, den 04.11.2020, 11:49 +0800 schrieb Zhu Zihao > "guix environment --container" is a very useful feature for me to > isolate the untrusted software. But sadly it lacks a interface for > user > to use it in Lisp programming. > > In (guix scripts environment), only `guix-environment` is exported. > but > it process unix style command line option. (guix scripts …) *is* the command line interface, so it makes sense, that its interface handles command line arguments. > I'm wondering it's good to expose some interface suitable for Lisp, > just > like the internal function `launch-environment/container`. This can > encourage me to port more container entry script from shell to Guile. launch-environment/container still assumes the command to be a shell script, which I think is not quite what you want. You probably want to take a look at call-with-container from (guix build linux-container) or child-hurds. I currently don't know of any procedure, that "directly" invokes Scheme code through Guix environments, so you'd have to build that on your own. However, given that your stated goal is to port container entry scripts [I read this as "the script called by the container at entry"] to Guile, would it not make sense to have (guix-environment [ENVIRONMENT OPTIONS] "--" "guile" "entry.scm") WDYT? Regards, Leo