From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id aEG1DyIvqF+ZKgAA0tVLHw (envelope-from ) for ; Sun, 08 Nov 2020 17:47:14 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id OMZQCyIvqF8VKwAAB5/wlQ (envelope-from ) for ; Sun, 08 Nov 2020 17:47:14 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 89B329403EE for ; Sun, 8 Nov 2020 17:47:13 +0000 (UTC) Received: from localhost ([::1]:54050 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kbomW-0001dd-Dl for larch@yhetil.org; Sun, 08 Nov 2020 12:47:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57796) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kbomM-0001bO-TF for bug-guix@gnu.org; Sun, 08 Nov 2020 12:47:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:49682) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kbomM-0006QL-IZ for bug-guix@gnu.org; Sun, 08 Nov 2020 12:47:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kbomM-0003Ca-H5 for bug-guix@gnu.org; Sun, 08 Nov 2020 12:47:02 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#44491: Support GUIX_DISABLE_NETWORK_TESTS environment variable Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sun, 08 Nov 2020 17:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44491 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Vagrant Cascadian Received: via spool by 44491-submit@debbugs.gnu.org id=B44491.160485757712243 (code B ref 44491); Sun, 08 Nov 2020 17:47:02 +0000 Received: (at 44491) by debbugs.gnu.org; 8 Nov 2020 17:46:17 +0000 Received: from localhost ([127.0.0.1]:32993 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kbold-0003BN-E6 for submit@debbugs.gnu.org; Sun, 08 Nov 2020 12:46:17 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57518) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kbola-0003Aq-EM for 44491@debbugs.gnu.org; Sun, 08 Nov 2020 12:46:15 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:54007) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kbolU-0006I6-Eb; Sun, 08 Nov 2020 12:46:08 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=56510 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kbolT-00032h-VB; Sun, 08 Nov 2020 12:46:08 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <87k0uy6um8.fsf@yucca> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 18 Brumaire an 229 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Sun, 08 Nov 2020 18:46:06 +0100 In-Reply-To: <87k0uy6um8.fsf@yucca> (Vagrant Cascadian's message of "Fri, 06 Nov 2020 13:30:39 -0800") Message-ID: <87y2jbu4gx.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -3.3 (---) X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 44491@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Scanner: ns3122888.ip-94-23-21.eu Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Spam-Score: -1.51 X-TUID: pQx7JdOAuqda Hi Vagrant, Vagrant Cascadian skribis: > If this could be considered for the upcoming 1.2 release, that would be > appreciated, though I can also carry the patches in Debian... Yay! It should be doable, let=E2=80=99s see. > From 36516e767f68dbc2bd3dc186f956c0b0fd7de9f1 Mon Sep 17 00:00:00 2001 > From: Vagrant Cascadian > Date: Thu, 5 Nov 2020 17:35:52 -0800 > Subject: [PATCH] tests: Support disabling network tests. > > This is needed for packaging GNU Guix in Debian, where packaging policies > prohibit network access during builds, but may not technically block netw= ork > access during builds. > > * guix/tests.scm (network-reachable): Return #f when > GUIX_DISABLE_NETWORK_TESTS is set. > * tests/common.sh: New file. > * tests/guix-build-branch.sh, tests/guix-environment.sh, > tests/guix-pack.sh, tests/guix-package-net.sh: Use > network_reachable function from common.sh. [...] > --- /dev/null > +++ b/tests/common.sh > @@ -0,0 +1,8 @@ > +network_reachable() { > + if [ -n "$GUIX_DISABLE_NETWORK_TESTS" ]; then > + exit 77 > + fi > + if ! guile -c '(getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV)' 2> /= dev/null; then > + exit 77 > + fi > +} Could you add the usual copyright/license header? Also please add this file to =E2=80=98EXTRA_DIST=E2=80=99 in Makefile.am. Looking at the tests you modified, we need two things: =E2=80=A2 a =E2=80=98network_reachable=E2=80=99 function that returns tru= e or false, without exiting; =E2=80=A2 a =E2=80=98skip_if_network_is_unreachable=E2=80=99 function tha= t does =E2=80=9Cexit 77=E2=80=9D when network is =E2=80=9Cunreachable=E2=80=9D. > --- a/tests/guix-environment.sh > +++ b/tests/guix-environment.sh > @@ -174,9 +174,9 @@ case "$transformed_drv" in > *) false;; > esac >=20=20 > +. $(dirname $0)/common.sh > +network_reachable >=20=20 > -if guile -c '(getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV)' 2> /dev/nu= ll > -then > # Compute the build environment for the initial GNU Make. > guix environment --bootstrap --no-substitutes --search-paths --pure \ I think this is the only place where you=E2=80=99d write =E2=80=9Cif networ= k_reachable=E2=80=9D instead of =E2=80=9Cskip_if_network_is_unreachable=E2=80=9D. WDYT? Thanks! Ludo=E2=80=99.