ci: fix dependencies
This commit is contained in:
@@ -45,12 +45,12 @@ sh_test(
|
||||
size = "small",
|
||||
srcs = ["toolchain_version.sh"],
|
||||
args = select({
|
||||
":linux_x86_64": ["$(location @bun_linux_x64//:bun)"],
|
||||
":linux_aarch64": ["$(location @bun_linux_aarch64//:bun)"],
|
||||
":darwin_x86_64": ["$(location @bun_darwin_x64//:bun)"],
|
||||
":darwin_aarch64": ["$(location @bun_darwin_aarch64//:bun)"],
|
||||
":windows_x86_64": ["$(location @bun_windows_x64//:bun)"],
|
||||
"//conditions:default": ["$(location @bun_linux_x64//:bun)"],
|
||||
":linux_x86_64": ["$(rlocationpath @bun_linux_x64//:bun)"],
|
||||
":linux_aarch64": ["$(rlocationpath @bun_linux_aarch64//:bun)"],
|
||||
":darwin_x86_64": ["$(rlocationpath @bun_darwin_x64//:bun)"],
|
||||
":darwin_aarch64": ["$(rlocationpath @bun_darwin_aarch64//:bun)"],
|
||||
":windows_x86_64": ["$(rlocationpath @bun_windows_x64//:bun)"],
|
||||
"//conditions:default": ["$(rlocationpath @bun_linux_x64//:bun)"],
|
||||
}),
|
||||
data = select({
|
||||
":linux_x86_64": ["@bun_linux_x64//:bun"],
|
||||
@@ -66,6 +66,6 @@ sh_test(
|
||||
name = "toolchain_resolution_matrix_test",
|
||||
size = "small",
|
||||
srcs = ["toolchain_resolution_matrix.sh"],
|
||||
args = ["$(location //tests/toolchain_test:BUILD.bazel)"],
|
||||
args = ["$(rlocationpath //tests/toolchain_test:BUILD.bazel)"],
|
||||
data = ["//tests/toolchain_test:BUILD.bazel"],
|
||||
)
|
||||
|
||||
@@ -1,7 +1,63 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
build_file="$1"
|
||||
if [[ -z ${RUNFILES_DIR:-} && -n ${TEST_SRCDIR:-} && -d ${TEST_SRCDIR} ]]; then
|
||||
RUNFILES_DIR="${TEST_SRCDIR}"
|
||||
fi
|
||||
if [[ -z ${RUNFILES_DIR:-} && -z ${RUNFILES_MANIFEST_FILE:-} ]]; then
|
||||
if [[ -d "$0.runfiles" ]]; then
|
||||
RUNFILES_DIR="$0.runfiles"
|
||||
elif [[ -f "$0.runfiles_manifest" ]]; then
|
||||
RUNFILES_MANIFEST_FILE="$0.runfiles_manifest"
|
||||
elif [[ -f "$0.exe.runfiles_manifest" ]]; then
|
||||
RUNFILES_MANIFEST_FILE="$0.exe.runfiles_manifest"
|
||||
fi
|
||||
fi
|
||||
|
||||
resolve_runfile() {
|
||||
local path="${1:-}"
|
||||
local candidate
|
||||
local resolved
|
||||
|
||||
if [[ -z ${path} ]]; then
|
||||
echo "Error: missing runfile path" >&2
|
||||
exit 1
|
||||
fi
|
||||
if [[ ${path} == /* || ${path} =~ ^[A-Za-z]:[\\/] ]]; then
|
||||
printf '%s\n' "${path}"
|
||||
return 0
|
||||
fi
|
||||
if [[ -e ${path} ]]; then
|
||||
printf '%s\n' "${path}"
|
||||
return 0
|
||||
fi
|
||||
|
||||
for candidate in \
|
||||
"${path}" \
|
||||
"${TEST_WORKSPACE:-}/${path}" \
|
||||
"_main/${path}"; do
|
||||
[[ -z ${candidate} ]] && continue
|
||||
if [[ -n ${RUNFILES_DIR:-} && -e "${RUNFILES_DIR}/${candidate}" ]]; then
|
||||
printf '%s\n' "${RUNFILES_DIR}/${candidate}"
|
||||
return 0
|
||||
fi
|
||||
if [[ -n ${RUNFILES_MANIFEST_FILE:-} ]]; then
|
||||
resolved="$(
|
||||
awk -v key="${candidate}" 'index($0, key " ") == 1 { print substr($0, length(key) + 2); exit }' \
|
||||
"${RUNFILES_MANIFEST_FILE}"
|
||||
)"
|
||||
if [[ -n ${resolved} ]]; then
|
||||
printf '%s\n' "${resolved}"
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Error: unable to resolve runfile: ${path}" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
build_file="$(resolve_runfile "${1:-}")"
|
||||
|
||||
grep -Eq 'name = "linux_x86_64"' "${build_file}"
|
||||
grep -Eq 'name = "linux_aarch64"' "${build_file}"
|
||||
|
||||
@@ -1,8 +1,64 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
bun_path="$1"
|
||||
version="$(${bun_path} --version)"
|
||||
if [[ -z ${RUNFILES_DIR:-} && -n ${TEST_SRCDIR:-} && -d ${TEST_SRCDIR} ]]; then
|
||||
RUNFILES_DIR="${TEST_SRCDIR}"
|
||||
fi
|
||||
if [[ -z ${RUNFILES_DIR:-} && -z ${RUNFILES_MANIFEST_FILE:-} ]]; then
|
||||
if [[ -d "$0.runfiles" ]]; then
|
||||
RUNFILES_DIR="$0.runfiles"
|
||||
elif [[ -f "$0.runfiles_manifest" ]]; then
|
||||
RUNFILES_MANIFEST_FILE="$0.runfiles_manifest"
|
||||
elif [[ -f "$0.exe.runfiles_manifest" ]]; then
|
||||
RUNFILES_MANIFEST_FILE="$0.exe.runfiles_manifest"
|
||||
fi
|
||||
fi
|
||||
|
||||
resolve_runfile() {
|
||||
local path="${1:-}"
|
||||
local candidate
|
||||
local resolved
|
||||
|
||||
if [[ -z ${path} ]]; then
|
||||
echo "Error: missing runfile path" >&2
|
||||
exit 1
|
||||
fi
|
||||
if [[ ${path} == /* || ${path} =~ ^[A-Za-z]:[\\/] ]]; then
|
||||
printf '%s\n' "${path}"
|
||||
return 0
|
||||
fi
|
||||
if [[ -e ${path} ]]; then
|
||||
printf '%s\n' "${path}"
|
||||
return 0
|
||||
fi
|
||||
|
||||
for candidate in \
|
||||
"${path}" \
|
||||
"${TEST_WORKSPACE:-}/${path}" \
|
||||
"_main/${path}"; do
|
||||
[[ -z ${candidate} ]] && continue
|
||||
if [[ -n ${RUNFILES_DIR:-} && -e "${RUNFILES_DIR}/${candidate}" ]]; then
|
||||
printf '%s\n' "${RUNFILES_DIR}/${candidate}"
|
||||
return 0
|
||||
fi
|
||||
if [[ -n ${RUNFILES_MANIFEST_FILE:-} ]]; then
|
||||
resolved="$(
|
||||
awk -v key="${candidate}" 'index($0, key " ") == 1 { print substr($0, length(key) + 2); exit }' \
|
||||
"${RUNFILES_MANIFEST_FILE}"
|
||||
)"
|
||||
if [[ -n ${resolved} ]]; then
|
||||
printf '%s\n' "${resolved}"
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Error: unable to resolve runfile: ${path}" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
bun_path="$(resolve_runfile "${1:-}")"
|
||||
version="$("${bun_path}" --version)"
|
||||
|
||||
if [[ ! ${version} =~ ^[0-9]+\.[0-9]+\.[0-9]+ ]]; then
|
||||
echo "Unexpected bun version output: ${version}" >&2
|
||||
|
||||
Reference in New Issue
Block a user