From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pierre Neidhardt Subject: Re: Setting up Guile for use with Guix Date: Fri, 17 Aug 2018 17:46:03 +0200 Message-ID: <87h8jt3sjo.fsf@gmail.com> References: <3486242.BVVHvFmvKA@aleksandar-ixtreme-m5740> 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]:33606) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fqgx0-0007vd-Pq for help-guix@gnu.org; Fri, 17 Aug 2018 11:46:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fqgwy-0005Sx-3m for help-guix@gnu.org; Fri, 17 Aug 2018 11:46:10 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:44960) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fqgwx-0005S3-SB for help-guix@gnu.org; Fri, 17 Aug 2018 11:46:08 -0400 Received: by mail-wr1-x42b.google.com with SMTP id r16-v6so7453147wrt.11 for ; Fri, 17 Aug 2018 08:46:07 -0700 (PDT) In-reply-to: <3486242.BVVHvFmvKA@aleksandar-ixtreme-m5740> 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: HiPhish Cc: help-guix@gnu.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Looks like you've double-sent the message ;) > Guile does not have a package manager of its own Actually there is https://gitlab.com/a-sassmannshausen/guile-hall/ > Will this install a second Guile for me (one system-wide from > apt and one for the Guix profile from Guix)? Yes, Guix is only aware of its own store. "Functional" means that the environment (the host system) does not impact the way packages are built and installed. Whatever is done on the APT side will not change how Guix performs its oper= ations. > Should I uninstall the Guile from apt? You can. If you like Guix better, you can even "apt-remove" everything tha= t is not strictly necessary to for Kubuntu to start up. > How do I even set up Guile to work with Guix packages? I don't have any > installed yet, but when I open a regular Guile REPL and type > > (use-modules (guix gexp)) This is a Guile question. Check the value of %load-path In my case, it returns =2D-8<---------------cut here---------------start------------->8--- %load-path $2 =3D ("/home/ambrevar/.cache/emacs/elpa/geiser-20180626.1140/scheme/guile= /" "/home/ambrevar/.guix-profile/share/guile/site/2.2" "/run/current-system/profile/share/guile/site/2.2" "/gnu/store/p9wm67w3rfw3hlb9iljgvsfn84mz4w9d-guile-2.2.4/share/guile/2.2" "/gnu/store/p9wm67w3rfw3hlb9iljgvsfn84mz4w9d-guile-2.2.4/share/guile/site/2= .2" "/gnu/store/p9wm67w3rfw3hlb9iljgvsfn84mz4w9d-guile-2.2.4/share/guile/site" "/gnu/store/p9wm67w3rfw3hlb9iljgvsfn84mz4w9d-guile-2.2.4/share/guile") =2D-8<---------------cut here---------------end--------------->8--- "/run/current-system/profile/share/guile/site/2.2" contains guix.scm. Then from a REPL I can call ,use (guix gexp) I'm not so sure about foreign distros, but if guix.scm is nowhere in the %load-path, you might have to install the `guix` package: $ guix package --install guix This should put guix.scm in one of the /guile/site folders. > Am I supposed to create a custom per-project profile, switch > to that profile while working, and then switch back to normal once done? This is a possible workflow, but you don't have to. You can also install t= he tools and libraries in the default user profile. Your question targets more the kind of project (i.e. tool + programming language) than Guix it self: each tool and programming language has (or sho= uld have) a notion of "search path". In the case of Guile, it's embodied in the %load-path variable. When installing packages, Guix sets environment variables so that the user profile (~/.guix-profile by default) is added to the search paths of the va= rious tools. You can check the environment from the shell: $ env As a rule of thumb, everything should work out-of-the-box with Guix and you should not have to configure anything extra. Else it's probably a bug, or = you misconfigured Guix. > In my case I want to install Haunt. There are two packages: 'haunt' and > 'guile2.0-haunt', the only difference seems to be which version of Guile = they > require. Right? Correct. $ guix package --show=3Dhaunt | recsel -p dependencies will show you the dependencies. > To make matters more complicated, Haunt is not just a library, > but also a stand-alone command-line program, which (I presume) includes i= ts > own Guile implementation, The Guile binary is a dependency, it's not embedded into Haunt. > and so I need to make my own libraries available to > Haunt's Guile, not the Guile I installed on my system. I'm not sure I understood your issue. If you install Haunt, then the requi= red Guile will be automatically installed into the Guix store. It's perfectly fine to have 2 Guiles (one from Guix, one from APT) on your system. If you call `guile`, it will call the first Guile found in the PATH. You c= an check which one it is with $ which guile You can also force which Guile you want to call: $ /usr/bin/guile The above is Guile from APT. $ guix build guile /gnu/store/zs259yxkp6chya1nwjhb9saavkz4hpjv-guile-2.2.4-debug /gnu/store/p9wm67w3rfw3hlb9iljgvsfn84mz4w9d-guile-2.2.4 $ /gnu/store/p9wm67w3rfw3hlb9iljgvsfn84mz4w9d-guile-2.2.4/bin/guile The above line is Guile from Guix. For libraries, it does not matter which Guile runs (as long as they are compatible). What matters is that the %load-path of the running Guile poin= ts to the library. For programs (e.g. Haunt), the shabang points to which Guile version is use= d. For instance, a Guile script starting with #!guile will get executed with the first Guile found in the PATH. On my system, Haunt's shabang is the following: =2D-8<---------------cut here---------------start------------->8--- #!/gnu/store/1mr5izrbxwd7cbq8m1xrqm45rzkibpsj-guile-2.2.3/bin/guile --no-au= to-compile =2D*- scheme -*- !# =2D-8<---------------cut here---------------end--------------->8--- Check the Guile reference, this is covered in details in "(guile) Guile Scripting". Hope that helps. =2D-=20 Pierre Neidhardt https://ambrevar.xyz/ --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAlt27bsACgkQm9z0l6S7 zH+twQf/UjutLKY1FQE0ouH5ZEUIsEd9So9HFtgpntGSO/zUUfkhvJ3lJMg9VtHb BdgIhlDV6CW7irO+ZU/rYHlV+W+23j+tj9nGDybAJ0Z1dRcD1bbAaPmiCWwbDvgX 260Fx9DFpLMjHRldriuSPbSW55HOXt24WqqyXpOYYibIEpNcIdCTqTmF4J+bO81t /G3cKHcsrx6inYFUi6ZvaevERtQIKaBFZYbW/C65bSrff8uSvvVlG8V2VE7Vw22q 4vvp83BHd4fwFkLikohvCxDLyReQZz4WtC2yCjdhwq+BhYpzyOWaFoG6UYUzy734 8wk61DPlJA6k8EH0FeTbjcqL6SOzJA== =Ipzw -----END PGP SIGNATURE----- --=-=-=--