mirror of
https://github.com/ankitects/anki.git
synced 2026-09-10 13:28:09 -04:00
Two build fixes found while getting the build working on FreeBSD.
1. **Remove hardcoded `#!/bin/bash` paths and use /usr/bin/env instead
/**
2. **env_remove("YARN_BINARY")**
Tested on FreeBSD 16.0-CURRENT amd64.
A second series adds FreeBSD support with `platform` variants,
environment overrides, PyQt6 handling and docs.
Closes #5301
33 lines
964 B
Bash
Executable File
33 lines
964 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -e
|
|
|
|
html="$1"
|
|
|
|
outdir="out/coverage/rust"
|
|
LLVMCOVPATH="out/bin"
|
|
|
|
mkdir -p $outdir $LLVMCOVPATH
|
|
|
|
export CARGO_TARGET_DIR="${CARGO_TARGET_DIR:-out/rust}"
|
|
|
|
if [[ "${CI:-}" == "true" ]]; then
|
|
# prebuilt binary shouldve been installed
|
|
cargo_cmd="cargo"
|
|
else
|
|
cargo_cmd="$LLVMCOVPATH/cargo-llvm-cov"
|
|
test -x "$cargo_cmd" || cargo install cargo-llvm-cov --version 0.8.4 --locked --root out
|
|
test -x "$LLVMCOVPATH/cargo-nextest" || cargo install cargo-nextest \
|
|
--version 0.9.99 --locked --no-default-features --features default-no-update --root out
|
|
fi
|
|
|
|
export PATH="$LLVMCOVPATH:$PATH"
|
|
|
|
ANKI_TEST_MODE=1 "$cargo_cmd" llvm-cov nextest --workspace --locked --json --summary-only \
|
|
--output-path $outdir/coverage-summary.json --fail-under-lines 64
|
|
|
|
if [ "$html" = "--html" ]; then
|
|
ANKI_TEST_MODE=1 "$cargo_cmd" llvm-cov report --html --output-dir $outdir
|
|
echo "Rust coverage report: $outdir/html/index.html"
|
|
fi
|