unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Brendan Tildesley <mail@brendan.scot>
To: 37654@debbugs.gnu.org
Subject: [bug#37654] [PATCH] gnu-build-system: Don't try executing directories in bootstrap phase.
Date: Tue, 8 Oct 2019 14:39:05 +1100	[thread overview]
Message-ID: <4ed4493a-5d41-9bad-d81d-6082e3b1f151@brendan.scot> (raw)

[-- Attachment #1: Type: text/plain, Size: 313 bytes --]

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.

[-- Attachment #2: 0001-gnu-build-system-Don-t-try-executing-directories-in-.patch --]
[-- Type: text/x-patch, Size: 1699 bytes --]

From 3a602cccbd8711f40f6b981e5616289a5fdd0b56 Mon Sep 17 00:00:00 2001
From: Brendan Tildesley <mail@brendan.scot>
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


             reply	other threads:[~2019-10-08  3:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-08  3:39 Brendan Tildesley [this message]
2020-01-30 12:41 ` [bug#37654] [PATCH] gnu-build-system: Don't try executing directories in bootstrap phase Marius Bakke
2020-02-16 15:47 ` bug#37654: " Marius Bakke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4ed4493a-5d41-9bad-d81d-6082e3b1f151@brendan.scot \
    --to=mail@brendan.scot \
    --cc=37654@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).