From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 22 05:08:36 2015 Received: (at 20402) by debbugs.gnu.org; 22 Apr 2015 09:08:37 +0000 Received: from localhost ([127.0.0.1]:35745 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Ykqe4-0000Wl-Ad for submit@debbugs.gnu.org; Wed, 22 Apr 2015 05:08:36 -0400 Received: from mail-lb0-f177.google.com ([209.85.217.177]:36438) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Ykqe1-0000WO-9V for 20402@debbugs.gnu.org; Wed, 22 Apr 2015 05:08:34 -0400 Received: by lbbqq2 with SMTP id qq2so174858982lbb.3 for <20402@debbugs.gnu.org>; Wed, 22 Apr 2015 02:08:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:content-type; bh=Gyf3kDnqWZfMOip4q0SqkgcOYeDbVphkAIS2iDA0C50=; b=qBfiXMXwgAeilO5zUNSOdlJpUqP0pdcMv5cj7xq1pA1w9rvOlCDoVtIJ/WKPTMdDth QpFPjfg5H522XoM2TmnUB6TRg9e0wUWsgJtx2O//HD9driFhB+4nfp27RJQUkkJlmi97 LTCk1Cxr1Jtcx+uWVAE5JufjmaAblddY8dMehTM7ABfyHvyXJKS+osPS/YNwfpEO6hoc 4ZXDgKcvylJZUn27GPEetaBhVzX0iqnuN3XJoPei4vk9X+U5sSKqz/UQzsscHlx3NLkv DBfJFiqVwp+S3U22vXlu/uY8Znu4PWrENFjirI3dj7SKt7vOsEnDTKNoYMxqmyfS9/wa GlWQ== MIME-Version: 1.0 X-Received: by 10.112.204.6 with SMTP id ku6mr23515469lbc.73.1429693707251; Wed, 22 Apr 2015 02:08:27 -0700 (PDT) Received: by 10.25.80.9 with HTTP; Wed, 22 Apr 2015 02:08:27 -0700 (PDT) In-Reply-To: References: Date: Wed, 22 Apr 2015 10:08:27 +0100 X-Google-Sender-Auth: 926QvTDAG_MiLobPrtm48j2WrWg Message-ID: Subject: Re: guix cannot download via an http proxy From: Joshua Randall To: 20402@debbugs.gnu.org Content-Type: multipart/alternative; boundary=001a11c3db828ef7f105144c816d X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 20402 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --001a11c3db828ef7f105144c816d Content-Type: text/plain; charset=UTF-8 After more testing this morning, I see that although the core functionality is working after applying the proposed patch (i.e. the guix daemon itself can download things), the derivations are still failing because the environment is being squashed and so the http_proxy and https_proxy environment variables are not available to the build. It looks like nix has a way around this involving setting imputeEnvVars = "http_proxy https_proxy" so that those variables get copied into the build environment (for fixed-output derivations only, which makes sense to me). I'll try to come up with a patch that inserts the imputeEnvVars, but I'm getting farther from the code I understand so I will probably need some help in getting it in the right place. Cheers, Josh. On Wed, Apr 22, 2015 at 2:15 AM, Joshua Randall wrote: > Tags: patch > > Please find a proposed patch that should fix this issue. I haven't written > scheme in many years, so please excuse me if I have failed to follow > convention in any way - I won't be offended at all if you want to refactor > it. This patch should apply cleanly on the current git master branch and > also on the v0.8.1 release. > > This patch modifies http-fetch (in build/download.scm) such that it calls > Guile's open-socket-for-uri after fixing up the uri so that it always has a > port specified. I'm not sure how to test the bootstrapping NSS issue that > required open-connection-for-uri, but my expectation based on reading the > source is that this alternative should work for Guile > 2.0.7, and I've > left the original open-connection-for-uri in there for backwards > compatibility with Guile < 2.0.7. If someone can test this against a > situation known to have needed the NSS workaround, that would be great. > > I've also changed the only other call to open-connection-for-uri, which is > in the probe-uri function in scripts/lint.scm - my suspicion is that won't > be an issue because I'm guessing the lint scripts are not used while > bootstrapping, so the open-socket-for-uri function will probably be fine > for the purpose of probing whether a URL is valid. > > After applying this patch, guix should use the http proxy support built in > to Guile >= 2.0.10. This appears to be working for me - I've just started a > bootstrap and it has now started to successfully download packages - so > far, so good. > > Please let me know if there is anything else I can do to assist with > getting this issue fixed. > > Cheers, > > Josh. > > --001a11c3db828ef7f105144c816d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
After more testing this morning, I see that although the c= ore functionality is working after applying the proposed patch (i.e. the gu= ix daemon itself can download things), the derivations are still failing be= cause the environment is being squashed and so the http_proxy and https_pro= xy environment variables are not available to the build. It looks like nix = has a way around this involving setting imputeEnvVars =3D "http_proxy = https_proxy" so that those variables get copied into the build environ= ment (for fixed-output derivations only, which makes sense to me).=C2=A0
I'll try to come up with a patch that inserts the impu= teEnvVars, but I'm getting farther from the code I understand so I will= probably need some help in getting it in the right place.=C2=A0
=
Cheers,

Josh.

<= /div>

On Wed, Apr = 22, 2015 at 2:15 AM, Joshua Randall <jcrandall@alum.mit.edu> wrote:
Tags: patch=

Please find a proposed patch that should fix this issue= . I haven't written scheme in many years, so please excuse me if I have= failed to follow convention in any way - I won't be offended at all if= you want to refactor it. This patch should apply cleanly on the current gi= t master branch and also on the v0.8.1 release.=C2=A0

Th= is patch modifies http-fetch (in build/download.scm) such that it calls Gui= le's open-socket-for-uri after fixing up the uri so that it always has = a port specified. I'm not sure how to test the bootstrapping NSS issue = that required open-connection-for-uri, but my expectation based on reading = the source is that this alternative should work for Guile > 2.0.7, and I= 've left the original open-connection-for-uri in there for backwards co= mpatibility with Guile < 2.0.7. If someone can test this against a situa= tion known to have needed the NSS workaround, that would be great.=C2=A0

I've also changed the only other call to open-co= nnection-for-uri, which is in the probe-uri function in scripts/lint.scm - = my suspicion is that won't be an issue because I'm guessing the lin= t scripts are not used while bootstrapping, so the open-socket-for-uri func= tion will probably be fine for the purpose of probing whether a URL is vali= d.=C2=A0

After applying this patch, guix should us= e the http proxy support built in to Guile >=3D 2.0.10. This appears to = be working for me - I've just started a bootstrap and it has now starte= d to successfully download packages - so far, so good.=C2=A0

=
Please let me know if there is anything else I can do to assist = with getting this issue fixed.=C2=A0

Cheers,
=

Josh.


--001a11c3db828ef7f105144c816d--