Skip to content
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

build script doesn't work MacOS Sonoma 14.4 #143

Open
Blu-Dread opened this issue Mar 19, 2024 · 21 comments
Open

build script doesn't work MacOS Sonoma 14.4 #143

Blu-Dread opened this issue Mar 19, 2024 · 21 comments

Comments

@Blu-Dread
Copy link

gcc -DHAVE_CONFIG_H -I. -I.. -Wall -DHAVE_CONFIG_H -I/usr/local/include -D__FreeBSD__=10 -idirafter/opt/gnu/include -idirafter/usr/local/include/fuse/ -MT fuse_ext2-fuse-ext2.o -MD -MP -MF .deps/fuse_ext2-fuse-ext2.Tpo -c -o fuse_ext2-fuse-ext2.o test -f 'fuse-ext2.c' || echo './'fuse-ext2.c
fuse-ext2.c:301:20: error: incompatible function pointer types initializing 'int (*)(const char *, const char *, char , size_t, uint32_t)' (aka 'int ()(const char *, const char *, char *, unsigned long, unsigned int)') with an expression of type 'int (const char *, const char *, char *, size_t)' (aka 'int (const char *, const char *, char , unsigned long)') [-Wincompatible-function-pointer-types]
.getxattr = op_getxattr,
^~~~~~~~~~~
1 error generated.
make[2]: *** [fuse_ext2-fuse-ext2.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Making install in fuse-ext2
gcc -DHAVE_CONFIG_H -I. -I.. -Wall -DHAVE_CONFIG_H -I/usr/local/include -D__FreeBSD__=10 -idirafter/opt/gnu/include -idirafter/usr/local/include/fuse/ -MT fuse_ext2-fuse-ext2.o -MD -MP -MF .deps/fuse_ext2-fuse-ext2.Tpo -c -o fuse_ext2-fuse-ext2.o test -f 'fuse-ext2.c' || echo './'fuse-ext2.c
fuse-ext2.c:301:20: error: incompatible function pointer types initializing 'int (
)(const char *, const char *, char , size_t, uint32_t)' (aka 'int ()(const char *, const char *, char *, unsigned long, unsigned int)') with an expression of type 'int (const char *, const char *, char *, size_t)' (aka 'int (const char *, const char *, char *, unsigned long)') [-Wincompatible-function-pointer-types]
.getxattr = op_getxattr,
^~~~~~~~~~~
1 error generated.
make[1]: *** [fuse_ext2-fuse-ext2.o] Error 1
make: *** [install-recursive] Error 1

@aiopsUser1012
Copy link

Same problem, and can not find a proper solution....

@Blu-Dread
Copy link
Author

me also I don't know why it happens that's why I added a ticket

@heng-yuwen
Copy link

Same here...

@DexterSLamb
Copy link

Same issue

@Pengchengistaken
Copy link

mark

@aidatorajiro
Copy link

aidatorajiro commented Apr 24, 2024

Adding -Wno-error=incompatible-function-pointer-types to CFLAGS should solve the issue. It seems that -Wno-error=incompatible-function-pointer-types is also required to build e2fsprogs.
Also, you should rename or delete include/uuid/uuid.h in the e2fsprogs package, because it causes a conflict with XCode.

EDIT:
Obviously, the method above is not a good idea. For more proper fix, you can add missing arguments to op_getxattr like this:

getxattr-macos-fix.patch

diff --git a/fuse-ext2/fuse-ext2.h b/fuse-ext2/fuse-ext2.h
index 07fd1db..09399ed 100644
--- a/fuse-ext2/fuse-ext2.h
+++ b/fuse-ext2/fuse-ext2.h
@@ -178,7 +178,7 @@ int op_fgetattr (const char *path, struct stat *stbuf, struct fuse_file_info *fi
 
 int op_getattr (const char *path, struct stat *stbuf);
 
-int op_getxattr(const char *path, const char *name, char *value, size_t size);
+int op_getxattr(const char *path, const char *name, char *value, size_t size, uint32_t position);
 
 ext2_file_t do_open (ext2_filsys e2fs, const char *path, int flags);
 
diff --git a/fuse-ext2/op_getxattr.c b/fuse-ext2/op_getxattr.c
index 27f95c3..1c7f783 100644
--- a/fuse-ext2/op_getxattr.c
+++ b/fuse-ext2/op_getxattr.c
@@ -15,7 +15,7 @@
 static int do_getxattr(ext2_filsys e2fs, struct ext2_inode *node, const char *name,
 		char *value, size_t size);
 
-int op_getxattr(const char *path, const char *name, char *value, size_t size) {
+int op_getxattr(const char *path, const char *name, char *value, size_t size, uint32_t position) {
 	int rt;
 	ext2_ino_t ino;
 	struct ext2_inode inode;

@DexterSLamb
Copy link

Adding -Wno-error=incompatible-function-pointer-types to CFLAGS should solve the issue. It seems that -Wno-error=incompatible-function-pointer-types is also required to build e2fsprogs. Also, you should rename or delete include/uuid/uuid.h in the e2fsprogs package, because it causes a conflict with XCode.

EDIT: Obviously, the method above is not a good idea. For more proper fix, you can add missing arguments to op_getxattr like this:

getxattr-macos-fix.patch

diff --git a/fuse-ext2/fuse-ext2.h b/fuse-ext2/fuse-ext2.h
index 07fd1db..09399ed 100644
--- a/fuse-ext2/fuse-ext2.h
+++ b/fuse-ext2/fuse-ext2.h
@@ -178,7 +178,7 @@ int op_fgetattr (const char *path, struct stat *stbuf, struct fuse_file_info *fi
 
 int op_getattr (const char *path, struct stat *stbuf);
 
-int op_getxattr(const char *path, const char *name, char *value, size_t size);
+int op_getxattr(const char *path, const char *name, char *value, size_t size, uint32_t position);
 
 ext2_file_t do_open (ext2_filsys e2fs, const char *path, int flags);
 
diff --git a/fuse-ext2/op_getxattr.c b/fuse-ext2/op_getxattr.c
index 27f95c3..1c7f783 100644
--- a/fuse-ext2/op_getxattr.c
+++ b/fuse-ext2/op_getxattr.c
@@ -15,7 +15,7 @@
 static int do_getxattr(ext2_filsys e2fs, struct ext2_inode *node, const char *name,
 		char *value, size_t size);
 
-int op_getxattr(const char *path, const char *name, char *value, size_t size) {
+int op_getxattr(const char *path, const char *name, char *value, size_t size, uint32_t position) {
 	int rt;
 	ext2_ino_t ino;
 	struct ext2_inode inode;

Thanks for your solution.
If I apply this patch, do I need to rename or delete include/uuid/uuid.h?
Thanks.

@Blu-Dread
Copy link
Author

Blu-Dread commented Apr 25, 2024

i am not a programmer how can I apply the patch in the script or on the command line ?

this is the script I use how can I implement the patch just rename to sh

test_script.txt

@DexterSLamb
Copy link

i am not a programmer how can I apply the patch in the script or on the command line ?

patch fuse-ext2/fuse-ext2.h getxattr-macos-fix.patch

@aidatorajiro
Copy link

@DexterSLamb
Yes, you should remove it from the installation folder.
So for example if you installed it on /opt/gnu, mv /opt/gnu/include/uuid/uuid.h /opt/gnu/include/uuid/uuid.h.bak
If you installed e2fsprogs through homebrew, mv /usr/local/opt/e2fsprogs/include/uuid/uuid.h /usr/local/opt/e2fsprogs/include/uuid/uuid.h.bak

@DexterSLamb
Copy link

@DexterSLamb Yes, you should remove it from the installation folder. So for example if you installed it on /opt/gnu, mv /opt/gnu/include/uuid/uuid.h /opt/gnu/include/uuid/uuid.h.bak If you installed e2fsprogs through homebrew, mv /usr/local/opt/e2fsprogs/include/uuid/uuid.h /usr/local/opt/e2fsprogs/include/uuid/uuid.h.bak

got it thanks.

@smellord
Copy link

I still get the same error after applying the patch.. I am kinda lost at this point

@Blu-Dread
Copy link
Author

Blu-Dread commented May 15, 2024

I needed an other script. because e2fslibs could not be found and isn't installable

test2 kopie.txt

@smellord
Copy link

to find e2fslibs you need to adjust PATHS:

nano ~/.zshrc

export PATH="/opt/homebrew/opt/e2fsprogs/bin:$PATH"
export PATH="/opt/homebrew/opt/e2fsprogs/sbin:$PATH"
export PKG_CONFIG_PATH="/opt/homebrew/opt/e2fsprogs/lib/pkgconfig:$PKG_CONFIG_PATH"
export CFLAGS="-idirafter/opt/gnu/include -idirafter/usr/local/include/osxfuse/ -idirafter/$(brew --prefix e2fsprogs)/include"
export LDFLAGS="-L/usr/local/opt/glib -L/usr/local/lib -L$(brew --prefix e2fsprogs)/lib"

source ~/.zshrc

@smellord
Copy link

this is my error:

/Library/Developer/CommandLineTools/usr/bin/make all-recursive
Making all in fuse-ext2
gcc -DHAVE_CONFIG_H -I. -I.. -Wall -DHAVE_CONFIG_H -I/usr/local/include -D__FreeBSD__=10 -idirafter/opt/gnu/include -idirafter/usr/local/include/osxfuse/ -idirafter//opt/homebrew/opt/e2fsprogs/include -MT fuse_ext2-fuse-ext2.o -MD -MP -MF .deps/fuse_ext2-fuse-ext2.Tpo -c -o fuse_ext2-fuse-ext2.o test -f 'fuse-ext2.c' || echo './'fuse-ext2.c
fuse-ext2.c:280:12: error: static declaration of 'op_getxattr' follows non-static declaration
static int op_getxattr(const char *path, const char *name, char *value, size_t size, uint32_t position) {
^
./fuse-ext2.h:181:5: note: previous declaration is here
int op_getxattr (const char *path, const char *name, char *value, size_t size, uint32_t position);
^
1 error generated.
make[2]: *** [fuse_ext2-fuse-ext2.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
melisgia@itmrm09 fuse-ext2 %

@smellord
Copy link

so.. I've restarted, then i deleted the whole repo and redownloaded it

git clone https://github.com/alperakcan/fuse-ext2.git /tmp/ext4
cd /tmp/ext4

then I've modified the two files manually (using the patch diff info)

I ran the script:

./autogen.sh
CFLAGS="-idirafter/opt/gnu/include -idirafter/usr/local/include/osxfuse/ -idirafter/$(brew --prefix e2fsprogs)/include" LDFLAGS="-L/usr/local/opt/glib -L/usr/local/lib -L$(brew --prefix e2fsprogs)/lib" ./configure --prefix=/usr/local

it asked to install an Xcode module.
after installation:

sudo xcodebuild -license
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer

then I ran the script again:

./autogen.sh
CFLAGS="-idirafter/opt/gnu/include -idirafter/usr/local/include/osxfuse/ -idirafter/$(brew --prefix e2fsprogs)/include" LDFLAGS="-L/usr/local/opt/glib -L/usr/local/lib -L$(brew --prefix e2fsprogs)/lib" ./configure --prefix=/usr/local

now it finally works:

% fuse-ext2 --version

fuse-ext2 0.0.11 29 - FUSE EXT2FS Driver

Copyright (C) 2008-2015 Alper Akcan [email protected]
Copyright (C) 2009 Renzo Davoli [email protected]

Usage: fuse-ext2 <device|image_file> <mount_point> [-o option[,...]]

Options: ro, force, allow_other
Please see details in the manual.

Example: fuse-ext2 /dev/sda1 /mnt/sda1

http://github.com/alperakcan/fuse-ext2/

@DexterSLamb
Copy link

so.. I've restarted, then i deleted the whole repo and redownloaded it

git clone https://github.com/alperakcan/fuse-ext2.git /tmp/ext4 cd /tmp/ext4

then I've modified the two files manually (using the patch diff info)

I ran the script:

./autogen.sh CFLAGS="-idirafter/opt/gnu/include -idirafter/usr/local/include/osxfuse/ -idirafter/$(brew --prefix e2fsprogs)/include" LDFLAGS="-L/usr/local/opt/glib -L/usr/local/lib -L$(brew --prefix e2fsprogs)/lib" ./configure --prefix=/usr/local

it asked to install an Xcode module. after installation:

sudo xcodebuild -license sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer

then I ran the script again:

./autogen.sh CFLAGS="-idirafter/opt/gnu/include -idirafter/usr/local/include/osxfuse/ -idirafter/$(brew --prefix e2fsprogs)/include" LDFLAGS="-L/usr/local/opt/glib -L/usr/local/lib -L$(brew --prefix e2fsprogs)/lib" ./configure --prefix=/usr/local

now it finally works:

% fuse-ext2 --version

fuse-ext2 0.0.11 29 - FUSE EXT2FS Driver

Copyright (C) 2008-2015 Alper Akcan [email protected] Copyright (C) 2009 Renzo Davoli [email protected]

Usage: fuse-ext2 <device|image_file> <mount_point> [-o option[,...]]

Options: ro, force, allow_other Please see details in the manual.

Example: fuse-ext2 /dev/sda1 /mnt/sda1

http://github.com/alperakcan/fuse-ext2/

Great work thanks for sharing.

@BertalanD
Copy link

@alperakcan Do you think the patch that fixes compilation (#143 (comment)) could be merged? Or was this function signature correct at some point, maybe for an older FUSE version?

@unlucio
Copy link

unlucio commented Jul 22, 2024

new to FUSE and this project, just had my compilation fail on me because of this error.
It's great I'm not alone and there's already a potential patch fo rit.
Would it be worth it to wait for the patch to be applied, or should I patch the source my self?

@myxxmikeyxx
Copy link

myxxmikeyxx commented Nov 21, 2024

I just had this error. I am very new to this and FUSE and not sure if I should try running any of the above scripts because of that. Not sure what to do :/

MacOS - Sonoma 14.2.1 - Intel

@hmeine
Copy link

hmeine commented Dec 7, 2024

AFAICS, the argument is new, possibly introduced with Sonoma. In order for this to be merged, I think one would have to

  • make it conditional (so that compilation on older systems still works), and
  • actually use the new position argument for something. Or check that it has some expected value (0, probably) at runtime, if no other value is supported).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests