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

Ruby 2.6.4 and Ruby 2.7.0 build failure on M1 Mac cases two test failures #97

Open
chikoski opened this issue Aug 29, 2021 · 12 comments
Open
Labels
bug Something isn't working

Comments

@chikoski
Copy link

chikoski commented Aug 29, 2021

Summary:

Ruby 2.6.4 and Ruby 2.7.0 can not be build on M1 Mac. These build failures make the following two tests failed:

  • commands::install::tests::test_install_default_version
  • commands::install::tests::test_install_second_version

Steps reproduce:

  1. Try to install each version, i.e. 2.6.4 and 2.7.0, and confirm that build failure happens on both versions.
  2. Run cargo test commands::install::tests::test_install_default_version
  3. Run cargo test commands::install::tests::test_install_second_version

Note: I confirmed build failure happens with rvm command

Expected result:

Pass the both test cases.

Actual result:

The both test cases fail.

@TaKO8Ki TaKO8Ki added the bug Something isn't working label Aug 29, 2021
@TaKO8Ki
Copy link
Owner

TaKO8Ki commented Aug 29, 2021

Thank you for opening the issue! If you have time, could you run either or both frum install 2.6.4 and frum install 2.7.0 in your M1 Mac and add the error you get to the issue?

@chikoski
Copy link
Author

Yes. I tried both commands on my M1 Mac, and found build failures happened.

@TaKO8Ki
Copy link
Owner

TaKO8Ki commented Aug 29, 2021

Additionally, did you try building Ruby with rbenv in your M1 Mac? If so, did you succeed in it?

@chikoski
Copy link
Author

chikoski commented Aug 29, 2021

I could not build the both version with rbenv, either.
Note: I could install 3.0.2 with frum, rvm, and rbenv.

Found the following error in the log file for 2.6.4 as well as 2.7.0:

closure.c:264:14: error: implicit declaration of function 'ffi_prep_closure' is invalid in C99 [-Werror,-Wimplicit-func
    result = ffi_prep_closure(pcl, cif, callback, (void *)self);

@chikoski
Copy link
Author

Let me share y environment:

  • MacBook Air (M1, 2020)
  • Apple M1
  • Memory 8G
  • macOS Big Sur version 11.5.2

@TaKO8Ki
Copy link
Owner

TaKO8Ki commented Sep 2, 2021

I'll fix it when I have a time.
ref: ffi/ffi#869

@yerke
Copy link

yerke commented Jan 27, 2022

I was running into a potentially similar issue today when installing Ruby 2.5.0 on M1 with rvm.
In the end it was fixed with:

export optflags="-Wno-error=implicit-function-declaration"
rvm install 2.5.0

I took it from https://stackoverflow.com/questions/65325136/problem-when-installing-ruby-2-2-9-on-mac-big-sur-m1

I hope it helps in some way.

@synth
Copy link

synth commented Mar 26, 2022

export optflags="-Wno-error=implicit-function-declaration"

This worked for me with frum!

@a-r-db
Copy link

a-r-db commented Aug 5, 2022

export optflags="-Wno-error=implicit-function-declaration"
frum install 2.7.0

@p19ky
Copy link

p19ky commented Nov 29, 2022

frum install 2.6.4 is also failing on m1 pro macos ventura 13.0.1 :(((

@stellorior
Copy link

same issue here, Mac OS Ventura 13.1, Macbook Pro with M1 Pro chip.

frum install 3.1.0
==> Downloading https://cache.ruby-lang.org/pub/ruby/3.1/ruby-3.1.0.tar.xz
==> Extracting ruby-3.1.0.tar.xz
==> Building Ruby 3.1.0
error: Can't build Ruby: make failed: . ./vm_opts.h
libffi_version: 3.4.0
Undefined symbols for architecture arm64:
"_rb_enc_set_base", referenced from:
_Init_encdb in encdb.o
"_rb_enc_set_dummy", referenced from:
_Init_encdb in encdb.o
"_rb_encdb_alias", referenced from:
_Init_encdb in encdb.o
"_rb_encdb_declare", referenced from:
_Init_encdb in encdb.o
"_rb_encdb_dummy", referenced from:
_Init_encdb in encdb.o
"_rb_encdb_replicate", referenced from:
_Init_encdb in encdb.o
"_rb_encdb_set_unicode", referenced from:
_Init_encdb in encdb.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [.ext/arm64-darwin22/enc/encdb.bundle] Error 1
make: *** [enc] Error 2
make: *** Waiting for unfinished jobs....
Undefined symbols for architecture arm64:
"_rb_declare_transcoder", referenced from:
_Init_transdb in transdb.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [.ext/arm64-darwin22/enc/trans/transdb.bundle] Error 1
make: *** [trans] Error 2

@jwoyame
Copy link

jwoyame commented Feb 24, 2023

I had the same issue as @stellorior with macOS Ventura.

I was able to install by adding the --enable-shared flag:

frum install 2.7.6 --enable-shared

See also: https://bugs.ruby-lang.org/issues/19422

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants