Skip to content
Snippets Groups Projects
Commit 6ef8a4d4 authored by Jakub Jirutka's avatar Jakub Jirutka :flag_ua:
Browse files

community/crystal: run std_spec tests and samples

This is based on the upstream's CI config.
parent d3248ff7
1 merge request!26526community/crystal: upgrade to 1.2.0
Pipeline #97152 canceled
......@@ -9,7 +9,6 @@ _llvmver=12
pkgdesc="The Crystal Programming Language"
url="https://crystal-lang.org/"
arch="x86_64 aarch64"
options="!check" # disable for now till it fixed upstream
license="Apache-2.0"
depends="
gc-dev
......@@ -40,6 +39,7 @@ subpackages="$pkgname-doc
source="$pkgname-$pkgver.tar.gz::https://github.com/crystal-lang/$pkgname/archive/$pkgver.tar.gz
https://dev.alpinelinux.org/archive/crystal/crystal-$_bootver-x86_64-alpine-linux-musl.tar.gz
https://dev.alpinelinux.org/archive/crystal/crystal-$_bootver-aarch64-alpine-linux-musl.tar.gz
fix-crystal-sh.patch
"
builddir="$srcdir/$pkgname-$pkgver"
......@@ -48,6 +48,7 @@ _shardsdir="/usr/lib/$pkgname/shards"
export CRYSTAL_CONFIG_VERSION="$pkgver"
export CRYSTAL_CACHE_DIR="$srcdir/.cache"
export LLVM_CONFIG="/usr/lib/llvm$_llvmver/bin/llvm-config"
# Build static crystal binary and upload it to dev.a.o, so it can be used
# for building crystal next time (needed for bootstrapping).
......@@ -77,12 +78,15 @@ snapshot() {
prepare() {
default_prepare
# FIXME: These specs fail with invalid memory access.
rm spec/compiler/compiler_spec.cr
cat > Makefile.local <<-EOF
progress = 1
threads = ${JOBS:-2}
verbose = 1
FLAGS = --verbose --target $CTARGET ${BUILD_STATIC:+"--link-flags=-no-pie"}
LLVM_CONFIG = /usr/lib/llvm$_llvmver/bin/llvm-config
LLVM_CONFIG = $LLVM_CONFIG
EOF
}
......@@ -91,14 +95,17 @@ build() {
CRYSTAL_CONFIG_BUILD_COMMIT= \
CRYSTAL_CONFIG_PATH="lib:$_shardsdir:$_coredir" \
PATH="$srcdir/$pkgname-$_bootver-$CBUILD/bin:$PATH" \
LLVM_CONFIG="/usr/lib/llvm$_llvmver/bin/llvm-config" \
release=1 \
static=${BUILD_STATIC:-}
}
check() {
make spec LLVM_CONFIG="llvm-config" PATH=".build:$PATH" \
SPEC_FLAGS="--no-color --verbose"
make std_spec threads=1 SPEC_FLAGS='--no-color --verbose'
find samples -name '*.cr' | xargs -tn 1 ./bin/crystal build --no-codegen
# Takes ~1 hour on x86_64, ~1.5 hour on aarch64.
#make compiler_spec threads=1 SPEC_FLAGS='--no-color --verbose'
}
package() {
......@@ -136,4 +143,5 @@ sha512sums="
305aee00d8b59cc004785b69d2b044e388fc0e68b3da1f2a385473eff63bab7eb191d56aa4761e7a969509d8c5ede1c6d696847fde609fbfcfb46e13af193422 crystal-1.2.0.tar.gz
4c47961882a68485450b7b001ffc844d150b534bafec5f95c782d4a5bf33422f7b0a0be8be153e779bf2200da540aa1505e8345b07e9e8ef779b08e1b21a76b3 crystal-1.1.1-x86_64-alpine-linux-musl.tar.gz
de33f8f51355e8091cc67ef9d3f29b2422311fd420c33968f9e95729c0367134d19aaeae603123306ed768bb3d098d9ab367f601ebd9c4e9fe265bae9f77489a crystal-1.1.1-aarch64-alpine-linux-musl.tar.gz
2ba9e26eb1e6d20681e7f2ad78e0ebd75ae0dc614624c8de90c918046d0451f43173a23981dbebb47d1da2cf58663e8b1169d7f32799b054fc0f6a6cb112b7c5 fix-crystal-sh.patch
"
Don't print error message when there's no system-provided crystal.
--- a/bin/crystal
+++ b/bin/crystal
@@ -150,7 +150,7 @@
if [ -z "$CRYSTAL_CONFIG_LIBRARY_PATH" ] || [ -z "$CRYSTAL_LIBRARY_PATH" ]; then
CRYSTAL_INSTALLED_LIBRARY_PATH="$(
export PATH="$(remove_path_item "$(remove_path_item "$PATH" "$SCRIPT_ROOT")" "bin")"
- crystal env CRYSTAL_LIBRARY_PATH || echo ""
+ crystal env CRYSTAL_LIBRARY_PATH 2>/dev/null || echo ""
)"
export CRYSTAL_LIBRARY_PATH=${CRYSTAL_LIBRARY_PATH:-$CRYSTAL_INSTALLED_LIBRARY_PATH}
export CRYSTAL_CONFIG_LIBRARY_PATH=${CRYSTAL_CONFIG_LIBRARY_PATH:-$CRYSTAL_INSTALLED_LIBRARY_PATH}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment