From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Thompson, David" Subject: Re: Language library packages should require language package Date: Sun, 24 Apr 2016 09:09:33 -0400 Message-ID: References: <571CBB14.8090200@crazy-compilers.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34712) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1auJn5-00070I-4f for guix-devel@gnu.org; Sun, 24 Apr 2016 09:09:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1auJn4-0008PX-1x for guix-devel@gnu.org; Sun, 24 Apr 2016 09:09:35 -0400 Received: from mail-yw0-x229.google.com ([2607:f8b0:4002:c05::229]:35918) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1auJn3-0008Om-QA for guix-devel@gnu.org; Sun, 24 Apr 2016 09:09:33 -0400 Received: by mail-yw0-x229.google.com with SMTP id o66so165526245ywc.3 for ; Sun, 24 Apr 2016 06:09:33 -0700 (PDT) In-Reply-To: <571CBB14.8090200@crazy-compilers.com> 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" To: Hartmut Goebel Cc: guix-devel On Sun, Apr 24, 2016 at 8:24 AM, Hartmut Goebel wrote: > Hi, > > playing around with guix environment, I stepped over some weirdness The > weirdest of is (e.g.): > > guix environment --ad-hoc python-requests > > will give you . . . . nothing. That's not quite right. It will give you exactly what you asked for: an environment with only python-requests used in it. python-requests defines no search paths, so no environment variables are set. > Since python-requests does not have python as input, the package is > installed somewhere out of reach. This is even true when using a python > virtualenv prior to entering the guix environment (see below for details). > > I assume, this is the same for perl and other languages. > > So I propose to add python, perl, ... as an import for the "library" > packages of this language. This would be in the same line as .rpm and > .deb packages work. No, this wouldn't be a good idea. You used the --ad-hoc flag, which means "create an environment with *only* the direct packages I specified." This behavior is correct and will not be changed. If you want an ad-hoc python environment, you should add a python package to your environment: guix environment --ad-hoc python python-requests > > Now the weirdness analysis: > > $ cat echo_paths.sh > echo PATH=$PATH > echo PYTHONPATH=$PYTHONPATH > type python > > Now let's set up "--ad-hoc python-requests" (but no python): > > $ guix environment --pure --ad-hoc python-requests -- ./echo_paths.sh > PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:. > PYTHONPATH= > python is /usr/bin/python > > Wow, the system python is used, but where is python-requests? Maybe not > installed, since it already is in the system installation. Let's try a > virtual environment: > > $ pyvenv /tmp/foo > $ source /tmp/foo/bin/activate > (foo)$ type python > python ist /tmp/foo/bin/python > > (foo)$ guix environment --pure --ad-hoc python-requests -- ./echo_paths.sh > PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:. > PYTHONPATH= > python is /usr/bin/python > > Huh? What? The virtual env was ignored (or dropped). Why this? Looks > like --pure resets the environment to something is thinks is correct, > even if if ist not adding anything to the environments. > > Let's try without --pure: > > (foo)$ guix environment --ad-hoc python-requests -- ./echo_paths.sh > PATH=/tmp/foo/bin:/usr/local/bin:/usr/bin:/usr/local/games:/usr/games:/usr/lib64/qt4/bin:/usr/lib64/qt5/bin:/home/hartmut/bin:/home/hartmut/.local/bin > PYTHONPATH=/home/hartmut/lib/python > python is /tmp/foo/bin/python > > Okay, this time I get the python within the virtual env. But still: > where is python-requests? > > (foo)$ guix environment --ad-hoc python-requests -- ls > /tmp/foo/lib/python3.4/site-packages/ > easy_install.py pip pkg_resources.py setuptools > _markerlib pip-6.1.1.dist-info __pycache__ > setuptools-3.6.dist-info > > It is not installed in the virtual environment either. Where is it? > > -- > Regards > Hartmut Goebel > > | Hartmut Goebel | h.goebel@crazy-compilers.com | > | www.crazy-compilers.com | compilers which you thought are impossible | > > >