| @@ -0,0 +1,58 @@ |
| 1 | +#!/usr/bin/env bash |
| 2 | +# Every package's latest release, checked and tested with this compiler: |
| 3 | +# a std or runtime change that breaks a released package of |
| 4 | +# louise-lang/packages shows here before it reaches the apps (ADR 0088, |
| 5 | +# gabla108/louise#475). Nightly and before every release |
| 6 | +# (.toboggan/workflows/packages-compat.yml). |
| 7 | +# |
| 8 | +# scripts/packages-compat.sh [PACKAGE...] (default: every package) |
| 9 | +# |
| 10 | +# LOUISE_PACKAGES_URL overrides the repository; LOUISE_PG_URL runs the |
| 11 | +# PostgreSQL tests, which skip without it. |
| 12 | +set -euo pipefail |
| 13 | +cd "$(dirname "$0")/.." |
| 14 | + |
| 15 | +cargo build --quiet -p louise -p louise_rt |
| 16 | +scripts/runtime.sh debug >/dev/null |
| 17 | +export PATH="$PWD/target/debug:$PATH" |
| 18 | +louise --version |
| 19 | + |
| 20 | +url="${LOUISE_PACKAGES_URL:-https://toboggan.cloud/louise-lang/packages.git}" |
| 21 | +work=$(mktemp -d) |
| 22 | +trap 'rm -rf "$work"' EXIT |
| 23 | +git clone --quiet "$url" "$work/packages" |
| 24 | +cd "$work/packages" |
| 25 | + |
| 26 | +packages=("$@") |
| 27 | +if [ ${#packages[@]} -eq 0 ]; then |
| 28 | + for m in */louise.toml; do packages+=("$(dirname "$m")"); done |
| 29 | +fi |
| 30 | + |
| 31 | +failed=() |
| 32 | +for pkg in "${packages[@]}"; do |
| 33 | + tag=$(git tag --list "$pkg-v*" --sort=-v:refname | head -1) |
| 34 | + if [ -z "$tag" ]; then |
| 35 | + echo "== $pkg: no release yet" |
| 36 | + continue |
| 37 | + fi |
| 38 | + echo "== $tag" |
| 39 | + git worktree add --quiet --detach "$work/$tag" "$tag" |
| 40 | + if ! ( |
| 41 | + cd "$work/$tag/$pkg" |
| 42 | + louise check |
| 43 | + case "$pkg" in |
| 44 | + argon2 | stringzilla | vectors) louise test --native ;; |
| 45 | + throttle | eventsourcing) louise test && louise test --native --jobs 1 ;; |
| 46 | + postgres | fetch) louise test && LOUISE_NET_TESTS=1 louise test --native ;; |
| 47 | + *) louise test && louise test --native ;; |
| 48 | + esac |
| 49 | + ); then |
| 50 | + failed+=("$tag") |
| 51 | + fi |
| 52 | +done |
| 53 | + |
| 54 | +if [ ${#failed[@]} -gt 0 ]; then |
| 55 | + echo "packages-compat: these releases fail with this compiler: ${failed[*]}" >&2 |
| 56 | + exit 1 |
| 57 | +fi |
| 58 | +echo "packages-compat: every release passes" |