summary refs log tree commit diff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2015-08-29 21:55:12 -0400
committerDavid Thompson <dthompson2@worcester.edu>2015-09-07 08:27:10 -0400
commitb500e7182d3278cbbe3ba3cb5c83ba985554aff7 (patch)
tree6a92fefca5a2283392db50430e3db5c539a0ce8e
parent8957241dd461acb17068411eb9542ff8267e7cfc (diff)
downloadguix-b500e7182d3278cbbe3ba3cb5c83ba985554aff7.tar.gz
build: ruby: Avoid long build directory names.
Having the hash of the source gem in the source directory file name proved to
be problematic when running the test suite for the 'pg' gem that creates
UNIX-domain sockets in the source directory and exceeded the 108 character
limit on GNU/Linux systems.

* guix/build/ruby-build-system.scm (unpack): Rename unpacked gem directory to
  "gem".
-rw-r--r--guix/build/ruby-build-system.scm16
1 files changed, 10 insertions, 6 deletions
diff --git a/guix/build/ruby-build-system.scm b/guix/build/ruby-build-system.scm
index 90fab92f6a..4184ccc9ac 100644
--- a/guix/build/ruby-build-system.scm
+++ b/guix/build/ruby-build-system.scm
@@ -44,12 +44,16 @@ directory."
 (define* (unpack #:key source #:allow-other-keys)
   "Unpack the gem SOURCE and enter the resulting directory."
   (and (zero? (system* "gem" "unpack" source))
-       (begin
-         ;; The unpacked gem directory is named the same as the archive, sans
-         ;; the ".gem" extension.
-         (chdir (match:substring (string-match "^(.*)\\.gem$"
-                                               (basename source))
-                                 1))
+       ;; The unpacked gem directory is named the same as the archive, sans
+       ;; the ".gem" extension.  It is renamed to simply "gem" in an effort to
+       ;; keep file names shorter to avoid UNIX-domain socket file names and
+       ;; shebangs that exceed the system's fixed maximum length when running
+       ;; test suites.
+       (let ((dir (match:substring (string-match "^(.*)\\.gem$"
+                                                 (basename source))
+                                   1)))
+         (rename-file dir "gem")
+         (chdir "gem")
          #t)))
 
 (define* (build #:key source #:allow-other-keys)