-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compatibility with Alpine Linux #268
Comments
Doesn't the musl-gcc wrapper provide the necessary magic to link to the platform specific 'C' Library on Alpine Linux ? |
I think you're right, the musl-gcc wrapper provide some magic to link glic functions, but all the functions must be POSIX compliant. I read that glusterfs use not POSIX functions : https://bugs.alpinelinux.org/issues/2834 . |
Portablexdr doesn't seem to work with glusterfs (usually
Both 3.10.7 and master produce the same error. |
+1 |
1 similar comment
+1 |
rpcgen is in its own separate package. At least in alpine 3.9.2. (Similar to Fedora28+ and RHEL8 where rpcgen has been removed from glibc. I expect other distributions will do the same eventually.) I didn't look in any older versions.
But there are other issues with this rpcgen that alpine ships. It's not the same as the unbundled rpcgen in Fedora and doesn't like the "hyper" data type in, e.g., glusterfs4-xdr.x
Alpine should probably use the rpcgen that's in Fedora from https://github.com/thkukuk/rpcsvc-proto.git, which supports the "hyper" data type (i.e. quad_t). Without support for hyper, nobody is going to get very far building glusterfs. Someone with a vested interest in Alpine should get them to update to a modern/current rpcgen. In the mean time anyone wanting to build gluster will absolutely have to build their own rpcgen from source. |
Thank you for your contributions. |
Please keep this open to track it somewhere. |
Thanks for reply; removing tag. |
Thank you for your contributions. |
bump |
Two things here. I tried to get this done last year, and the changes in xdr lib was little too much, and there were discussions about newer network layer, and I left it off at that. Considering we from kadalu.io would like to have a smaller footprint of glusterfs in container image, I will see if we can get this picked up. If anyone wants to volunteers, (with protobuf experience), happy to coordinate. |
Gave this a try... stuck with below error, and not sure how to go about that:
@xhernandez According to this link below is mentioned:
Looks like its not supported in musl-dev at all, and hence glusterfs is not able to link fine. To get to this, I needed to do few changes in code, including not building gfapi (more errors seen). I will update later about all dependencies and changes done. The rpcgen issues etc are gone now, and libtirpc-dev also is available. So all good there. |
Fixes: gluster#268 Change-Id: I1468de97cc38479d09a16ea41eb2aa346e4457cf Signed-off-by: Amar Tumballi <[email protected]>
Fixes: gluster#268 Change-Id: I1468de97cc38479d09a16ea41eb2aa346e4457cf Signed-off-by: Amar Tumballi <[email protected]>
With below dockerfile
and |
Fixes: gluster#268 Change-Id: I1468de97cc38479d09a16ea41eb2aa346e4457cf Signed-off-by: Amar Tumballi <[email protected]>
Without support for Another way is to implement those functions ourselves, but it's not trivial because we would need to do it at very low level (probably assembly) and we'll need to do it for each machine type we want to be able to run Gluster. Probably this is not the right approach. |
Ack, I agree. Currently a lot of logic depends on I will keep the issue open, and keep the branch alive, so anyone interested can pick it up and take it forward. For now, focusing on few other things. |
Fixes: gluster#268 Change-Id: I1468de97cc38479d09a16ea41eb2aa346e4457cf Signed-off-by: Amar Tumballi <[email protected]>
Thank you for your contributions. |
bump |
The problem wit make/swap/getcontext and a similar with argp_parse functions etc. can be solved by the following commands:
Though there are some more issues, when compiling on alpine, I tested this with the release-10 branch |
Ok i could now compile glusterfs with musl-libc on alpine 3.15 and gcc 10.3. At least i added Next step is to test on my little cluster, if the setup of a filesystem works also. |
So here are all changes: --- ../glusterfs-release-10/contrib/fuse-lib/mount-common.c
+++ contrib/fuse-lib/mount-common.c
@@ -8,7 +8,12 @@
*/
#include "mount-gluster-compat.h"
+#ifndef _PATH_MOUNTED
+#define _PATH_MOUNTED "/etc/mtab"
+#endif
+#include <string.h>
--- ../glusterfs-release-10/api/src/glfs.h
+++ api/src/glfs.h
@@ -67,6 +67,7 @@
* is false and __USE_FILE_OFFSET64 is true, then go on to define
* off64_t using __off64_t.
*/
+#define __off64_t_defined
#ifndef GF_BSD_HOST_OS
#if defined(__USE_FILE_OFFSET64) && !defined(__off64_t_defined)
typedef __off64_t off64_t;
--- ../glusterfs-release-10/contrib/fuse-util/fusermount.c
+++ contrib/fuse-util/fusermount.c
@@ -6,6 +6,9 @@
See the file COPYING.
*/
/* This program does the mounting and unmounting of FUSE filesystems */
+#ifndef _PATH_MOUNTED
+#define _PATH_MOUNTED "/etc/mtab"
+#endif
#include <config.h>
--- ../glusterfs-release-10/libglusterfs/src/glusterfs/dict.h
+++ libglusterfs/src/glusterfs/dict.h
@@ -320,6 +320,7 @@
dict_set_uint64(dict_t *this, char *key, uint64_t val);
/* POSIX-compliant systems requires the 'time_t' to be a signed integer. */
+#define __WORDSIZE 64
#if __WORDSIZE == 64
#define dict_get_time(dict, key, val) dict_get_int64((dict), (key), (val))
#define dict_set_time(dict, key, val) dict_set_int64((dict), (key), (val))
--- ../glusterfs-release-10/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -7,6 +7,9 @@
later), or the GNU General Public License, version 2 (GPLv2), in all
cases as published by the Free Software Foundation.
*/
+#ifndef _PATH_MOUNTED
+#define _PATH_MOUNTED "/etc/mtab"
+#endif
#include <inttypes.h>
#if defined(GF_LINUX_HOST_OS) Maybe some of them make no sense, i just added them so that it can compile and to show where the problems are, Hint: The target-triplet of the gcc was Update:
so in api/src/glfs.h maybe that could be checked too?
Update2:
|
rpic4:~# uname -a
Linux rpic4 5.15.4-0-rpi4 #1-Alpine SMP PREEMPT Mon Nov 22 10:43:31 UTC 2021 aarch64 GNU/Linux
rpic4:~# gluster peer status
Number of Peers: 3
Hostname: rpic2
Uuid: 2d5904f3-3dfe-47a8-b293-b373349721de
State: Peer in Cluster (Connected)
Hostname: rpic1
Uuid: 5e3b90cf-7fb0-4340-b09f-ebee503f0e95
State: Peer in Cluster (Connected)
Hostname: rpic3
Uuid: d2c27958-88de-4447-bc87-ba1eeaa88b4c
State: Peer in Cluster (Connected)
rpic4:~# gluster volume info
Volume Name: gluster1
Type: Replicate
Volume ID: 1e98d5ff-f28a-47b3-8ad0-64c2633055da
Status: Started
Snapshot Count: 0
Number of Bricks: 1 x 4 = 4
Transport-type: tcp
Bricks:
Brick1: rpic1:/cluster/gluster1/brick1/volume
Brick2: rpic2:/cluster/gluster1/brick2/volume
Brick3: rpic3:/cluster/gluster1/brick3/volume
Brick4: rpic4:/cluster/gluster1/brick4/volume
Options Reconfigured:
cluster.granular-entry-heal: on
storage.fips-mode-rchecksum: on
transport.address-family: inet
nfs.disable: on
performance.client-io-threads: off
rpic4:~# gcc -dumpmachine
aarch64-alpine-linux-musl |
Thank you for your contributions. |
bump |
Thank you for your contributions. |
😞 |
Any info about this? |
@amarts We are doing a triage of the bugs that we are going to fix. Do you have bandwidth to work on this? Otherwise we can go ahead and close it. If you have partial solution somewhere, please publish it, so that we can refer to this in the future if we want to pick it up. |
No bandwidth. Will close. |
Prerequisites: sudo apk add alpine-sdk autoconf automake libtool rpcgen tcmalloc \ tcmalloc-minimal flex bison openssl-dev util-linux-dev acl-dev \ zlib-dev libxml2-dev argp-standalone liburing-dev linux-headers \ userspace-rcu-dev libucontext-dev sudo ln -s /usr/lib/libtcmalloc.so.4 \ /usr/lib/libtcmalloc.so sudo ln -s /usr/lib/libtcmalloc_minimal.so.4 \ /usr/lib/libtcmalloc_minimal.so Fixes: gluster#268
Prerequisites: sudo apk add alpine-sdk autoconf automake libtool rpcgen flex bison \ gperftools-dev tcmalloc-minimal openssl-dev util-linux-dev acl-dev \ zlib-dev libxml2-dev argp-standalone liburing-dev linux-headers \ userspace-rcu-dev libucontext-dev Fixes: gluster#268
Prerequisites: sudo apk add alpine-sdk autoconf automake libtool rpcgen flex bison \ gperftools-dev tcmalloc-minimal openssl-dev util-linux-dev acl-dev \ zlib-dev libxml2-dev argp-standalone liburing-dev linux-headers \ userspace-rcu-dev libucontext-dev Fixes: gluster#268
Prerequisites: sudo apk add alpine-sdk autoconf automake libtool rpcgen flex bison \ gperftools-dev tcmalloc-minimal openssl-dev util-linux-dev acl-dev \ zlib-dev libxml2-dev argp-standalone liburing-dev linux-headers \ userspace-rcu-dev libucontext-dev libtirpc-dev Fixes: gluster#268
I see that @kohlschuetter is working on this issue and sent PR for the same. Re-opening the issue. |
Hi,
Alpine Linux use the musl library instead of the glibc.
Is it possible to make a musl compatible version of glusterfs ?
It would be awesome to have glusterfs in alpine linux.
The text was updated successfully, but these errors were encountered: