| 1 | #!/usr/bin/env sh |
| 2 | set -eu |
| 3 | |
| 4 | script_dir=$(CDPATH= cd "$(dirname "$0")" && pwd) |
| 5 | repo_root=$(CDPATH= cd "$script_dir/../../../.." && pwd) |
| 6 | cd "$repo_root" |
| 7 | |
| 8 | target="vlib/x/executor" |
| 9 | |
| 10 | if [ ! -d "$target" ]; then |
| 11 | echo "$target does not exist" >&2 |
| 12 | exit 1 |
| 13 | fi |
| 14 | |
| 15 | if find "$target" -type f -name '*.v' -print | xargs grep -n 'import x\.async' >/tmp/xexecutor_async_imports.$$ 2>/dev/null; then |
| 16 | echo "x.executor must not import x.async:" >&2 |
| 17 | cat /tmp/xexecutor_async_imports.$$ >&2 |
| 18 | rm -f /tmp/xexecutor_async_imports.$$ |
| 19 | exit 1 |
| 20 | fi |
| 21 | rm -f /tmp/xexecutor_async_imports.$$ |
| 22 | |
| 23 | if [ -d "$target/examples" ] && find "$target/examples" -type f -print | xargs grep -n 'x\.async' >/tmp/xexecutor_async_examples.$$ 2>/dev/null; then |
| 24 | echo "x.executor examples must not mention or use x.async:" >&2 |
| 25 | cat /tmp/xexecutor_async_examples.$$ >&2 |
| 26 | rm -f /tmp/xexecutor_async_examples.$$ |
| 27 | exit 1 |
| 28 | fi |
| 29 | rm -f /tmp/xexecutor_async_examples.$$ |
| 30 | |
| 31 | if find "$target" -type f -name '*.v' | grep -Ei '(^|/)(async|.*bridge.*)\.v$' >/tmp/xexecutor_async_bridge_files.$$ 2>/dev/null; then |
| 32 | echo "x.executor must not add async or bridge V files:" >&2 |
| 33 | cat /tmp/xexecutor_async_bridge_files.$$ >&2 |
| 34 | rm -f /tmp/xexecutor_async_bridge_files.$$ |
| 35 | exit 1 |
| 36 | fi |
| 37 | rm -f /tmp/xexecutor_async_bridge_files.$$ |
| 38 | |
| 39 | echo "x.executor dependency check passed" |
| 40 | |