Consider the code here. If I run crystal spec here, I get this:
$ crystal spec
/usr/bin/ld: cannot find -lxml2
collect2: error: ld returned 1 exit status
Error: execution of command failed with code: 1: `cc -o "/home/asaha/.cache/crystal/crystal-run-spec.tmp" "${@}" -rdynamic -lz `command -v pkg-config > /dev/null && pkg-config --libs libssl || printf %s '-lssl -lcrypto'` `command -v pkg-config > /dev/null && pkg-config --libs libcrypto || printf %s '-lcrypto'` -lxml2 -lpcre -lm -lgc -lpthread /opt/crystal/src/ext/libcrystal.a -levent -lrt -ldl -L/usr/lib -L/usr/local/lib`
Try installing the libxml package for your repo.
Yeah, that's what I did. But, shouldn't the crystal package when installed via a RPM package specify it as a dependency? On Fedora, I installed libxml2-devel.
I think the packages should depend on stuff like libxml2-devel and openssl-devel, which aren't technically required dependencies, but are required to do any serious work in crystal. This - in conjunction with a better error message when missing libraries - would definitely help newcomers to crystal.
@RX14 +1, I also raised the issue of the dependency on linker in https://github.com/crystal-lang/crystal/issues/3207
The immediate issue is fixed by #6004, spec no longer depends on libxml.
But it would still make sense to think about adding dev packages as dependencies.
Most helpful comment
I think the packages should depend on stuff like libxml2-devel and openssl-devel, which aren't technically required dependencies, but are required to do any serious work in crystal. This - in conjunction with a better error message when missing libraries - would definitely help newcomers to crystal.