Skip to content

Cannot Build on M3  #92

@BeatyThomas

Description

@BeatyThomas

Ruby Version

ruby 2.7.2p137 (2020-10-01 revision 5445e04352)

Rails Version

5.2

Hardware

M3 (arm64-darwin23)

Posix-spawn Version

0.3.15

Issue

My company recently purchased Apple M3's. We had been using the M1's without an issue. When installing posix-spawn with gem install posix-spawn I get this output:

Building native extensions. This could take a while...
ERROR:  Error installing posix-spawn:
	ERROR: Failed to build gem native extension.

    current directory: /Users/beatythomas/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/posix-spawn-0.3.15/ext
/Users/beatythomas/.rbenv/versions/2.7.2/bin/ruby -I /Users/beatythomas/.rbenv/versions/2.7.2/lib/ruby/2.7.0 -r ./siteconf20240312-74649-7tb5yl.rb extconf.rb
creating Makefile

current directory: /Users/beatythomas/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/posix-spawn-0.3.15/ext
make "DESTDIR=" clean

current directory: /Users/beatythomas/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/posix-spawn-0.3.15/ext
make "DESTDIR="
compiling posix-spawn.c
posix-spawn.c:69:28: warning: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro]
                        if      (SYM2ID(obj) == rb_intern("in"))   fd = 0;
                                                ^~~~~~~~~~~~~~~

/Users/beatythomas/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1837:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
    }
    ^
posix-spawn.c:112:46: note: ')' token is here
        if (TYPE(val) != T_SYMBOL || SYM2ID(val) != rb_intern("close"))
                                                    ^~~~~~~~~~~~~~~~~~
/Users/beatythomas/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:56: note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                                                       ^
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, void **)') to parameter of type 'int (*)(VALUE, VALUE, VALUE)' (aka 'int (*)(unsigned long, unsigned long, unsigned long)') [-Wincompatible-function-pointer-types]
        rb_hash_foreach(options, posixspawn_file_actions_operations_iter, (VALUE)fops);
                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/beatythomas/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/intern.h:558:35: note: passing argument to parameter here
void rb_hash_foreach(VALUE, int (*)(VALUE, VALUE, VALUE), VALUE);
                                  ^
posix-spawn.c:246:46: warning: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro]
        pgroup_val = rb_hash_delete(options, ID2SYM(rb_intern("pgroup")));
                                                    ^~~~~~~~~~~~~~~~~~~
/Users/beatythomas/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:23: note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
      

[ similar warnings not repeated] 


36 warnings and 1 error generated.
make: *** [posix-spawn.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/beatythomas/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/posix-spawn-0.3.15 for inspection.
Results logged to /Users/beatythomas/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/extensions/arm64-darwin-23/2.7.0/posix-spawn-0.3.15/gem_make.out

Interestingly though, I can install it without issue using the system ruby:

ruby -v ruby 2.6.10p210 (2022-04-12 revision 67958) [universal.arm64e-darwin23]

Any ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions