asdf-community/asdf-crystal

Crystal does not work on Fedora

ejpcmac opened this issue · 1 comments

OS: Fedora 26
Crystal version: 0.24.2

Problem description

I can’t run crystal:

# hello.cr
puts "Hello, world!"
$ crystal hello.cr
/usr/bin/ld: skipping incompatible /usr/lib/libpthread.so when searching for -lpthread
/usr/bin/ld: cannot find -levent
/usr/bin/ld: skipping incompatible /usr/lib/librt.so when searching for -lrt
/usr/bin/ld: skipping incompatible /usr/lib/libdl.so when searching for -ldl
/usr/bin/ld: skipping incompatible /usr/lib/libc.so when searching for -lc
collect2: error: ld returned 1 exit status
Error: execution of command failed with code: 1: `cc "${@}" -o '/home/***/.cache/crystal/crystal-run-hello.tmp'  -rdynamic  -lpcre -lgc -lpthread /home/***/.asdf/installs/crystal/0.24.2/share/crystal/src/ext/libcrystal.a -levent -lrt -ldl -L/usr/lib -L/usr/local/lib`

Expectet behaviour

Crystal should run on Fedora.

Ideas

This seems to be a library incompatibility between the system crystal was built on and my distribution. I see two ways to avoid this:

  • provide statically-linked binaries
  • check for the distribution and build crystal from sources if necessary

Edit : After reading more about crystal, it seems my two points can’t change anything. The crystal binary itself works, but it can’t link correctly my program. Building crystal from sources is not possible since crystal requires crystal to build.

I just tried to use crystal binaries from their GitHub, and I got the same error. I’ll report this upstream.