From mboxrd@z Thu Jan 1 00:00:00 1970 From: Amirouche Boubekki Subject: Re: guix-shell? Date: Thu, 28 Aug 2014 14:39:30 +0200 Message-ID: References: <87fvgo3mlx.fsf@gnu.org> <87zjesgqc5.fsf_-_@gnu.org> <878umb30sx.fsf@izanagi.i-did-not-set--mail-host-address--so-tickle-me> <20140826202004.GB11309@debian> <8761hf2dsl.fsf@izanagi.i-did-not-set--mail-host-address--so-tickle-me> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=20cf301b69cf28e0c80501afd501 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41895) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMyzZ-0002fU-T5 for guix-devel@gnu.org; Thu, 28 Aug 2014 08:39:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XMyzX-0006iY-TO for guix-devel@gnu.org; Thu, 28 Aug 2014 08:39:53 -0400 Received: from mail-yh0-x22c.google.com ([2607:f8b0:4002:c01::22c]:38281) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMyzX-0006iS-OF for guix-devel@gnu.org; Thu, 28 Aug 2014 08:39:51 -0400 Received: by mail-yh0-f44.google.com with SMTP id a41so437609yho.17 for ; Thu, 28 Aug 2014 05:39:51 -0700 (PDT) In-Reply-To: <8761hf2dsl.fsf@izanagi.i-did-not-set--mail-host-address--so-tickle-me> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: David Thompson Cc: guix-devel --20cf301b69cf28e0c80501afd501 Content-Type: text/plain; charset=UTF-8 2014-08-26 22:31 GMT+02:00 David Thompson : > Andreas Enge writes: > > > Hello, > > > > could you maybe provide a specification of what guix-shell is supposed > to do? > > Not knowing nix-shell, I admit to being somewhat lost as to which problem > > you are trying to solve. > > > > Andreas > > > > I think the Nix manual explains it best: > http://nixos.org/nix/manual/#sec-nix-shell > > > Basically, it creates a shell environment in which some packages > specified in an input file are available. > A great use-case for this is setting up development environments for > software projects. The core idea behind this is to be able to have an easy way to develop applications without requiring a heavy VM. This is kind of a container but at the shell level. It's more lightweight than VM, or LXC or docker but doesn't help with security, it's only for development. You install libraries and else in this "shell environment" and they have a higher priority than user and root libraries, so they are used by the application your are developing. In Python at least, it is called virtualenv. It has been merged into python dev branch. The thing is that you can only reliably install pure python packages in the virtualenv. Anything that requires non python dependencies can be of trouble. For instance, I never used virtualenv to use another version of mysql... an example of non-pure python package that gives trouble is "ipython". If I recall correctly cython based dependencies are also troublesome. That's said, it's very helpful. Most of the time you have no constraint or bugs because of binary stuff. You would have to be - multitasking a lot - to need to install two versions of PostgreSQL in parallel. One of the cons DevOps argue against the use of virtualenv is that it bypass the rigourous process of Debian stable & security *and* you have to manage two kinds of dependencies which makes devops work more difficult. For developpers and DevOps another cons is that you must be very rigorous with dependencies. Sometime the dev will install a library globally, the shell env will require it and find it in the global namespace and it will use it. When time arrive to reproduce the dev/prod environement you discover that a library is missing... with no information about the version to use. > A 'shell.nix' file would live in the root of a project's source tree. A > new developer would clone the repository, run 'nix-shell' and have an > environment that has everything needed to build and run the software. > Another solution might to use docker containers [nix docker ][recursive docker ]. I'm not sure what this solution will bring over nix-shell except that since it's a container, no global library will be used by the application. Otherwise said, you will need to track dependeciens from the very beginning. Docker is all the rage. VMware added support to it recently. This is seems to be the preferred method to do all things Cloud cf. EC2 and Google appengines clones (like heroku) for more data. > > Does that help? > > -- > David Thompson > Web Developer - Free Software Foundation - http://fsf.org > GPG Key: 0FF1D807 > Support the FSF: https://fsf.org/donate > > --20cf301b69cf28e0c80501afd501 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable



2014-08-26 22:31 GMT+02:00 David Thompson <dthompson2@worce= ster.edu>:
Andreas Enge <andreas@enge.f= r> writes:

> Hello,
>
> could you maybe provide a specification of what guix-shell is supposed= to do?
> Not knowing nix-shell, I admit to being somewhat lost as to which prob= lem
> you are trying to solve.
>
> Andreas
>

I think the Nix manual explains it best:
ht= tp://nixos.org/nix/manual/#sec-nix-shell

=C2=A0
Basically, it creates a shell environment in which some packages
specified in an input file are available.=C2=A0

=C2= =A0
A great use-case= for this is setting up development environments for software projects.

The core idea behind this is to be able to have an easy= way to develop applications
without requiring a heavy VM. This is kind = of a container but at the shell level. It's more
lightweight than V= M, or LXC or docker but doesn't help with security, it's only for d= evelopment.

You install libraries and else in this "shell environment" an= d they have a higher priority
than user and root libraries, so they are = used by the application your are developing.

In Python at least, it = is called virtualenv. It has been merged into python dev branch. The thing<= br> is that you can only reliably install pure python packages in the virtualen= v. Anything that requires
non python dependencies can be of t= rouble. For instance, I never used virtualenv to use
another = version of mysql... an example of non-pure python package that gives troubl= e is "ipython".
If I recall correctly cython based dependencies are also trouble= some.

That's said, it'= ;s very helpful. Most of the time you have no constraint or bugs because of= binary stuff.
You would have to be - multitasking a lot = - to need to install two versions of PostgreSQL in parallel.

<= div class=3D"gmail_quote">One of the cons DevOps argue against the use of v= irtualenv is that it bypass the rigourous
process of Debian stable & security and you have to manage two k= inds of dependencies which makes
devops= work more difficult.

For developpe= rs and DevOps another cons is that you must be very rigorous with dependenc= ies. Sometime
the dev will install a library globally, t= he shell env will require it and find it in the global namespace and it wil= l
use it. When time arrive to reproduce the dev/prod environement you di= scover that a library is missing... with no
information about the version to use.
<= div>=C2=A0
A 'sh= ell.nix' file would live in the root of a project's source tree.=C2= =A0 A
new developer would clone the repository, run 'nix-shell' and have = an
environment that has everything needed to build and run the software.

Another solution might to use docker contain= ers [nix d= ocker][recursive docker]. I'm not sure what this solution wil= l bring over nix-shell except that since it's a container, no global li= brary will be used by the application. Otherwise said, you will need to
track dependeciens from the very beginning.

Do= cker is all the rage. VMware added support to it recently. This is seems to= be the preferred method to do all things Cloud cf. EC2 and Google appengin= es clones (like heroku) for more data.
=C2=A0

Does that help?

--
David Thompson
Web Developer - Free Software Foundation - http://fsf.org
GPG Key: 0FF1D807
Support the FSF: https= ://fsf.org/donate


--20cf301b69cf28e0c80501afd501--