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

1.5.6 compilation issue on ARM based Mac #74

Closed
mscrivo opened this issue Apr 1, 2024 · 10 comments
Closed

1.5.6 compilation issue on ARM based Mac #74

mscrivo opened this issue Apr 1, 2024 · 10 comments

Comments

@mscrivo
Copy link

mscrivo commented Apr 1, 2024

After updating to 1.5.6, I am unable to compile the gem's native extension.

Error:

streaming_compress.c:54:5: error: incompatible function pointer types initializing 'RUBY_DATA_FUNC' (aka 'void (*)(void *)') with an expression of type 'size_t (void *)' (aka 'unsigned long (void *)')
[-Wincompatible-function-pointer-types]
    streaming_compress_compact,
    ^~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning and 1 error generated.
make: *** [streaming_compress.o] Error 1

make failed, exit code 2

System details:
Macbook M1
macOS 14.4.1
Xcode 15.3

@SpringMT
Copy link
Owner

SpringMT commented Apr 1, 2024

What version of Ruby are you using?

@mscrivo
Copy link
Author

mscrivo commented Apr 1, 2024

Ah totally forget that important bit of info 🤦🏼

ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [arm64-darwin23]

compiled with the following args:
--with-openssl-dir=/opt/homebrew/opt/openssl@3 --with-jemalloc-dir=/opt/homebrew/opt/jemalloc --enable-yjit

@mscrivo
Copy link
Author

mscrivo commented Apr 1, 2024

Actually, I have one more config setting that is relevant:

export DLDFLAGS="${DLDFLAGS:-} -Wl,-undefined,dynamic_lookup"

and it seems that's the culprit. After removing that, I am able to build the extension. We had to add that to get some other gems's extensions compiling, but perhaps it's no longer required and I can remove it.

@mscrivo
Copy link
Author

mscrivo commented Apr 1, 2024

I am able to compile all the gems we use without those flags, so it seems we're all good. Thank you for your time!

@mscrivo mscrivo closed this as completed Apr 1, 2024
@SpringMT
Copy link
Owner

SpringMT commented Apr 1, 2024

Thank you!
I'm noting down the similar issue grpc/grpc#35148.

@mscrivo
Copy link
Author

mscrivo commented Apr 1, 2024

yeah actually I spoke too soon, it's still failing to compile even with those flags removed.

@mscrivo
Copy link
Author

mscrivo commented Apr 1, 2024

strange thing is I still get the error if I try: bundle config set build.zstd-ruby --with-cflags=-Wno-error=incompatible-function-pointer-types

@mscrivo mscrivo reopened this Apr 1, 2024
@SpringMT
Copy link
Owner

SpringMT commented Apr 1, 2024

#75 should be able to fix it.

@SpringMT
Copy link
Owner

SpringMT commented Apr 1, 2024

@mscrivo I released 1.5.6.1 https://rubygems.org/gems/zstd-ruby/versions/1.5.6.1.
Please test it 🙇

@mscrivo
Copy link
Author

mscrivo commented Apr 1, 2024

it works! thanks again!

@mscrivo mscrivo closed this as completed Apr 1, 2024
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

2 participants