[PATCH] gnu-build-system: Don't try executing directories in bootstrap phase.

DoneSubmitted by Brendan Tildesley.
Details
2 participants
  • Brendan Tildesley
  • Marius Bakke
Owner
unassigned
Severity
normal
B
B
Brendan Tildesley wrote on 8 Oct 2019 05:39
(address . guix-patches@gnu.org)
4ed4493a-5d41-9bad-d81d-6082e3b1f151@brendan.scot
I just made this after discovering a source repo with a bootstrapdirectory. Naturally it results in just about everything being rebuilt,so it would a long time to fully test it, and I'm no experienced schemerso I can't be sure this is the right way to add in this change. Feelfree to rewrite it a better way.
From 3a602cccbd8711f40f6b981e5616289a5fdd0b56 Mon Sep 17 00:00:00 2001From: Brendan Tildesley <mail@brendan.scot>Date: Tue, 8 Oct 2019 02:55:03 +1100Subject: [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 ascript. For example if the source includes a bootstrap/ directory.--- guix/build/gnu-build-system.scm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
Toggle diff (25 lines)diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scmindex 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
M
M
Marius Bakke wrote on 30 Jan 13:41 +0100
87r1zhnmk1.fsf@devup.no
Hello Brendan, sorry for the sloooow response.
Brendan Tildesley <mail@brendan.scot> writes:
Toggle quote (6 lines)> 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.
Were you able to verify that it DTRT?
Toggle quote (10 lines)> 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.
The patch LGTM.
Will push it in a few days unless anyone protests!
-----BEGIN PGP SIGNATURE-----
iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl4yzw4ACgkQoqBt8qM6VPrxYAf8Ci5dwhyGjJmPv818dHK1fQU2szna306sGLvt2/PjRsyw7BxiiXImanzTOy0TJG+m8gQY6N1yTMtdsA7DCFLsRx9b+8Cnd5KupGBHkJYZWSFLxbzeHcnSitFyHnAelWtPJ7eJJ46zB1MLUim9dRZOECtGWiYE/MPpIcw5vx2YkXEAlVb1UJcLDxxHjDhv1Z2B0fijw0eI/mehiFiXWc8pj4k+NgjyvNILo4SeD7N0lOs8G4aQONrTEm94vgFu8KsKEiB3qAgL/ORIi61V/YgnWgrYa37hsBVkatg5CxmdHrhy3XhN3TyYmA7hA2/2koI2q/Z6KM7Bheb6gFJQkOtLcw===JAYq-----END PGP SIGNATURE-----
M
M
Marius Bakke wrote on 16 Feb 16:47 +0100
87v9o65ybk.fsf@devup.no
Brendan Tildesley <mail@brendan.scot> writes:
Toggle quote (7 lines)> 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.
Finally pushed in a21bd6d5c208111fbf96e9b402cc5ca872f95109, thanks!
I also added a copyright line for you, hope that was okay.
-----BEGIN PGP SIGNATURE-----
iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl5JY/8ACgkQoqBt8qM6VPrm9wf/feMulre4zlgOHF4yNYbRErFr3vZWrOfxjlcdr64W3Yyw1X17lExNs6GQkZhPlscJR1d24+A0BKVGSXNM/+xKjjpy1czGFEolrF3ErXeuww/6aohvMXmPg0+anW/LlaM93rTJ+1bW20il9Y8Q4BEW7SB9oopFj0C4lTRz8P6aKuxgTMjwszkZltOWiFYwaGG3PU07hxg7KKlqYhK/2b9MRUQE0WLujAxvBjYsudVh3XakdQNQxwvKX2D2poOw1RfzHL9CSujsZY2BKEDUoA5KOr+UWAs+vkzh6dMstARbRXA6kIl38GU6vq0Rhg0Ubc68Uc3AGSZvfwvwbQAIZwQP+A===xhET-----END PGP SIGNATURE-----
Closed
?
Your comment

This issue is archived.

To comment on this conversation send email to 37654@debbugs.gnu.org