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

Unable to install on Termux #91

Open
khemarato opened this issue Mar 7, 2024 · 5 comments
Open

Unable to install on Termux #91

khemarato opened this issue Mar 7, 2024 · 5 comments

Comments

@khemarato
Copy link

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
@feolea
Copy link

feolea commented Mar 7, 2024

Same here in a Mac OS Sonoma M1 (but trying to build as x86_64 with ruby 3.2.3 in rvm)

@prabhanshu
Copy link

prabhanshu commented Mar 7, 2024

Facing same issue on Mac OS Sonoma M2
@feolea how are you building as x86_64?

@taketo1113
Copy link

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"

@feolea
Copy link

feolea commented Mar 12, 2024

Facing same issue on Mac OS Sonoma M2 @feolea how are you building as x86_64?

Using Rosetta @prabhanshu

@feolea
Copy link

feolea commented Mar 12, 2024

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\"

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

4 participants