Initial setup

This commit is contained in:
saf
2024-11-27 19:43:35 +00:00
commit f367ddbf1c
10 changed files with 244 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
#!/usr/bin/env bash
BAZEL_VERSION=7.4.1
BAZEL_URL=https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-linux-x86_64
BAZEL_SHA256_CHECKSUM=c97f02133adce63f0c28678ac1f21d65fa8255c80429b588aeeba8a1fac6202b
REPO_ROOT=$(git rev-parse --show-toplevel)
OUT_PATH="${REPO_ROOT}/bazel-${BAZEL_VERSION}"
BAZEL_BIN="${OUT_PATH}/bazel"
if [ ! -f "${BAZEL_BIN}" ]; then
mkdir -p "${OUT_PATH}"
fi
if [ ! -f "${BAZEL_BIN}" ]; then
curl -L -o "${BAZEL_BIN}" "${BAZEL_URL}"
chmod +x "${BAZEL_BIN}"
fi
sha256sum ${BAZEL_BIN} | grep -q ${BAZEL_SHA256_CHECKSUM}
if [ $? -ne 0 ]; then
echo "bazel binary checksum mismatch, exiting"
exit 1
fi
"${BAZEL_BIN}" "${@}"
+5
View File
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
# github.com/bazelbuild/rules_go/issues/3110
# export GOPACKAGESDRIVER_BAZEL_BUILD_FLAGS=--strategy=GoStdlibList=local
# github.com/bazelbuild/rules_go/wiki/Editor-setup
/home/coder/.local/bin/bazel run -- @rules_go//go/tools/gopackagesdriver "${@}"