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

MacOS tar.gz bundle: playground fails on libiconv #8413

Open
wmannis opened this issue Nov 1, 2019 · 3 comments
Open

MacOS tar.gz bundle: playground fails on libiconv #8413

wmannis opened this issue Nov 1, 2019 · 3 comments

Comments

@wmannis
Copy link

wmannis commented Nov 1, 2019

Crystal version: 0.31.1 (also tested 0.31.0, which fails, too).
MacOS version: 10.14.6.

I am able to compile simple Crystal programs (I'm trying it for the first time today). However, when I try to run the playground with crystal play, once I connect to the URL the spinning start/stop button eventually announces a disconnect, and I get this in the terminal —

Listening on http://127.0.0.1:8080
Undefined symbols for architecture x86_64:
  "_iconv", referenced from:
      _*Iconv#convert<Pointer(Pointer(UInt8)), Pointer(UInt64), Pointer(Pointer(UInt8)), Pointer(UInt64)>:UInt64 in I-conv.o
  "_iconv_close", referenced from:
      _*Iconv#close:Nil in I-conv.o
  "_iconv_open", referenced from:
      _*Iconv#initialize<String, String, (Symbol | Nil)>:Nil in I-conv.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Error: execution of command failed with code: 1: `cc "${@}" -o '/Users/xxxxx/.cache/crystal/crystal-run-play-1-1.tmp'  -rdynamic  -lz `command -v pkg-config > /dev/null && pkg-config --libs --silence-errors libssl || printf %s '-lssl -lcrypto'` `command -v pkg-config > /dev/null && pkg-config --libs --silence-errors libcrypto || printf %s '-lcrypto'` -lpcre /Users/xxxxx/local/pkg/crystal-0.31.1-1/embedded/lib/libgc.a -lpthread /Users/xxxxx/local/pkg/crystal-0.31.1-1/src/ext/libcrystal.a -levent -liconv -ldl -L/Users/xxxxx/local/pkg/crystal-0.31.1-1/embedded/lib -L/usr/lib -L/usr/local/lib`

There is a libiconv.2.dylib in /usr/lib, so I'm not entirely sure where the error is.

@jhass
Copy link
Member

jhass commented Nov 1, 2019

I needed a export LIBRARY_PATH=/usr/local/Cellar/openssl/1.0.2t/lib but afterwards I couldn't reproduce on 10.15.1.

Do you use Homebrew? Does the Homebrew version work for you?

@wmannis
Copy link
Author

wmannis commented Nov 1, 2019

Do you use Homebrew? Does the Homebrew version work for you?

I do not, and was hoping not to just to do some testing.

@rdp
Copy link
Contributor

rdp commented Nov 20, 2019

I tried the tarball with a few dependencies installed via homebrew (libevent, pkg-config, openssl)
and it seemed to work OK here 10.14.6

$ pwd
/Users/packrd/dev/downloads/crystal-0.31.1-1
$ ./bin/crystal play
Listening on http://127.0.0.1:8080
...

I assume the right symbols are there?

$ nm -a /usr/lib/libiconv.2.4.0.dylib | grep iconv
0000000000002360 T _iconv
...
0000000000002382 T _iconv_close
...

Possibly multiple versions of iconv around? #7789

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants