posix-spawn
posix-spawn copied to clipboard
Unable to install on Termux
Running gem install posix-spawn on Termux currently gives me:
ERROR: Error installing posix-spawn:
ERROR: Failed to build gem native extension.
current directory: /data/data/com.termux/files/usr/lib/ruby/gems/3.2.0/gems/posix-spawn-0.3.15/ext
/data/data/com.termux/files/usr/bin/ruby extconf.rb
creating Makefile
current directory: /data/data/com.termux/files/usr/lib/ruby/gems/3.2.0/gems/posix-spawn-0.3.15/ext
make DESTDIR\= sitearchdir\=./.gem.20240307-28064-kq11bf sitelibdir\=./.gem.20240307-28064-kq11bf clean
current directory: /data/data/com.termux/files/usr/lib/ruby/gems/3.2.0/gems/posix-spawn-0.3.15/ext
make DESTDIR\= sitearchdir\=./.gem.20240307-28064-kq11bf sitelibdir\=./.gem.20240307-28064-kq11bf
compiling posix-spawn.c
posix-spawn.c:226:27: error: incompatible function pointer types passing 'int (VALUE, VALUE, posix_spawn_file_actions_t *)' (aka 'int (unsigned long, unsigned long, struct __posix_spawn_file_actions **)') to parameter of type 'int (*)(VALUE, VALUE, VALUE)' (aka 'int (*)(unsigned long, unsigned long, unsigned long)') [-Wincompatible-function-pointer-types]
226 | rb_hash_foreach(options, posixspawn_file_actions_operations_iter, (VALUE)fops);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/data/data/com.termux/files/usr/include/ruby-3.2.0/ruby/internal/intern/hash.h:83:40: note: passing argument to parameter 'func' here
83 | void rb_hash_foreach(VALUE hash, int (*func)(VALUE key, VALUE val, VALUE arg), VALUE arg);
| ^
1 error generated.
make: *** [Makefile:248: posix-spawn.o] Error 1
make failed, exit code 2
Gem files will remain installed in /data/data/com.termux/files/usr/lib/ruby/gems/3.2.0/gems/posix-spawn-0.3.15 for inspection.
Results logged to /data/data/com.termux/files/usr/lib/ruby/gems/3.2.0/extensions/aarch64-linux-android/3.2.0/posix-spawn-0.3.15/gem_make.out
Same here in a Mac OS Sonoma M1 (but trying to build as x86_64 with ruby 3.2.3 in rvm)
Facing same issue on Mac OS Sonoma M2 @feolea how are you building as x86_64?
I success to install with below config in macOS Sonoma 14.3.1 (M1).
$ bundle config build.posix-spawn --with-cflags="-Wno-incompatible-function-pointer-types"
Facing same issue on Mac OS Sonoma M2 @feolea how are you building as x86_64?
Using Rosetta @prabhanshu
Thank you so much @taketo1113 I was able to follow your idea and in my setup was able to install it using: (Sonoma 14.4 M1 RVM)
gem install posix-spawn -v 0.3.15 -- --with-cflags=\"-Wno-incompatible-function-pointer-types\"
If you're using paperclip for kt-paperclip still and used posix-spawn as an optional dependency of terrapin then you can drop this dependency as terrapin no longer supports it:
https://github.com/thoughtbot/terrapin/commit/02f57b5a8b8f82a571fa929143b94a890333b06e