diff mbox series

[bug#41501] Add mergerfs/mergerfs-tools

Message ID 20200530171259.GB186839@noor.fritz.box
State Accepted
Headers show
Series [bug#41501] Add mergerfs/mergerfs-tools | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch fail View Laminar job

Commit Message

Lars-Dominik Braun May 31, 2020, 6:25 a.m. UTC
Hi,

> > (file-system
> >  (device "/storage/disk*")
> >  (mount-point "/storage/pool")
> >  (type "mergerfs")
> >  (flags '('allow_other, 'use_ino, "moveonenospc=true", "category.create=mfs"))
> >  (check? #f))
> Oh, fun.  I suppose we'll have to add support for mergerfs in the system
> configuration to deal with it.
maybe a generic

	(device (literal "/storage/disk*"))

would do? I’m sure there are more FUSE filesystems out there which
trigger these checks. And I don’t think adding an exception like the one
for NFS is a good solution long-term.

> Can you send updated patches?  TIA!
All done, see attachment. I hope I did not miss anything.

Cheers,
Lars

Comments

Ludovic Courtès June 3, 2020, 4:04 p.m. UTC | #1
Hi,

Lars-Dominik Braun <lars@6xq.net> skribis:

>>From 7aa69a86f8933c3d833ae3beb53840ded9115978 Mon Sep 17 00:00:00 2001
> From: Lars-Dominik Braun <lars@6xq.net>
> Date: Sat, 30 May 2020 19:10:55 +0200
> Subject: [PATCH 2/2] gnu: Add mergerfs-tools.
>
> * gnu/packages/storage.scm (mergerfs-tools): New variable.

[...]

>>From 4b2500e04f956df0c038ba4b71d91f01b2919d1e Mon Sep 17 00:00:00 2001
> From: Lars-Dominik Braun <lars@6xq.net>
> Date: Sat, 30 May 2020 19:10:30 +0200
> Subject: [PATCH 1/2] gnu: Add mergerfs.
>
> * gnu/packages/storage.scm (mergerfs): New variable.

I think it addresses the issues Marius wrote about, so I went ahead and
applied them.

> +             ;; These were copied from the package libfuse.

[...]

> +    ;; mergerfs bundles a heavily modified copy of libfuse.

This is not great.  Did you try building against vanilla libfuse?

Anyway, thank you!

Ludo’.
Lars-Dominik Braun June 3, 2020, 5:13 p.m. UTC | #2
Hi Ludo,

> > +    ;; mergerfs bundles a heavily modified copy of libfuse.
> This is not great.  Did you try building against vanilla libfuse?
no, I looked at the git changelog of their libfuse tree and it appeared
to contain substantial changes, otherwise I would’ve unvendored it.
Judging by the documentation[1] the upstream libfuse is not supported.

Lars

[1] https://github.com/trapexit/mergerfs#why-was-libfuse-embedded-into-mergerfs
Ludovic Courtès June 4, 2020, 9:57 a.m. UTC | #3
Hi,

Lars-Dominik Braun <lars@6xq.net> skribis:

>> > +    ;; mergerfs bundles a heavily modified copy of libfuse.
>> This is not great.  Did you try building against vanilla libfuse?
> no, I looked at the git changelog of their libfuse tree and it appeared
> to contain substantial changes, otherwise I would’ve unvendored it.
> Judging by the documentation[1] the upstream libfuse is not supported.

I see.

> [1] https://github.com/trapexit/mergerfs#why-was-libfuse-embedded-into-mergerfs

I don’t buy their arguments :-), but from the Guix viewpoint, we’ve done
our best.

Thanks for explaining!

Ludo’.
diff mbox series

Patch

From 4b2500e04f956df0c038ba4b71d91f01b2919d1e Mon Sep 17 00:00:00 2001
From: Lars-Dominik Braun <lars@6xq.net>
Date: Sat, 30 May 2020 19:10:30 +0200
Subject: [PATCH 1/2] gnu: Add mergerfs.

* gnu/packages/storage.scm (mergerfs): New variable.
---
 gnu/packages/file-systems.scm | 47 +++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)

diff --git a/gnu/packages/file-systems.scm b/gnu/packages/file-systems.scm
index 293322c76b..6d605c4922 100644
--- a/gnu/packages/file-systems.scm
+++ b/gnu/packages/file-systems.scm
@@ -646,3 +646,50 @@  APFS.")
 originally developed for Solaris and is now maintained by the OpenZFS
 community.")
     (license license:cddl1.0)))
+
+(define-public mergerfs
+  (package
+    (name "mergerfs")
+    (version "2.29.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://github.com/trapexit/mergerfs/releases/download/"
+                           version "/mergerfs-" version ".tar.gz"))
+       (sha256
+        (base32
+         "17gizw4vgbqqjd2ykkfpp276942jb5qclp0lkiwkmq1yjgyjqfmk"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f                      ; No tests exist.
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'configure)
+         (add-after 'unpack 'fix-paths
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (setenv "CC" "gcc")
+             ;; These were copied from the package libfuse.
+             (substitute* '("libfuse/lib/mount_util.c" "libfuse/util/mount_util.c")
+               (("/bin/(u?)mount" _ maybe-u)
+                (string-append (assoc-ref inputs "util-linux")
+                               "/bin/" maybe-u "mount")))
+             (substitute* '("libfuse/util/mount.mergerfs.c")
+               (("/bin/sh")
+                (which "sh")))
+             ;; The Makefile does not allow overriding PREFIX via make variables.
+             (substitute* '("Makefile" "libfuse/Makefile")
+               (("= /usr/local") (string-append "= " (assoc-ref outputs "out")))
+               ;; cannot chown as build user
+               (("chown root:root") "true"))
+             #t)))))
+    ;; mergerfs bundles a heavily modified copy of libfuse.
+    (inputs `(("util-linux" ,util-linux)))
+    (home-page "https://github.com/trapexit/mergerfs")
+    (synopsis "Featureful union filesystem")
+    (description "mergerfs is a union filesystem geared towards simplifying
+storage and management of files across numerous commodity storage devices.  It
+is similar to mhddfs, unionfs, and aufs.")
+    (license (list
+              license:isc                   ; mergerfs
+              license:gpl2 license:lgpl2.0  ; Imported libfuse code.
+              ))))
-- 
2.26.2