[PATCH] gnu: rocksdb: set TEST_TMPDIR for faster test i/o.

  • Done
  • quality assurance status badge
Details
2 participants
  • Ludovic Courtès
  • Ryan Sundberg
Owner
unassigned
Submitted by
Ryan Sundberg
Severity
normal

Debbugs page

Ryan Sundberg wrote 4 years ago
(address . guix-patches@gnu.org)(name . Ryan Sundberg)(address . ryan@arctype.co)
20210729050026.18416-1-ryan@arctype.co
The rocksdb test can take an egregious amount of time on a spinning HDD.
This will inherit guixbuild's /tmp mount for the rocksdb testing
directory.

* gnu/packages/databases.scm (rocksdb)[arguments]: set TEST_TMPDIR for
check phase
---
gnu/packages/databases.scm | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)

Toggle diff (35 lines)
diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm
index 5de79de955..cd19d14950 100644
--- a/gnu/packages/databases.scm
+++ b/gnu/packages/databases.scm
@@ -1395,10 +1395,19 @@ including field and record folding.")))
(("install: install-static")
"install: install-shared")
(("#!/bin/sh") (string-append "#!" (which "sh"))))
- #t))
+ #t))
(delete 'configure)
;; The default target is only needed for tests and built on demand.
(delete 'build)
+ (add-before 'check 'mount-tmp
+ ;; Use the provided workspace directory for test files.
+ ;; Otherwise, /tmp is used which is a mount namespace on /gnu/store.
+ ;; This speeds up the build when the host /tmp is a proper tmpfs or
+ ;; other fast filesystem, as opposed to /gnu which may be a HDD.
+ (lambda _
+ (let ((test-dir (string-append (getcwd) "/../test")))
+ (mkdir test-dir)
+ (setenv "TEST_TMPDIR" (canonicalize-path test-dir)))))
(add-before 'check 'disable-optimizations
(lambda _
;; Prevent the build from passing '-march=native' to the compiler.
@@ -1429,6 +1438,7 @@ including field and record folding.")))
("perl" ,perl)
("procps" ,procps)
("python" ,python-2)
+ ("util-linux" ,util-linux)
("which" ,which)))
(inputs
`(("bzip2" ,bzip2)
--
2.31.1
Ryan Sundberg wrote 4 years ago
[bug#49766] [PATCH] gnu: rocksdb: set TEST_TMPDIR for faster test i/o.
(address . 49766@debbugs.gnu.org)
20210729050822.21964-1-ryan@arctype.co
Revised patch
Ryan Sundberg wrote 4 years ago
[bug#49766] [PATCH] gnu: rocksdb: set TEST_TMPDIR for faster test i/o.
(address . 49766@debbugs.gnu.org)
20210729051307.24599-1-ryan@arctype.co
Revised patch attached.
Ryan Sundberg wrote 4 years ago
(address . 49766@debbugs.gnu.org)
d7870efd-91fb-7240-b77f-de7e3eb0b592@arctype.co
I give up with git send-email, here is the darn patch file. From
Thunderbird.
From 672a5b2f00a095dd1afc3259eca3f14439323e2b Mon Sep 17 00:00:00 2001
From: Ryan Sundberg <ryan@arctype.co>
Date: Wed, 28 Jul 2021 20:43:14 -0700
Subject: [PATCH] gnu: rocksdb: set TEST_TMPDIR for faster test i/o.

The rocksdb test can take an egregious amount of time on a spinning HDD.
This will inherit guixbuild's /tmp mount for the rocksdb testing
directory.

* gnu/packages/databases.scm (rocksdb)[arguments]: set TEST_TMPDIR for
check phase
---
gnu/packages/databases.scm | 9 +++++++++
1 file changed, 9 insertions(+)

Toggle diff (22 lines)
diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm
index 5de79de955..da93bc758e 100644
--- a/gnu/packages/databases.scm
+++ b/gnu/packages/databases.scm
@@ -1399,6 +1399,15 @@ including field and record folding.")))
(delete 'configure)
;; The default target is only needed for tests and built on demand.
(delete 'build)
+ (add-before 'check 'mount-tmp
+ ;; Use the provided workspace directory for test files.
+ ;; Otherwise, /tmp is used which is a mount namespace on /gnu/store.
+ ;; This speeds up the build when the host /tmp is a proper tmpfs or
+ ;; other fast filesystem, as opposed to /gnu which may be a HDD.
+ (lambda _
+ (let ((test-dir (string-append (getcwd) "/../test")))
+ (mkdir test-dir)
+ (setenv "TEST_TMPDIR" (canonicalize-path test-dir)))))
(add-before 'check 'disable-optimizations
(lambda _
;; Prevent the build from passing '-march=native' to the compiler.
--
2.31.1
Attachment: OpenPGP_signature
Ludovic Courtès wrote 4 years ago
Re: bug#49766: [PATCH] gnu: rocksdb: set TEST_TMPDIR for faster test i/o.
(name . Ryan Sundberg)(address . ryan@arctype.co)(address . 49766-done@debbugs.gnu.org)
87h7fxqqnm.fsf_-_@gnu.org
Hi,

Ryan Sundberg <ryan@arctype.co> skribis:

Toggle quote (3 lines)
> I give up with git send-email, here is the darn patch file. From
> Thunderbird.

:-)

Toggle quote (12 lines)
> From 672a5b2f00a095dd1afc3259eca3f14439323e2b Mon Sep 17 00:00:00 2001
> From: Ryan Sundberg <ryan@arctype.co>
> Date: Wed, 28 Jul 2021 20:43:14 -0700
> Subject: [PATCH] gnu: rocksdb: set TEST_TMPDIR for faster test i/o.
>
> The rocksdb test can take an egregious amount of time on a spinning HDD.
> This will inherit guixbuild's /tmp mount for the rocksdb testing
> directory.
>
> * gnu/packages/databases.scm (rocksdb)[arguments]: set TEST_TMPDIR for
> check phase

Applied, thanks!

Ludo’.
Closed
?
Your comment

This issue is archived.

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

To respond to this issue using the mumi CLI, first switch to it
mumi current 49766
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help