Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ common --test_output=errors

try-import .bazel.buildbuddy.rc
try-import .bazel.compilation_mode.bazelrc
try-import .bazel.build_salt.bazelrc
12 changes: 12 additions & 0 deletions .github/actions/setup-bazel-cache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,19 @@ runs:
echo "common --remote_cache=grpcs://remote.buildbuddy.io" >> .bazel.buildbuddy.rc
echo "common --remote_timeout=10m" >> .bazel.buildbuddy.rc
echo "common --remote_header=x-buildbuddy-api-key=${{inputs.BUILDBUDDY_API_KEY}}" >> .bazel.buildbuddy.rc
echo "common --remote_upload_local_results" >> .bazel.buildbuddy.rc
- name: Enable optimized builds
shell: bash
run: |
echo "common --compilation_mode opt" > .bazel.compilation_mode.bazelrc
# https://arrdem.com/2024/01/11/bazel-glibc/
- name: Add build salt
shell: bash
run: |
SALT=$(./infrastructure/build_salt.sh)
echo > .bazel.build_salt.bazelrc
echo "build --copt=-DPLATFORM_FINGERPRINT=$SALT" >> .bazel.build_salt.bazelrc
echo "build --action_env=PLATFORM_FINGERPRINT=$SALT" >> .bazel.build_salt.bazelrc
echo "common --copt=-DPLATFORM_FINGERPRINT=$SALT" >> .bazel.build_salt.bazelrc
echo "common --action_env=PLATFORM_FINGERPRINT=$SALT" >> .bazel.build_salt.bazelrc
cat .bazel.build_salt.bazelrc
15 changes: 4 additions & 11 deletions .github/workflows/ci-RHEL_10.0-arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,8 @@ jobs:
configFile: ./.devcontainer/rhel_10.0-llvm-${{ matrix.LLVM_VERSION }}/devcontainer.json
runCmd: |
mkdir -p packages
# https://arrdem.com/2024/01/11/bazel-glibc/
build_salt=`ldd --version | sha256sum | awk ' {print $1} '`
bazel build //... --copt=-DPLATFORM_FINGERPRINT=$build_salt --action_env=PLATFORM_FINGERPRINT=$build_salt
bazel test //... --copt=-DPLATFORM_FINGERPRINT=$build_salt --action_env=PLATFORM_FINGERPRINT=$build_salt
bazel build //...
bazel test //...
mv -v bazel-bin/Mull-*.rpm packages/
- name: Publish package
uses: devcontainers/[email protected]
Expand All @@ -47,20 +45,15 @@ jobs:
push: never
env: CLOUDSMITH_API_KEY
runCmd: |
build_salt=`ldd --version | sha256sum | awk ' {print $1} '`
bazel run publish \
--copt=-DPLATFORM_FINGERPRINT=$build_salt \
--action_env=PLATFORM_FINGERPRINT=$build_salt && exit 0
bazel run publish && exit 0

max_attempts=3
attempt=1
until [ "$attempt" -ge "$max_attempts" ]
do
echo "Attempt $attempt failed. Retrying..."
attempt=$((attempt+1))
bazel run publish \
--copt=-DPLATFORM_FINGERPRINT=$build_salt \
--action_env=PLATFORM_FINGERPRINT=$build_salt && exit 0
bazel run publish && exit 0
done
echo "All $max_attempts attempts failed."
exit 1
Expand Down
15 changes: 4 additions & 11 deletions .github/workflows/ci-RHEL_10.0-x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,8 @@ jobs:
configFile: ./.devcontainer/rhel_10.0-llvm-${{ matrix.LLVM_VERSION }}/devcontainer.json
runCmd: |
mkdir -p packages
# https://arrdem.com/2024/01/11/bazel-glibc/
build_salt=`ldd --version | sha256sum | awk ' {print $1} '`
bazel build //... --copt=-DPLATFORM_FINGERPRINT=$build_salt --action_env=PLATFORM_FINGERPRINT=$build_salt
bazel test //... --copt=-DPLATFORM_FINGERPRINT=$build_salt --action_env=PLATFORM_FINGERPRINT=$build_salt
bazel build //...
bazel test //...
mv -v bazel-bin/Mull-*.rpm packages/
- name: Publish package
uses: devcontainers/[email protected]
Expand All @@ -47,20 +45,15 @@ jobs:
push: never
env: CLOUDSMITH_API_KEY
runCmd: |
build_salt=`ldd --version | sha256sum | awk ' {print $1} '`
bazel run publish \
--copt=-DPLATFORM_FINGERPRINT=$build_salt \
--action_env=PLATFORM_FINGERPRINT=$build_salt && exit 0
bazel run publish && exit 0

max_attempts=3
attempt=1
until [ "$attempt" -ge "$max_attempts" ]
do
echo "Attempt $attempt failed. Retrying..."
attempt=$((attempt+1))
bazel run publish \
--copt=-DPLATFORM_FINGERPRINT=$build_salt \
--action_env=PLATFORM_FINGERPRINT=$build_salt && exit 0
bazel run publish && exit 0
done
echo "All $max_attempts attempts failed."
exit 1
Expand Down
15 changes: 4 additions & 11 deletions .github/workflows/ci-RHEL_9.6-arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,8 @@ jobs:
configFile: ./.devcontainer/rhel_9.6-llvm-${{ matrix.LLVM_VERSION }}/devcontainer.json
runCmd: |
mkdir -p packages
# https://arrdem.com/2024/01/11/bazel-glibc/
build_salt=`ldd --version | sha256sum | awk ' {print $1} '`
bazel build //... --copt=-DPLATFORM_FINGERPRINT=$build_salt --action_env=PLATFORM_FINGERPRINT=$build_salt
bazel test //... --copt=-DPLATFORM_FINGERPRINT=$build_salt --action_env=PLATFORM_FINGERPRINT=$build_salt
bazel build //...
bazel test //...
mv -v bazel-bin/Mull-*.rpm packages/
- name: Publish package
uses: devcontainers/[email protected]
Expand All @@ -47,20 +45,15 @@ jobs:
push: never
env: CLOUDSMITH_API_KEY
runCmd: |
build_salt=`ldd --version | sha256sum | awk ' {print $1} '`
bazel run publish \
--copt=-DPLATFORM_FINGERPRINT=$build_salt \
--action_env=PLATFORM_FINGERPRINT=$build_salt && exit 0
bazel run publish && exit 0

max_attempts=3
attempt=1
until [ "$attempt" -ge "$max_attempts" ]
do
echo "Attempt $attempt failed. Retrying..."
attempt=$((attempt+1))
bazel run publish \
--copt=-DPLATFORM_FINGERPRINT=$build_salt \
--action_env=PLATFORM_FINGERPRINT=$build_salt && exit 0
bazel run publish && exit 0
done
echo "All $max_attempts attempts failed."
exit 1
Expand Down
15 changes: 4 additions & 11 deletions .github/workflows/ci-RHEL_9.6-x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,8 @@ jobs:
configFile: ./.devcontainer/rhel_9.6-llvm-${{ matrix.LLVM_VERSION }}/devcontainer.json
runCmd: |
mkdir -p packages
# https://arrdem.com/2024/01/11/bazel-glibc/
build_salt=`ldd --version | sha256sum | awk ' {print $1} '`
bazel build //... --copt=-DPLATFORM_FINGERPRINT=$build_salt --action_env=PLATFORM_FINGERPRINT=$build_salt
bazel test //... --copt=-DPLATFORM_FINGERPRINT=$build_salt --action_env=PLATFORM_FINGERPRINT=$build_salt
bazel build //...
bazel test //...
mv -v bazel-bin/Mull-*.rpm packages/
- name: Publish package
uses: devcontainers/[email protected]
Expand All @@ -47,20 +45,15 @@ jobs:
push: never
env: CLOUDSMITH_API_KEY
runCmd: |
build_salt=`ldd --version | sha256sum | awk ' {print $1} '`
bazel run publish \
--copt=-DPLATFORM_FINGERPRINT=$build_salt \
--action_env=PLATFORM_FINGERPRINT=$build_salt && exit 0
bazel run publish && exit 0

max_attempts=3
attempt=1
until [ "$attempt" -ge "$max_attempts" ]
do
echo "Attempt $attempt failed. Retrying..."
attempt=$((attempt+1))
bazel run publish \
--copt=-DPLATFORM_FINGERPRINT=$build_salt \
--action_env=PLATFORM_FINGERPRINT=$build_salt && exit 0
bazel run publish && exit 0
done
echo "All $max_attempts attempts failed."
exit 1
Expand Down
15 changes: 4 additions & 11 deletions .github/workflows/ci-Ubuntu_22.04-arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,8 @@ jobs:
configFile: ./.devcontainer/ubuntu_22.04-llvm-${{ matrix.LLVM_VERSION }}/devcontainer.json
runCmd: |
mkdir -p packages
# https://arrdem.com/2024/01/11/bazel-glibc/
build_salt=`ldd --version | sha256sum | awk ' {print $1} '`
bazel build //... --copt=-DPLATFORM_FINGERPRINT=$build_salt --action_env=PLATFORM_FINGERPRINT=$build_salt
bazel test //... --copt=-DPLATFORM_FINGERPRINT=$build_salt --action_env=PLATFORM_FINGERPRINT=$build_salt
bazel build //...
bazel test //...
mv -v bazel-bin/Mull-*.deb packages/
- name: Publish package
uses: devcontainers/[email protected]
Expand All @@ -47,20 +45,15 @@ jobs:
push: never
env: CLOUDSMITH_API_KEY
runCmd: |
build_salt=`ldd --version | sha256sum | awk ' {print $1} '`
bazel run publish \
--copt=-DPLATFORM_FINGERPRINT=$build_salt \
--action_env=PLATFORM_FINGERPRINT=$build_salt && exit 0
bazel run publish && exit 0

max_attempts=3
attempt=1
until [ "$attempt" -ge "$max_attempts" ]
do
echo "Attempt $attempt failed. Retrying..."
attempt=$((attempt+1))
bazel run publish \
--copt=-DPLATFORM_FINGERPRINT=$build_salt \
--action_env=PLATFORM_FINGERPRINT=$build_salt && exit 0
bazel run publish && exit 0
done
echo "All $max_attempts attempts failed."
exit 1
Expand Down
15 changes: 4 additions & 11 deletions .github/workflows/ci-Ubuntu_22.04-x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,8 @@ jobs:
configFile: ./.devcontainer/ubuntu_22.04-llvm-${{ matrix.LLVM_VERSION }}/devcontainer.json
runCmd: |
mkdir -p packages
# https://arrdem.com/2024/01/11/bazel-glibc/
build_salt=`ldd --version | sha256sum | awk ' {print $1} '`
bazel build //... --copt=-DPLATFORM_FINGERPRINT=$build_salt --action_env=PLATFORM_FINGERPRINT=$build_salt
bazel test //... --copt=-DPLATFORM_FINGERPRINT=$build_salt --action_env=PLATFORM_FINGERPRINT=$build_salt
bazel build //...
bazel test //...
mv -v bazel-bin/Mull-*.deb packages/
- name: Publish package
uses: devcontainers/[email protected]
Expand All @@ -47,20 +45,15 @@ jobs:
push: never
env: CLOUDSMITH_API_KEY
runCmd: |
build_salt=`ldd --version | sha256sum | awk ' {print $1} '`
bazel run publish \
--copt=-DPLATFORM_FINGERPRINT=$build_salt \
--action_env=PLATFORM_FINGERPRINT=$build_salt && exit 0
bazel run publish && exit 0

max_attempts=3
attempt=1
until [ "$attempt" -ge "$max_attempts" ]
do
echo "Attempt $attempt failed. Retrying..."
attempt=$((attempt+1))
bazel run publish \
--copt=-DPLATFORM_FINGERPRINT=$build_salt \
--action_env=PLATFORM_FINGERPRINT=$build_salt && exit 0
bazel run publish && exit 0
done
echo "All $max_attempts attempts failed."
exit 1
Expand Down
15 changes: 4 additions & 11 deletions .github/workflows/ci-Ubuntu_24.04-arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,8 @@ jobs:
configFile: ./.devcontainer/ubuntu_24.04-llvm-${{ matrix.LLVM_VERSION }}/devcontainer.json
runCmd: |
mkdir -p packages
# https://arrdem.com/2024/01/11/bazel-glibc/
build_salt=`ldd --version | sha256sum | awk ' {print $1} '`
bazel build //... --copt=-DPLATFORM_FINGERPRINT=$build_salt --action_env=PLATFORM_FINGERPRINT=$build_salt
bazel test //... --copt=-DPLATFORM_FINGERPRINT=$build_salt --action_env=PLATFORM_FINGERPRINT=$build_salt
bazel build //...
bazel test //...
mv -v bazel-bin/Mull-*.deb packages/
- name: Publish package
uses: devcontainers/[email protected]
Expand All @@ -47,20 +45,15 @@ jobs:
push: never
env: CLOUDSMITH_API_KEY
runCmd: |
build_salt=`ldd --version | sha256sum | awk ' {print $1} '`
bazel run publish \
--copt=-DPLATFORM_FINGERPRINT=$build_salt \
--action_env=PLATFORM_FINGERPRINT=$build_salt && exit 0
bazel run publish && exit 0

max_attempts=3
attempt=1
until [ "$attempt" -ge "$max_attempts" ]
do
echo "Attempt $attempt failed. Retrying..."
attempt=$((attempt+1))
bazel run publish \
--copt=-DPLATFORM_FINGERPRINT=$build_salt \
--action_env=PLATFORM_FINGERPRINT=$build_salt && exit 0
bazel run publish && exit 0
done
echo "All $max_attempts attempts failed."
exit 1
Expand Down
15 changes: 4 additions & 11 deletions .github/workflows/ci-Ubuntu_24.04-x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,8 @@ jobs:
configFile: ./.devcontainer/ubuntu_24.04-llvm-${{ matrix.LLVM_VERSION }}/devcontainer.json
runCmd: |
mkdir -p packages
# https://arrdem.com/2024/01/11/bazel-glibc/
build_salt=`ldd --version | sha256sum | awk ' {print $1} '`
bazel build //... --copt=-DPLATFORM_FINGERPRINT=$build_salt --action_env=PLATFORM_FINGERPRINT=$build_salt
bazel test //... --copt=-DPLATFORM_FINGERPRINT=$build_salt --action_env=PLATFORM_FINGERPRINT=$build_salt
bazel build //...
bazel test //...
mv -v bazel-bin/Mull-*.deb packages/
- name: Publish package
uses: devcontainers/[email protected]
Expand All @@ -47,20 +45,15 @@ jobs:
push: never
env: CLOUDSMITH_API_KEY
runCmd: |
build_salt=`ldd --version | sha256sum | awk ' {print $1} '`
bazel run publish \
--copt=-DPLATFORM_FINGERPRINT=$build_salt \
--action_env=PLATFORM_FINGERPRINT=$build_salt && exit 0
bazel run publish && exit 0

max_attempts=3
attempt=1
until [ "$attempt" -ge "$max_attempts" ]
do
echo "Attempt $attempt failed. Retrying..."
attempt=$((attempt+1))
bazel run publish \
--copt=-DPLATFORM_FINGERPRINT=$build_salt \
--action_env=PLATFORM_FINGERPRINT=$build_salt && exit 0
bazel run publish && exit 0
done
echo "All $max_attempts attempts failed."
exit 1
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ MODULE.bazel.lock
.mull-ci-cs-repo
.bazel.buildbuddy.rc
.bazel.compilation_mode.bazelrc
.bazel.build_salt.bazelrc
18 changes: 18 additions & 0 deletions infrastructure/build_salt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash

set -e

case $OSTYPE in
linux*)
echo $(cat /etc/os-release) $(ldd --version) | sha256sum | awk ' { print $1 } '
;;

darwin*)
echo $(sw_vers) | sha256sum | awk ' { print $1 } '
;;

*)
echo "Unkown OS type: $OSTYPE"
exit 1
;;
esac
15 changes: 4 additions & 11 deletions infrastructure/templates/github-actions/ci-linux.yml.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,8 @@ jobs:
configFile: ./.devcontainer/[[ OS_NAME_LOWER ]]_[[OS_VERSION]]-llvm-${{ matrix.LLVM_VERSION }}/devcontainer.json
runCmd: |
mkdir -p packages
# https://arrdem.com/2024/01/11/bazel-glibc/
build_salt=`ldd --version | sha256sum | awk ' {print $1} '`
bazel build //... --copt=-DPLATFORM_FINGERPRINT=$build_salt --action_env=PLATFORM_FINGERPRINT=$build_salt
bazel test //... --copt=-DPLATFORM_FINGERPRINT=$build_salt --action_env=PLATFORM_FINGERPRINT=$build_salt
bazel build //...
bazel test //...
mv -v bazel-bin/Mull-*.[[PACKAGE_EXTENSION]] packages/
- name: Publish package
uses: devcontainers/[email protected]
Expand All @@ -47,20 +45,15 @@ jobs:
push: never
env: CLOUDSMITH_API_KEY
runCmd: |
build_salt=`ldd --version | sha256sum | awk ' {print $1} '`
bazel run publish \
--copt=-DPLATFORM_FINGERPRINT=$build_salt \
--action_env=PLATFORM_FINGERPRINT=$build_salt && exit 0
bazel run publish && exit 0

max_attempts=3
attempt=1
until [ "$attempt" -ge "$max_attempts" ]
do
echo "Attempt $attempt failed. Retrying..."
attempt=$((attempt+1))
bazel run publish \
--copt=-DPLATFORM_FINGERPRINT=$build_salt \
--action_env=PLATFORM_FINGERPRINT=$build_salt && exit 0
bazel run publish && exit 0
done
echo "All $max_attempts attempts failed."
exit 1
Expand Down
Loading