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

Crystal play exits if trying a demo using C-binding #9151

Open
hugopl opened this issue Apr 21, 2020 · 0 comments
Open

Crystal play exits if trying a demo using C-binding #9151

hugopl opened this issue Apr 21, 2020 · 0 comments

Comments

@hugopl
Copy link
Contributor

hugopl commented Apr 21, 2020

Tested with crystal play on v0.34 (archlinux)

Using the following code on crystal play make it crash due to a link error

lib Whatever
  fun crash
end

Whatever.crash
$ crystal play
Listening on http://127.0.0.1:8080
/usr/bin/ld: _main.o: in function `__crystal_main':
./play:5: undefined reference to `crash'
collect2: error: ld returned 1 exit status
Error: execution of command failed with code: 1: `cc "${@}" -o '/home/hugo/.cache/crystal/crystal-run-play-1-7.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 -lm -lgc -lpthread /usr/lib/crystal/ext/libcrystal.a -levent -lrt -ldl -L/usr/lib -L/usr/local/lib`

IMO it shouldn't crash, but just catch the link error and show to the user. Besides of showing the type information on side panel, etc.. since the code was compiled, just not linked.

@jhass jhass changed the title Crystal play exists if trying a demo using C-binding Crystal play exits if trying a demo using C-binding Apr 22, 2020
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

2 participants