Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 566186 - net-misc/unison-2.48.3 failed to build on musl
Summary: net-misc/unison-2.48.3 failed to build on musl
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: Gentoo musl team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-19 09:18 UTC by Justin Keogh
Modified: 2020-12-20 18:27 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
net-misc/unison-2.48.3 build.log (unison-2.48.3_build.log,49.03 KB, text/plain)
2015-11-19 09:18 UTC, Justin Keogh
Details
musl fix for unison-2.48.3.ebuild (unison-2.48.3.ebuild.patch,568 bytes, text/plain)
2015-11-20 08:08 UTC, Justin Keogh
Details
musl fix for unison-2.48.3.ebuild (unison-2.48.3.ebuild.patch,543 bytes, patch)
2015-11-20 08:11 UTC, Justin Keogh
Details | Diff
c stub used by Makefile.OCaml to test for <sys/inotify.h> (unison-2.48.3_inotify_test.c,106 bytes, text/plain)
2015-11-20 08:12 UTC, Justin Keogh
Details
add <sys/inotify.h> test to Makefile.OCaml (unison-2.48.3-inotify_test.patch,611 bytes, patch)
2015-11-20 08:16 UTC, Justin Keogh
Details | Diff
generalize check for <sys/inotify.h> in fsmonitor/linux/inotify_stubs.c (unison-2.48.3-inotify_stubs.patch,465 bytes, patch)
2015-11-20 08:19 UTC, Justin Keogh
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Justin Keogh 2015-11-19 09:18:56 UTC
Created attachment 417332 [details]
net-misc/unison-2.48.3 build.log

$ emerge unison -pv
[ebuild  N    ~] net-misc/unison-2.48.3  USE="ocamlopt threads -debug -doc -gtk -static {-test}" 

$ emerge unison
...
/var/tmp/portage/net-misc/unison-2.48.3/work/unison-2.48.3/fsmonitor/linux/inotify_stubs.c:41:28: fatal error: inotify_compat.h: No such file or directory
 #include "inotify_compat.h"
                            ^
compilation terminated.
Makefile.OCaml:438: recipe for target 'fsmonitor/linux/inotify_stubs.o' failed
make: *** [fsmonitor/linux/inotify_stubs.o] Error 2
 * ERROR: net-misc/unison-2.48.3::gentoo failed (compile phase):
 *   emake failed


Bug originally noted here: http://lists.seas.upenn.edu/pipermail/unison-hackers/2013-October/001676.html

inotify-nosys.h is in sys-fs/inotify-tools, so I patched:

--- a/unison-2.48.3/work/unison-2.48.3/fsmonitor/linux/inotify_stubs.c  2015-11-19 04:47:22.981619219 +0000
+++ b/unison-2.48.3/work/unison-2.48.3/fsmonitor/linux/inotify_stubs.c  2015-11-19 04:47:36.966618842 +0000
@@ -38,7 +38,7 @@
 #if GLIBC_SUPPORT_INOTIFY
 #include <sys/inotify.h>
 #else
-#include "inotify_compat.h"
+#include <inotifytools/inotify_nosys.h>
 #endif

and:
--- a/unison-2.48.3/Makefile.OCaml      2015-11-19 05:02:40.105594518 +0000
+++ b/unison-2.48.3/Makefile.OCaml      2015-11-19 05:03:21.845593394 +0000
@@ -315,7 +315,7 @@
 -include fsmonitor/windows/Makefile src/fsmonitor/windows/Makefile
 endif
 
-INCLFLAGS+=-I fsmonitor -I fsmonitor/linux -I fsmonitor/windows
+INCLFLAGS+=-I fsmonitor -I fsmonitor/linux -I fsmonitor/windows -I inotifytools
 
 ####################################################################
 ### Static build setup

but that's wrong because the error:
/var/tmp/portage/net-misc/unison-2.48.3/work/unison-2.48.3/fsmonitor/linux/inotify_stubs.c:41:40: fatal error: inotifytools/inotify_nosys.h: No such file or directory

still happens.
Comment 1 Felix Janda 2015-11-19 13:02:07 UTC
musl has <sys/inotify.h>. Can't that be used?
Comment 2 Justin Keogh 2015-11-20 08:08:02 UTC
Created attachment 417432 [details]
musl fix for unison-2.48.3.ebuild
Comment 3 Justin Keogh 2015-11-20 08:11:21 UTC
Created attachment 417434 [details, diff]
musl fix for unison-2.48.3.ebuild
Comment 4 Justin Keogh 2015-11-20 08:12:42 UTC
Created attachment 417436 [details]
c stub used by Makefile.OCaml to test for <sys/inotify.h>
Comment 5 Justin Keogh 2015-11-20 08:16:29 UTC
Created attachment 417438 [details, diff]
add <sys/inotify.h> test to Makefile.OCaml

(ht to skarnet)
Comment 6 Justin Keogh 2015-11-20 08:19:28 UTC
Created attachment 417440 [details, diff]
generalize check for <sys/inotify.h> in fsmonitor/linux/inotify_stubs.c
Comment 7 Justin Keogh 2015-11-20 08:24:35 UTC
Right, musl's <sys/inotify.h> works. I tried to make the fix as general and correct as possible, feedback appreciated. I prob don't need to set a var to run the shell commands in Makefile.OCaml, and I'm not sure if src_prepare() is proper, but it works.

I also noticed it fails with >-j10 (every time), I'll file another bug for that.
Comment 8 PetaMem R&D 2016-01-29 20:24:59 UTC
(In reply to Justin Keogh from comment #7)
> I also noticed it fails with >-j10 (every time), I'll file another bug for
> that.

Please do. I was lucky to read this comment as I had -j20 and unison never built.
MAKEOPTS="-j4" emerge unison and it works.