LinusU / fs-xattr

🔖 Node.js module for manipulating extended attributes
MIT License
65 stars 17 forks source link

'sys/xattr.h' file not found on FreeBSD 12.1 #40

Open duncan-bayne opened 4 years ago

duncan-bayne commented 4 years ago

Installing fs-xattr fails on FreeBSD 12.1 (which came up while porting Signal Desktop).

System details:

Repro:

$ git clone https://github.com/LinusU/fs-xattr
$ cd fx-xattr
$ npm install 

> fs-xattr@0.3.1 install /usr/home/duncan/code/fs-xattr
> node-gyp rebuild

gmake: Entering directory '/usr/home/duncan/code/fs-xattr/build'
  CC(target) Release/obj.target/xattr/src/async.o
../src/async.c:4:10: fatal error: 'sys/xattr.h' file not found
#include <sys/xattr.h>
         ^~~~~~~~~~~~~
1 error generated.
gmake: *** [xattr.target.mk:111: Release/obj.target/xattr/src/async.o] Error 1
gmake: Leaving directory '/usr/home/duncan/code/fs-xattr/build'
gyp ERR! build error 
gyp ERR! stack Error: `gmake` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/home/duncan/.nvm/versions/node/v12.13.0/lib/node_modules/npm/node_modules/node
-gyp/lib/build.js:194:23)                                                                                                    
gyp ERR! stack     at ChildProcess.emit (events.js:210:5)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System FreeBSD 12.1-RELEASE
gyp ERR! command "/usr/home/duncan/.nvm/versions/node/v12.13.0/bin/node" "/usr/home/duncan/.nvm/versions/node/v12.13.0/lib/nod
e_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"                                                               
gyp ERR! cwd /usr/home/duncan/code/fs-xattr
gyp ERR! node -v v12.13.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! fs-xattr@0.3.1 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the fs-xattr@0.3.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /usr/home/duncan/.npm/_logs/2020-08-02T09_42_19_900Z-debug.log
toghrulgasimov commented 3 years ago

FreeBSD has sys/extattr.h

pstef commented 3 years ago

FreeBSD has sys/extattr.h

I don't know the Linux side of it, but I don't expect them to be compatible. So probably needs more than just an ifdef-else-endif.

duncan-bayne commented 1 year ago

This is failing for a different reason on FreeBSD 13.1. Will close this issue and open another.

duncan-bayne commented 1 year ago

Once I fixed that reason (with a python3 symlink) this problem resurfaced. Re-opening.

LinusU commented 1 year ago

What is your use case? It seems like extended attributes works slightly different on FreeBSD, they have namespaces.

ref: https://man.freebsd.org/cgi/man.cgi?extattr, https://man.freebsd.org/cgi/man.cgi?query=extattr&sektion=9&apropos=0&manpath=FreeBSD+13.2-RELEASE+and+Ports

Not sure what the desired behaviour is 🤔