From patchwork Tue Oct 8 03:39:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brendan Tildesley X-Patchwork-Id: 15668 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 0845B17535; Tue, 8 Oct 2019 04:40:11 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id C2D4617530 for ; Tue, 8 Oct 2019 04:40:10 +0100 (BST) Received: from localhost ([::1]:51012 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iHgM6-0003xn-8f for patchwork@mira.cbaines.net; Mon, 07 Oct 2019 23:40:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57336) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iHgLz-0003xg-DU for guix-patches@gnu.org; Mon, 07 Oct 2019 23:40:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iHgLy-0000cr-Bl for guix-patches@gnu.org; Mon, 07 Oct 2019 23:40:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:40507) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iHgLy-0000cl-8Q for guix-patches@gnu.org; Mon, 07 Oct 2019 23:40:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iHgLy-0002cB-3m for guix-patches@gnu.org; Mon, 07 Oct 2019 23:40:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#37654] [PATCH] gnu-build-system: Don't try executing directories in bootstrap phase. Resent-From: Brendan Tildesley Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 08 Oct 2019 03:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 37654 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 37654@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.15705059669993 (code B ref -1); Tue, 08 Oct 2019 03:40:01 +0000 Received: (at submit) by debbugs.gnu.org; 8 Oct 2019 03:39:26 +0000 Received: from localhost ([127.0.0.1]:49328 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iHgLN-0002b6-JZ for submit@debbugs.gnu.org; Mon, 07 Oct 2019 23:39:25 -0400 Received: from lists.gnu.org ([209.51.188.17]:38842) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iHgLL-0002ax-8T for submit@debbugs.gnu.org; Mon, 07 Oct 2019 23:39:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57249) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iHgLJ-0003ug-TL for guix-patches@gnu.org; Mon, 07 Oct 2019 23:39:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iHgLI-0000Ox-5s for guix-patches@gnu.org; Mon, 07 Oct 2019 23:39:21 -0400 Received: from mx2.mailbox.org ([80.241.60.215]:63778) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iHgLH-0000Ly-KU for guix-patches@gnu.org; Mon, 07 Oct 2019 23:39:20 -0400 Received: from smtp2.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mx2.mailbox.org (Postfix) with ESMTPS id 7BE45A25EC for ; Tue, 8 Oct 2019 05:39:14 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brendan.scot; s=MBO0001; t=1570505952; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=egPKbU9ae9YutN8PVxXptovExje4g7R7qtgWz47ql9U=; b=tGY/SnHwUWj+rSQGwgJ9G50aI12r/PbwiC4y2p5ZM3qoGKICkIvYjQg/jCN9sQpLTJl0IH t1P7DXV8juyUYCb0tTsKLR6s9iItM5b6a7dVQpC/89LwHrdbrpYOahQXgX4m85pr11YIm5 nanPYMn4eU3/vns2l1EDv2YtMddi+leou7ts/WwkyarjUZ5eWC9ZQndhCgpLGmK6CqV01d UMy/bDkiqtw2lHUAI7Sr+K5riao9XBs6ZLjjf+3QdQbpxKVahSC3o/ZVHvCu2LIzz5hCn3 ZB403ZVfOGgVCfXJchRhDUcvtcOV8FW5FrOS8HTlyIDtmTSuD1aQJ5SOTqIN5w== Received: from smtp2.mailbox.org ([80.241.60.240]) by spamfilter01.heinlein-hosting.de (spamfilter01.heinlein-hosting.de [80.241.56.115]) (amavisd-new, port 10030) with ESMTP id CzBxTXI7LX75 for ; Tue, 8 Oct 2019 05:39:11 +0200 (CEST) From: Brendan Tildesley Message-ID: <4ed4493a-5d41-9bad-d81d-6082e3b1f151@brendan.scot> Date: Tue, 8 Oct 2019 14:39:05 +1100 MIME-Version: 1.0 Content-Language: en-AU X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches I just made this after discovering a source repo with a bootstrap directory. Naturally it results in just about everything being rebuilt, so it would a long time to fully test it, and I'm no experienced schemer so I can't be sure this is the right way to add in this change. Feel free to rewrite it a better way. From 3a602cccbd8711f40f6b981e5616289a5fdd0b56 Mon Sep 17 00:00:00 2001 From: Brendan Tildesley Date: Tue, 8 Oct 2019 02:55:03 +1100 Subject: [PATCH] gnu-build-system: Don't try executing directories in bootstrap phase. * guix/build/gnu-build-system.scm: (bootstrap): Change the file-exists? procedure to one that excludes directories, so that we do not mistake it for a script. For example if the source includes a bootstrap/ directory. --- guix/build/gnu-build-system.scm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm index e5f3197b0a..6b4e74721b 100644 --- a/guix/build/gnu-build-system.scm +++ b/guix/build/gnu-build-system.scm @@ -177,12 +177,16 @@ working directory." \"autoreconf\". Otherwise do nothing." ;; Note: Run that right after 'unpack' so that the generated files are ;; visible when the 'patch-source-shebangs' phase runs. - (if (not (file-exists? "configure")) + (define (script-exists? file) + (and (file-exists? file) + (not (file-is-directory? file)))) + + (if (not (script-exists? "configure")) ;; First try one of the BOOTSTRAP-SCRIPTS. If none exists, and it's ;; clearly an Autoconf-based project, run 'autoreconf'. Otherwise, do ;; nothing (perhaps the user removed or overrode the 'configure' phase.) - (let ((script (find file-exists? bootstrap-scripts))) + (let ((script (find script-exists? bootstrap-scripts))) ;; GNU packages often invoke the 'git-version-gen' script from ;; 'configure.ac' so make sure it has a valid shebang. (false-if-file-not-found -- 2.23.0