* build: standardize the Debug build dir on build/debug `docs/BUILD.md` and `AGENTS.md` document `./setup.sh Debug` producing `build/debug`, but `setup.sh`/`setup.ps1` created `builddir` and `.clangd` pointed there too, so the documented layout and the actual tree disagreed. Align the Debug mapping with the documented layout: - setup.sh / setup.ps1: Debug -> `build/debug` - CMakeLists.txt: Debug `_meson_build_dir` -> `build/debug` - .clangd: CompilationDatabase -> `build/debug` - plugin test fallbacks, S3 smoke default, quality-gate candidate list, and doc examples -> `build/debug` Legacy `builddir` trees stay readable: the quality gate and local-ci scripts still probe `builddir` as a fallback, and `plugin_trust` already treats `/build/` paths as build artifacts. * build: migrate remaining Debug consumers off builddir Follow-up to the Debug build-dir standardization: tracked consumers still hardcoded `builddir` and would break or silently skip against a fresh `build/debug` tree. Migrate them, keeping tolerant fallbacks where a legacy tree may still exist. - CI: `.github/workflows/tests.yml` runs `./setup.sh Debug` and then compiled `-C builddir`; switch BUILD_DIR/COMPILE_DB_DIR/compile paths to `build/debug`. Same for windows-test-diagnose.yml. - IDE: `.vscode/tasks.json` build/test/bench tasks target `build/debug`. - Runtime: `object_storage_plugin_loader` also probes `build/debug/plugins` (and the flat `build/debug`), retaining the `builddir` fallbacks. - Tests/docs: ONNX tuning integration plugin dir, benchmarks, and plugin READMEs/examples use `build/debug`. `./build/*` is already excluded from the quality-gate find and `.dockerignore`, so no exclusion lists change.
58 lines
1.8 KiB
Bash
Executable file
58 lines
1.8 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
builddir="${1:-build/debug}"
|
|
smoke_exe="${builddir}/tests/plugins/yams_s3_plugin_smoke"
|
|
|
|
required=(
|
|
"YAMS_RUN_LIVE_S3_SMOKE"
|
|
"S3_TEST_BUCKET"
|
|
"AWS_ACCESS_KEY_ID"
|
|
"AWS_SECRET_ACCESS_KEY"
|
|
)
|
|
|
|
missing=()
|
|
for var in "${required[@]}"; do
|
|
if [[ -z "${!var:-}" ]]; then
|
|
missing+=("${var}")
|
|
fi
|
|
done
|
|
|
|
if [[ ${#missing[@]} -gt 0 ]]; then
|
|
echo "Missing required environment variables: ${missing[*]}" >&2
|
|
echo "Required: YAMS_RUN_LIVE_S3_SMOKE=1, S3_TEST_BUCKET, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY" >&2
|
|
echo "Recommended for R2: AWS_REGION=auto, S3_TEST_ENDPOINT=<accountid>.r2.cloudflarestorage.com" >&2
|
|
exit 2
|
|
fi
|
|
|
|
if [[ "${YAMS_RUN_LIVE_S3_SMOKE}" != "1" ]]; then
|
|
echo "YAMS_RUN_LIVE_S3_SMOKE must be set to 1 to run the live S3/R2 smoke test." >&2
|
|
exit 2
|
|
fi
|
|
|
|
if [[ ${#AWS_ACCESS_KEY_ID} -ne 32 || "${AWS_ACCESS_KEY_ID}" == *-* ]]; then
|
|
echo "AWS_ACCESS_KEY_ID does not look like an R2 S3 access key (expected 32 chars)." >&2
|
|
echo "Tip: use R2 S3 API credentials, not a Cloudflare API bearer token." >&2
|
|
exit 2
|
|
fi
|
|
|
|
if [[ ${#AWS_SECRET_ACCESS_KEY} -lt 40 ]]; then
|
|
echo "AWS_SECRET_ACCESS_KEY looks too short for S3-compatible credentials." >&2
|
|
echo "Tip: use the paired R2 S3 Secret Access Key from 'Manage R2 API tokens'." >&2
|
|
exit 2
|
|
fi
|
|
|
|
export AWS_REGION="${AWS_REGION:-auto}"
|
|
export S3_TEST_USE_PATH_STYLE="${S3_TEST_USE_PATH_STYLE:-0}"
|
|
|
|
if [[ -x "${smoke_exe}" && -f "${builddir}/build.ninja" ]]; then
|
|
meson test -C "${builddir}" s3_plugin_smoke --print-errorlogs --verbose --no-rebuild
|
|
else
|
|
if [[ ! -d "${builddir}" ]]; then
|
|
meson setup "${builddir}"
|
|
fi
|
|
meson setup "${builddir}" --reconfigure
|
|
meson compile -C "${builddir}" yams_object_storage_s3 yams_s3_plugin_smoke
|
|
meson test -C "${builddir}" s3_plugin_smoke --print-errorlogs --verbose
|
|
fi
|