From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Marusich Subject: Re: Problem using multiple manifest files Date: Tue, 23 Oct 2018 01:07:08 -0700 Message-ID: <87mur52ij7.fsf@gmail.com> References: <87sh0x4yh1.fsf@sh531.localdomain> 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]:57366) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gErjx-0002wt-6j for help-guix@gnu.org; Tue, 23 Oct 2018 04:08:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gErik-00017D-IT for help-guix@gnu.org; Tue, 23 Oct 2018 04:07:30 -0400 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]:43957) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gEric-0000Qk-NP for help-guix@gnu.org; Tue, 23 Oct 2018 04:07:15 -0400 Received: by mail-pf1-x42d.google.com with SMTP id q1-v6so274288pfh.10 for ; Tue, 23 Oct 2018 01:07:12 -0700 (PDT) In-Reply-To: <87sh0x4yh1.fsf@sh531.localdomain> (Mikhail Kryshen's message of "Mon, 22 Oct 2018 21:39:54 +0300") 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: Mikhail Kryshen Cc: =?utf-8?Q?Thadd=C3=A4us_T=C3=B6ppen?= , help-guix@gnu.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Mikhail Kryshen writes: > 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. I see. Thank you for the explanation! That does indeed seem to be the intent. =2D-=20 Chris --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEy/WXVcvn5+/vGD+x3UCaFdgiRp0FAlvO1qwACgkQ3UCaFdgi Rp1hFxAAoOJCmCZzLx3qShjvTC4iZ6zFLFBdu5YITHEumGtcWH23mvPWa8Aw+Fgi 85obLyBV2BW2Rq+MoF7s/okPsRuUuYPqCXVCUuCJ1jDwDBFPkbNsB1iZ8S9JPsmb 3W+zNYFxQjOXPMPWjqTwJmBfh2JSTs2tBz+BnAXoSAQIe+a5yaHCLSXvxmc5xcD+ vl6l+kMluY8V9RXC3wRGgBGAzfnQwHsoQJfK0RdHT/ZbjTFJdM98N6OAnAVaYWDp qHdW/69EuLeF/XA3N0PTRg8NYBWSSdjaTOcQKb3IIgG8NMinhByeFV8RDg1nExNm VtCvm/vsqZgtkdvxFdiZjKTssn/M1HOjMqta2bJU2Us79Md/dcrvm2KNVj9RFGgu 5M05b3vFn7THIOZaJaM7HaTWuI7Cz4fjYNZPgzzwDbYTmZhmIddZTh4WNk+8E9xw uHXM0RCnoTWXKQWjhU0s3cBTBBbg17Q3lA3yIiyyALo4J709+n3BiH6b0NjcStWP HnMRmu1dItzAOmOGYmkjH6gfe/nL9lbA3nnunqNJPbxeuvbSYNEu3yS8rgzVgATA ldwPw5ZnwJyVOf3nhjp0AAjbI9z8tFutP2mwfyy7krln1bgivhQJh0b0vwCOcWvC hov01oOp1kDOsy4ITOQyykRF4yzKqlUan/SW9eIhdTtH0NxKtu8= =pNZa -----END PGP SIGNATURE----- --=-=-=--