From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mikhail Kryshen Subject: Re: Problem using multiple manifest files Date: Mon, 22 Oct 2018 21:39:54 +0300 Message-ID: <87sh0x4yh1.fsf@sh531.localdomain> References: <875zxwqts1.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39868) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gEf7W-00023u-Dm for help-guix@gnu.org; Mon, 22 Oct 2018 14:40:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gEf7T-0005xd-6h for help-guix@gnu.org; Mon, 22 Oct 2018 14:40:06 -0400 Received: from mail.kryshen.net ([31.220.44.128]:55040) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gEf7S-0005w4-Vk for help-guix@gnu.org; Mon, 22 Oct 2018 14:40:03 -0400 In-Reply-To: <875zxwqts1.fsf@gmail.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane.org@gnu.org Sender: "Help-Guix" To: Chris Marusich Cc: =?utf-8?Q?Thadd=C3=A4us_T=C3=B6ppen?= , help-guix@gnu.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Chris Marusich writes: > Mikhail Kryshen writes: > >> (use-modules (srfi srfi-1) >> ((guix ui) #:select (make-user-module))) >> >> (define (load-manifest file) >> ;; Load manifest file in a fresh module with necessary imports. >> (let ((module (make-user-module '((guix profiles) (gnu))))) >> (save-module-excursion >> (lambda _ >> (set-current-module module) >> (load (canonicalize-path file)))))) > > Neat example! Thanks!=20 > But what is make-user-module doing, and is it necessary? I looked into the Guix source and reproduced what "guix package -m" does to load a manifest file. Make-user-module procedure appear to be used in Guix to dynamically create modules for running user code. I could have simply used "load" here, but then all the files would be loaded in the same environment and could potentially interfere with each other. =2D-=20 Mikhail --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAEBCAAdFiEEw6yVFU/UQfkLWikDzxz0c4HWsG4FAlvOGXoACgkQzxz0c4HW sG5mlwv/fpn11zenhyRV6ADxvxOQdTpOyaxCbNcVmigXb+CPGaAGvy/DKNU7hxUr PG3mxHGWWYGC2X0ASmI+yP7Bs3oYZx0iGJBNh4ldlaVbx9/bb1e7YCYt39Ib6Lww dOipFG0lbDGnJyxgV7GNpdv/l55igDDR/PJMvUpgXvrEZnl0iEaFKp2mMCFnG4gU v39/RNmmKGqNG03dt/fmBRAP3TUdQOafA6Uq50c3lQcNanWxHwxjMtp/ia1aRLLH hsoKRszSpu1Ujef3+7Jto4dwZN+cnr+LhW9BZIpizhnu9R6kVWpY0niirz2Wkabt Okr2BRTbGPoPhyMC8whHoDRzJ6hWb+o/ra/tyf0L19jWcgkWttU3QgOMG+W/iwDs 8SM5tD1TBWzQ2M7e4eE3r8RroIItQtGSIlD7Y3nW+Fj3N18hCSMoRUknI5pWaDEz ulMvu52kyuvRpFPLxFX7py4C1ZGUz0tRCTs0lSLWY4n2LeA+mImSCvwvU/OKdfnW v7Ft/2C1 =Hswu -----END PGP SIGNATURE----- --=-=-=--