unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* guix environment guix -pure can't locate lesspipe
@ 2021-03-23 22:25 c4t0
  2021-03-24  0:04 ` Julien Lepiller
  0 siblings, 1 reply; 3+ messages in thread
From: c4t0 @ 2021-03-23 22:25 UTC (permalink / raw)
  To: guix-devel


Hi,

I'm having trouble importing a package from hackage, so I tried to debug
the import source code. After cloning guix I found that I can't start a pure environment:

guix environment guix --pure --ad-hoc help2man git strace
Command 'lesspipe' is available in the following places
 * /bin/lesspipe
 * /usr/bin/lesspipe
The command could not be located because '/bin:/usr/bin' is not included in the PATH environment variable.
lesspipe: command not found

If I use --container it works:

$guix environment guix --pure --ad-hoc help2man git strace lesspipe --container
me@mypc ~/guix/git/guix [env]$

but then I have problems connecting with the daemond:
./pre-inst-env guix build hello
guix build: error: failed to connect to`/usr/local/var/guix/daemon-socket/socket': No such file or directory

(also there isn't any file in my user environment with that name)

So I have to run guix environment with --network and start one:
$guix environment guix --pure --ad-hoc help2man git strace lesspipe --container
me@mypc ~/guix/git/guix [env]$

and then
./pre-inst-env guix-daemon &
and
./pre-inst-env guix build hello

it appears to work, but really I don't know if i'm making a mess at
this point... I can't pass --build-users-group=guixbuild because it
doesn't exist inside the container.
And besides more that one daemon in the same store shurely produces
nasty race conditions.

I think that running inside a container should be the way
to do it but using the store in read-only mode to avoid installing stuff
(or maybe that is not a problem since it can be GC later?) or providing
a way to connect with the running daemon.

So i'm asking if the last things that I do are safe, and should be
included in the manual, because it take me a while to figure it out.

or we have a problem with non containerized environment for guix
development. Any ideas what might be the problem?

or there isn't any need even to start a guix environment... (do not
think so)

COD


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: guix environment guix -pure can't locate lesspipe
  2021-03-23 22:25 guix environment guix -pure can't locate lesspipe c4t0
@ 2021-03-24  0:04 ` Julien Lepiller
  2021-03-24 14:41   ` c4t0
  0 siblings, 1 reply; 3+ messages in thread
From: Julien Lepiller @ 2021-03-24  0:04 UTC (permalink / raw)
  To: guix-devel, c4t0



Le 23 mars 2021 18:25:38 GMT-04:00, c4t0 <c4t0@riseup.net> a écrit :
>
>Hi,
>
>I'm having trouble importing a package from hackage, so I tried to
>debug
>the import source code. After cloning guix I found that I can't start a
>pure environment:
>
>guix environment guix --pure --ad-hoc help2man git strace
>Command 'lesspipe' is available in the following places
> * /bin/lesspipe
> * /usr/bin/lesspipe
>The command could not be located because '/bin:/usr/bin' is not
>included in the PATH environment variable.
>lesspipe: command not found

This is probably because a start file from bash or your shell uses lesspipe, but it's not available in the environment. Something similar happens to me on Fedora where it wants to install software that's already there. I simply deny the request to install, as it's not a fatal error.

>
>If I use --container it works:
>
>$guix environment guix --pure --ad-hoc help2man git strace lesspipe
>--container
>me@mypc ~/guix/git/guix [env]$
>
>but then I have problems connecting with the daemond:
>./pre-inst-env guix build hello
>guix build: error: failed to connect
>to`/usr/local/var/guix/daemon-socket/socket': No such file or directory

Here, you probably.forgot to pass --localstatedir as documented in the manual. If you don't do so, it might result in a broken guix installation!

>
>(also there isn't any file in my user environment with that name)
>
>So I have to run guix environment with --network and start one:
>$guix environment guix --pure --ad-hoc help2man git strace lesspipe
>--container
>me@mypc ~/guix/git/guix [env]$
>
>and then
>./pre-inst-env guix-daemon &
>and
>./pre-inst-env guix build hello
>
>it appears to work, but really I don't know if i'm making a mess at
>this point... I can't pass --build-users-group=guixbuild because it
>doesn't exist inside the container.
>And besides more that one daemon in the same store shurely produces
>nasty race conditions.

You shouldn't run guix-daemon from the checkout. It is not needed. Normally, you should be able to share /var/guix inside the container, but the container itself should not be needed.

>
>I think that running inside a container should be the way
>to do it but using the store in read-only mode to avoid installing
>stuff
>(or maybe that is not a problem since it can be GC later?) or providing
>a way to connect with the running daemon.
>
>So i'm asking if the last things that I do are safe, and should be
>included in the manual, because it take me a while to figure it out.

No, they're not safe. You might have corrupted guix's database, which might result in errors down the road. I'd suggest that you run guix gc --verify=contents to make sure your store is alright.

>
>or we have a problem with non containerized environment for guix
>development. Any ideas what might be the problem?
>
>or there isn't any need even to start a guix environment... (do not
>think so)
>
>COD


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: guix environment guix -pure can't locate lesspipe
  2021-03-24  0:04 ` Julien Lepiller
@ 2021-03-24 14:41   ` c4t0
  0 siblings, 0 replies; 3+ messages in thread
From: c4t0 @ 2021-03-24 14:41 UTC (permalink / raw)
  To: guix-devel, Julien Lepiller

Julien Lepiller <julien@lepiller.eu> writes:

> Le 23 mars 2021 18:25:38 GMT-04:00, c4t0 <c4t0@riseup.net> a écrit :
>>
>>Hi,
>>
>>I'm having trouble importing a package from hackage, so I tried to
>>debug
>>the import source code. After cloning guix I found that I can't start a
>>pure environment:
>>
>>guix environment guix --pure --ad-hoc help2man git strace
>>Command 'lesspipe' is available in the following places
>> * /bin/lesspipe
>> * /usr/bin/lesspipe
>>The command could not be located because '/bin:/usr/bin' is not
>>included in the PATH environment variable.
>>lesspipe: command not found
>
> This is probably because a start file from bash or your shell uses
> lesspipe, but it's not available in the environment. Something similar
> happens to me on Fedora where it wants to install software that's
> already there. I simply deny the request to install, as it's not a
> fatal error.
>

You're right, the culprit was:

# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"

so I replace it with:

[ -x /usr/bin/lesspipe ] \
    && [ $(echo $PATH | grep ':/bin:' >/dev/null; echo $?) -eq 0 ] \
    && eval "$(SHELL=/bin/sh lesspipe)"

a little verbose, but it works.

>>
>>If I use --container it works:
>>
>>$guix environment guix --pure --ad-hoc help2man git strace lesspipe
>>--container
>>me@mypc ~/guix/git/guix [env]$
>>
>>but then I have problems connecting with the daemond:
>>./pre-inst-env guix build hello
>>guix build: error: failed to connect
>>to`/usr/local/var/guix/daemon-socket/socket': No such file or directory
>
> Here, you probably.forgot to pass --localstatedir as documented in the manual. If you don't do so, it might result in a broken guix installation!
>

Ok, after:
$guix environment guix --pure --ad-hoc help2man git strace
$./bootstrap
$./configure --localstatedir=/var
$./pre-inst-env guix build hello

it builds fine!

>>
>>(also there isn't any file in my user environment with that name)
>>
>>So I have to run guix environment with --network and start one:
>>$guix environment guix --pure --ad-hoc help2man git strace lesspipe
>>--container
>>me@mypc ~/guix/git/guix [env]$
>>
>>and then
>>./pre-inst-env guix-daemon &
>>and
>>./pre-inst-env guix build hello
>>
>>it appears to work, but really I don't know if i'm making a mess at
>>this point... I can't pass --build-users-group=guixbuild because it
>>doesn't exist inside the container.
>>And besides more that one daemon in the same store shurely produces
>>nasty race conditions.
>
> You shouldn't run guix-daemon from the checkout. It is not
> needed. Normally, you should be able to share /var/guix inside the
> container, but the container itself should not be needed.
>

Ok, it was my mistake, didn't realize that the problem was in .bashrc;
I'll use it without a container. No problem using the store, when
developing then? I guess that the calculated hash will be different and
I will not break anything. The environment ¢ommand takes care of
protecting the profile.

Maybe I should have sended this mail to help-guix.

Thanks again!


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-03-24 15:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-23 22:25 guix environment guix -pure can't locate lesspipe c4t0
2021-03-24  0:04 ` Julien Lepiller
2021-03-24 14:41   ` c4t0

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).