Re: Changing HTTP proxy settings in GuixSD

2017-11-16 Thread Konrad Hinsen
Hi Ludo,

> I’ll update the ‘guix’ package soon so that this change is available to
> daemon-side code such as ‘guix substitute’.  In the meantime you can run
> the daemon from a checkout:
>
>   sudo -E ./pre-inst-env guix-daemon …

That works fine - thanks!

Konrad.



Re: Changing HTTP proxy settings in GuixSD

2017-11-11 Thread Ludovic Courtès
Mark H Weaver  skribis:

> l...@gnu.org (Ludovic Courtès) writes:
>> It turned out to come from a typo in Guile 2.2’s web client, now fixed
>> here:
>>
>>   
>> https://git.savannah.gnu.org/cgit/guile.git/commit/?h=stable-2.2&id=7d0d9e2c25c1e872cfc7d14ab5139915f1813d56
>
> [...]
>
>> diff --git a/module/web/http.scm b/module/web/http.scm
>> index 993b50e..62f0624 100644
>> --- a/module/web/http.scm
>> +++ b/module/web/http.scm
>> [...]
>> @@ -1158,7 +1158,7 @@ three values: the method, the URI, and the version."
>>  (put-symbol port scheme)
>>  (put-string port "://")
>>  (cond
>> - ((host string-index #\:)
>> + ((string-index host #\:)
>>(put-char #\[ port)
>>(put-string port host
>>(put-char port #\])))
>
> There are 4 typos in the cond clause above, all introduced in this
> commit:
>
>   
> https://git.savannah.gnu.org/cgit/guile.git/commit/?id=96b994b6f815747ce2548123cc996d8132bd4781
>
> which includes:
>
> - ((string-index host #\:)
> -  (display #\[ port)
> -  (display host port)
> -  (display #\] port))
> + ((host string-index #\:)
> +  (put-char #\[ port)
> +  (put-string port host
> +  (put-char port #\])))
>
> In addition to the typo you fixed:
>
> * The first call to 'put-char' above has its arguments reversed.
> * The following line is missing its ')'.
> * The last line has an extra ')'.

Ouch, good catch.  I pushed appropriate fixes.

If you spot more, feel free to fix them directly!  :-)

Thanks,
Ludo’.



Re: Changing HTTP proxy settings in GuixSD

2017-11-11 Thread Mark H Weaver
Hi,

l...@gnu.org (Ludovic Courtès) writes:
> It turned out to come from a typo in Guile 2.2’s web client, now fixed
> here:
>
>   
> https://git.savannah.gnu.org/cgit/guile.git/commit/?h=stable-2.2&id=7d0d9e2c25c1e872cfc7d14ab5139915f1813d56

[...]

> diff --git a/module/web/http.scm b/module/web/http.scm
> index 993b50e..62f0624 100644
> --- a/module/web/http.scm
> +++ b/module/web/http.scm
> [...]
> @@ -1158,7 +1158,7 @@ three values: the method, the URI, and the version."
>  (put-symbol port scheme)
>  (put-string port "://")
>  (cond
> - ((host string-index #\:)
> + ((string-index host #\:)
>(put-char #\[ port)
>(put-string port host
>(put-char port #\])))

There are 4 typos in the cond clause above, all introduced in this
commit:

  
https://git.savannah.gnu.org/cgit/guile.git/commit/?id=96b994b6f815747ce2548123cc996d8132bd4781

which includes:

- ((string-index host #\:)
-  (display #\[ port)
-  (display host port)
-  (display #\] port))
+ ((host string-index #\:)
+  (put-char #\[ port)
+  (put-string port host
+  (put-char port #\])))

In addition to the typo you fixed:

* The first call to 'put-char' above has its arguments reversed.
* The following line is missing its ')'.
* The last line has an extra ')'.

   Mark



Re: Changing HTTP proxy settings in GuixSD

2017-11-10 Thread ng0
Ludovic Courtès transcribed 1.4K bytes:
> Hi Konrad,
> 
> Konrad Hinsen  skribis:
> 
> >> That error looks suspicious.  Perhaps you already know this, but it
> >> probably means that the string "mirror.hydra.gnu.org" wound up being
> >> used where a procedure should probably have been used instead.  For
> >> example, in your Guile REPL, you can reproduce this kind of error like
> >> this:
> >>
> >> scheme@(guile-user)> ("this is not a procedure")
> >> ERROR: ERROR: Wrong type to apply: "this is not a procedure"
> >
> > Suspicious indeed...
> 
> It turned out to come from a typo in Guile 2.2’s web client, now fixed
> here:
> 
>   
> https://git.savannah.gnu.org/cgit/guile.git/commit/?h=stable-2.2&id=7d0d9e2c25c1e872cfc7d14ab5139915f1813d56
> 
> and I’ve done some monkey-patching here:
> 
>   
> https://git.savannah.gnu.org/cgit/guix.git/commit/?id=59da6f04f45b36696a9385babab3080d7d854fba
> 
> I’ll update the ‘guix’ package soon so that this change is available to
> daemon-side code such as ‘guix substitute’.  In the meantime you can run
> the daemon from a checkout:
> 
>   sudo -E ./pre-inst-env guix-daemon …
> 
> For reference, I used this command to test proxy support:
> 
>   http_proxy=http://localhost:8118 \
>   ./pre-inst-env guix download http://www.gnu.org
> 
> where Privoxy is listening to localhost:8118.
> 
> Thanks for reporting the issue!
> 
> Ludo’.

Oh. I think I encountered a similar (or the same?) problem one
year ago without ever reporting it.
I'll check soon if my usecase is fixed with your latest commits.

Thanks for working on this!
-- 
GnuPG: A88C8ADD129828D7EAC02E52E22F9BBFEE348588
GnuPG: https://dl.n0.is/dist/keys/
  WWW: https://we.make.ritual.n0.is


signature.asc
Description: PGP signature


Re: Changing HTTP proxy settings in GuixSD

2017-11-10 Thread Ludovic Courtès
Hi Konrad,

Konrad Hinsen  skribis:

>> That error looks suspicious.  Perhaps you already know this, but it
>> probably means that the string "mirror.hydra.gnu.org" wound up being
>> used where a procedure should probably have been used instead.  For
>> example, in your Guile REPL, you can reproduce this kind of error like
>> this:
>>
>> scheme@(guile-user)> ("this is not a procedure")
>> ERROR: ERROR: Wrong type to apply: "this is not a procedure"
>
> Suspicious indeed...

It turned out to come from a typo in Guile 2.2’s web client, now fixed
here:

  
https://git.savannah.gnu.org/cgit/guile.git/commit/?h=stable-2.2&id=7d0d9e2c25c1e872cfc7d14ab5139915f1813d56

and I’ve done some monkey-patching here:

  
https://git.savannah.gnu.org/cgit/guix.git/commit/?id=59da6f04f45b36696a9385babab3080d7d854fba

I’ll update the ‘guix’ package soon so that this change is available to
daemon-side code such as ‘guix substitute’.  In the meantime you can run
the daemon from a checkout:

  sudo -E ./pre-inst-env guix-daemon …

For reference, I used this command to test proxy support:

  http_proxy=http://localhost:8118 \
  ./pre-inst-env guix download http://www.gnu.org

where Privoxy is listening to localhost:8118.

Thanks for reporting the issue!

Ludo’.



Re: Changing HTTP proxy settings in GuixSD

2017-11-10 Thread Konrad Hinsen
Hi Chris,

> That error looks suspicious.  Perhaps you already know this, but it
> probably means that the string "mirror.hydra.gnu.org" wound up being
> used where a procedure should probably have been used instead.  For
> example, in your Guile REPL, you can reproduce this kind of error like
> this:
>
> scheme@(guile-user)> ("this is not a procedure")
> ERROR: ERROR: Wrong type to apply: "this is not a procedure"

Suspicious indeed...

> The workaround that Ludo described, in which you temporarily stop the
> guix-daemon, and then start it in an environment where http_proxy is set
> appropriately, should work.

That's exactly what I did.

> If it isn't, then can I ask to see the commands and conigs you're
> using which fail?

Here are the commands I typed:

   sudo -s
   herd stop guix-daemon
   http_proxy=http://proxy.synchrotron-soleil.fr:8080/  guix-daemon 
--build-users-group=guixbuild
   guix system reconfigure /etc/config.scm

The config I used in this first test (attached) is exactly the same one
I am currently running, with no reference to the proxy at all. I was
planning to add that in a second step.

Konrad.



config.scm
Description: Binary data


Re: Changing HTTP proxy settings in GuixSD

2017-11-09 Thread Chris Marusich
Konrad Hinsen  writes:

>> A quick workaround would be to do something along these lines:
>>
>># herd stop guix-daemon
>># http_proxy=… guix-daemon --build-users-group=guixbuild
>># guix system reconfigure config.scm
>>
>> where config.scm has the relevant proxy configuration of in
>> ‘guix-configuration’.
>>
>> Would that work for you?
>
> No. Downloads fail with messages of the type
>
> ERROR: Wrong type to apply: "mirror.hydra.gnu.org"
>
> This looks like the proxy returns something that guix-daemon doesn't
> expect. Unfortunately, this may well be the fault of my institutions
> proxy, which has caused lots of people lots of trouble of various
> kinds.

That error looks suspicious.  Perhaps you already know this, but it
probably means that the string "mirror.hydra.gnu.org" wound up being
used where a procedure should probably have been used instead.  For
example, in your Guile REPL, you can reproduce this kind of error like
this:

scheme@(guile-user)> ("this is not a procedure")
ERROR: ERROR: Wrong type to apply: "this is not a procedure"

The workaround that Ludo described, in which you temporarily stop the
guix-daemon, and then start it in an environment where http_proxy is set
appropriately, should work.  If it isn't, then can I ask to see the
commands and conigs you're using which fail?

-- 
Chris


signature.asc
Description: PGP signature


Re: Changing HTTP proxy settings in GuixSD

2017-11-06 Thread Konrad Hinsen

Hi Ludo,


A quick workaround would be to do something along these lines:

   # herd stop guix-daemon
   # http_proxy=… guix-daemon --build-users-group=guixbuild
   # guix system reconfigure config.scm

where config.scm has the relevant proxy configuration of in
‘guix-configuration’.

Would that work for you?


No. Downloads fail with messages of the type

ERROR: Wrong type to apply: "mirror.hydra.gnu.org"

This looks like the proxy returns something that guix-daemon doesn't 
expect. Unfortunately, this may well be the fault of my institutions 
proxy, which has caused lots of people lots of trouble of various kinds.


Konrad.




Re: Changing HTTP proxy settings in GuixSD

2017-10-26 Thread Ludovic Courtès
Hello!

Konrad Hinsen  skribis:

> I am running GuixSD in a virtual machine on a laptop that I use in
> different network environments. One of them requires the use of a HTTP
> proxy, direct accesses being blocked. As a consequence, the Guix build
> daemon fails when downloading anything.
>
> After reading the manual, I come to the conclusion that the only way
> to change the HTTP proxy settings for the build daemon is via
> (guix-configuration ...), which requires to do "guix system
> reconfigure".
> Unfortunately that command fails because it tries to download stuff
> (no idea why, BTW, I didn't do a "guix pull" since I last used it) and
> fails. It looks like I'd have to reconfigure while I am still in a
> working network environment, meaning I'd have to anticipate switching
> networks, which I can't.

Not that it helps you much, but there’s an open bug on this topic:
.

> More generally, it would be nice to have to be able to change network
> settings without reconfiguring and rebooting. But at first, I'd be
> happy if I could get my system to work at all.

I agree.

A quick workaround would be to do something along these lines:

  # herd stop guix-daemon
  # http_proxy=… guix-daemon --build-users-group=guixbuild
  # guix system reconfigure config.scm

where config.scm has the relevant proxy configuration of in
‘guix-configuration’.

Would that work for you?

HTH,
Ludo’.