Skip to content

Commit a23ef06

Browse files
committed
Add build salt
1 parent 9ec9660 commit a23ef06

File tree

13 files changed

+64
-99
lines changed

13 files changed

+64
-99
lines changed

.bazelrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ common --test_output=errors
22

33
try-import .bazel.buildbuddy.rc
44
try-import .bazel.compilation_mode.bazelrc
5+
try-import .bazel.build_salt.bazelrc

.github/actions/setup-bazel-cache/action.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,11 @@ runs:
2121
shell: bash
2222
run: |
2323
echo "common --compilation_mode opt" > .bazel.compilation_mode.bazelrc
24+
# https://arrdem.com/2024/01/11/bazel-glibc/
25+
- name: Add build salt
26+
shell: bash
27+
run: |
28+
SALT=$(./infrastructure/build_salt.sh)
29+
echo "common --copt=-DPLATFORM_FINGERPRINT=$SALT" > .bazel.build_salt.bazelrc
30+
echo "common --action_env=-DPLATFORM_FINGERPRINT=$SALT" > .bazel.build_salt.bazelrc
31+
cat .bazel.build_salt.bazelrc

.github/workflows/ci-RHEL_10.0-arm64.yml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,8 @@ jobs:
3333
configFile: ./.devcontainer/rhel_10.0-llvm-${{ matrix.LLVM_VERSION }}/devcontainer.json
3434
runCmd: |
3535
mkdir -p packages
36-
# https://arrdem.com/2024/01/11/bazel-glibc/
37-
build_salt=`ldd --version | sha256sum | awk ' {print $1} '`
38-
bazel build //... --copt=-DPLATFORM_FINGERPRINT=$build_salt --action_env=PLATFORM_FINGERPRINT=$build_salt
39-
bazel test //... --copt=-DPLATFORM_FINGERPRINT=$build_salt --action_env=PLATFORM_FINGERPRINT=$build_salt
36+
bazel build //...
37+
bazel test //...
4038
mv -v bazel-bin/Mull-*.rpm packages/
4139
- name: Publish package
4240
uses: devcontainers/[email protected]
@@ -47,20 +45,15 @@ jobs:
4745
push: never
4846
env: CLOUDSMITH_API_KEY
4947
runCmd: |
50-
build_salt=`ldd --version | sha256sum | awk ' {print $1} '`
51-
bazel run publish \
52-
--copt=-DPLATFORM_FINGERPRINT=$build_salt \
53-
--action_env=PLATFORM_FINGERPRINT=$build_salt && exit 0
48+
bazel run publish && exit 0
5449
5550
max_attempts=3
5651
attempt=1
5752
until [ "$attempt" -ge "$max_attempts" ]
5853
do
5954
echo "Attempt $attempt failed. Retrying..."
6055
attempt=$((attempt+1))
61-
bazel run publish \
62-
--copt=-DPLATFORM_FINGERPRINT=$build_salt \
63-
--action_env=PLATFORM_FINGERPRINT=$build_salt && exit 0
56+
bazel run publish && exit 0
6457
done
6558
echo "All $max_attempts attempts failed."
6659
exit 1

.github/workflows/ci-RHEL_10.0-x86_64.yml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,8 @@ jobs:
3333
configFile: ./.devcontainer/rhel_10.0-llvm-${{ matrix.LLVM_VERSION }}/devcontainer.json
3434
runCmd: |
3535
mkdir -p packages
36-
# https://arrdem.com/2024/01/11/bazel-glibc/
37-
build_salt=`ldd --version | sha256sum | awk ' {print $1} '`
38-
bazel build //... --copt=-DPLATFORM_FINGERPRINT=$build_salt --action_env=PLATFORM_FINGERPRINT=$build_salt
39-
bazel test //... --copt=-DPLATFORM_FINGERPRINT=$build_salt --action_env=PLATFORM_FINGERPRINT=$build_salt
36+
bazel build //...
37+
bazel test //...
4038
mv -v bazel-bin/Mull-*.rpm packages/
4139
- name: Publish package
4240
uses: devcontainers/[email protected]
@@ -47,20 +45,15 @@ jobs:
4745
push: never
4846
env: CLOUDSMITH_API_KEY
4947
runCmd: |
50-
build_salt=`ldd --version | sha256sum | awk ' {print $1} '`
51-
bazel run publish \
52-
--copt=-DPLATFORM_FINGERPRINT=$build_salt \
53-
--action_env=PLATFORM_FINGERPRINT=$build_salt && exit 0
48+
bazel run publish && exit 0
5449
5550
max_attempts=3
5651
attempt=1
5752
until [ "$attempt" -ge "$max_attempts" ]
5853
do
5954
echo "Attempt $attempt failed. Retrying..."
6055
attempt=$((attempt+1))
61-
bazel run publish \
62-
--copt=-DPLATFORM_FINGERPRINT=$build_salt \
63-
--action_env=PLATFORM_FINGERPRINT=$build_salt && exit 0
56+
bazel run publish && exit 0
6457
done
6558
echo "All $max_attempts attempts failed."
6659
exit 1

.github/workflows/ci-RHEL_9.6-arm64.yml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,8 @@ jobs:
3333
configFile: ./.devcontainer/rhel_9.6-llvm-${{ matrix.LLVM_VERSION }}/devcontainer.json
3434
runCmd: |
3535
mkdir -p packages
36-
# https://arrdem.com/2024/01/11/bazel-glibc/
37-
build_salt=`ldd --version | sha256sum | awk ' {print $1} '`
38-
bazel build //... --copt=-DPLATFORM_FINGERPRINT=$build_salt --action_env=PLATFORM_FINGERPRINT=$build_salt
39-
bazel test //... --copt=-DPLATFORM_FINGERPRINT=$build_salt --action_env=PLATFORM_FINGERPRINT=$build_salt
36+
bazel build //...
37+
bazel test //...
4038
mv -v bazel-bin/Mull-*.rpm packages/
4139
- name: Publish package
4240
uses: devcontainers/[email protected]
@@ -47,20 +45,15 @@ jobs:
4745
push: never
4846
env: CLOUDSMITH_API_KEY
4947
runCmd: |
50-
build_salt=`ldd --version | sha256sum | awk ' {print $1} '`
51-
bazel run publish \
52-
--copt=-DPLATFORM_FINGERPRINT=$build_salt \
53-
--action_env=PLATFORM_FINGERPRINT=$build_salt && exit 0
48+
bazel run publish && exit 0
5449
5550
max_attempts=3
5651
attempt=1
5752
until [ "$attempt" -ge "$max_attempts" ]
5853
do
5954
echo "Attempt $attempt failed. Retrying..."
6055
attempt=$((attempt+1))
61-
bazel run publish \
62-
--copt=-DPLATFORM_FINGERPRINT=$build_salt \
63-
--action_env=PLATFORM_FINGERPRINT=$build_salt && exit 0
56+
bazel run publish && exit 0
6457
done
6558
echo "All $max_attempts attempts failed."
6659
exit 1

.github/workflows/ci-RHEL_9.6-x86_64.yml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,8 @@ jobs:
3333
configFile: ./.devcontainer/rhel_9.6-llvm-${{ matrix.LLVM_VERSION }}/devcontainer.json
3434
runCmd: |
3535
mkdir -p packages
36-
# https://arrdem.com/2024/01/11/bazel-glibc/
37-
build_salt=`ldd --version | sha256sum | awk ' {print $1} '`
38-
bazel build //... --copt=-DPLATFORM_FINGERPRINT=$build_salt --action_env=PLATFORM_FINGERPRINT=$build_salt
39-
bazel test //... --copt=-DPLATFORM_FINGERPRINT=$build_salt --action_env=PLATFORM_FINGERPRINT=$build_salt
36+
bazel build //...
37+
bazel test //...
4038
mv -v bazel-bin/Mull-*.rpm packages/
4139
- name: Publish package
4240
uses: devcontainers/[email protected]
@@ -47,20 +45,15 @@ jobs:
4745
push: never
4846
env: CLOUDSMITH_API_KEY
4947
runCmd: |
50-
build_salt=`ldd --version | sha256sum | awk ' {print $1} '`
51-
bazel run publish \
52-
--copt=-DPLATFORM_FINGERPRINT=$build_salt \
53-
--action_env=PLATFORM_FINGERPRINT=$build_salt && exit 0
48+
bazel run publish && exit 0
5449
5550
max_attempts=3
5651
attempt=1
5752
until [ "$attempt" -ge "$max_attempts" ]
5853
do
5954
echo "Attempt $attempt failed. Retrying..."
6055
attempt=$((attempt+1))
61-
bazel run publish \
62-
--copt=-DPLATFORM_FINGERPRINT=$build_salt \
63-
--action_env=PLATFORM_FINGERPRINT=$build_salt && exit 0
56+
bazel run publish && exit 0
6457
done
6558
echo "All $max_attempts attempts failed."
6659
exit 1

.github/workflows/ci-Ubuntu_22.04-arm64.yml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,8 @@ jobs:
3333
configFile: ./.devcontainer/ubuntu_22.04-llvm-${{ matrix.LLVM_VERSION }}/devcontainer.json
3434
runCmd: |
3535
mkdir -p packages
36-
# https://arrdem.com/2024/01/11/bazel-glibc/
37-
build_salt=`ldd --version | sha256sum | awk ' {print $1} '`
38-
bazel build //... --copt=-DPLATFORM_FINGERPRINT=$build_salt --action_env=PLATFORM_FINGERPRINT=$build_salt
39-
bazel test //... --copt=-DPLATFORM_FINGERPRINT=$build_salt --action_env=PLATFORM_FINGERPRINT=$build_salt
36+
bazel build //...
37+
bazel test //...
4038
mv -v bazel-bin/Mull-*.deb packages/
4139
- name: Publish package
4240
uses: devcontainers/[email protected]
@@ -47,20 +45,15 @@ jobs:
4745
push: never
4846
env: CLOUDSMITH_API_KEY
4947
runCmd: |
50-
build_salt=`ldd --version | sha256sum | awk ' {print $1} '`
51-
bazel run publish \
52-
--copt=-DPLATFORM_FINGERPRINT=$build_salt \
53-
--action_env=PLATFORM_FINGERPRINT=$build_salt && exit 0
48+
bazel run publish && exit 0
5449
5550
max_attempts=3
5651
attempt=1
5752
until [ "$attempt" -ge "$max_attempts" ]
5853
do
5954
echo "Attempt $attempt failed. Retrying..."
6055
attempt=$((attempt+1))
61-
bazel run publish \
62-
--copt=-DPLATFORM_FINGERPRINT=$build_salt \
63-
--action_env=PLATFORM_FINGERPRINT=$build_salt && exit 0
56+
bazel run publish && exit 0
6457
done
6558
echo "All $max_attempts attempts failed."
6659
exit 1

.github/workflows/ci-Ubuntu_22.04-x86_64.yml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,8 @@ jobs:
3333
configFile: ./.devcontainer/ubuntu_22.04-llvm-${{ matrix.LLVM_VERSION }}/devcontainer.json
3434
runCmd: |
3535
mkdir -p packages
36-
# https://arrdem.com/2024/01/11/bazel-glibc/
37-
build_salt=`ldd --version | sha256sum | awk ' {print $1} '`
38-
bazel build //... --copt=-DPLATFORM_FINGERPRINT=$build_salt --action_env=PLATFORM_FINGERPRINT=$build_salt
39-
bazel test //... --copt=-DPLATFORM_FINGERPRINT=$build_salt --action_env=PLATFORM_FINGERPRINT=$build_salt
36+
bazel build //...
37+
bazel test //...
4038
mv -v bazel-bin/Mull-*.deb packages/
4139
- name: Publish package
4240
uses: devcontainers/[email protected]
@@ -47,20 +45,15 @@ jobs:
4745
push: never
4846
env: CLOUDSMITH_API_KEY
4947
runCmd: |
50-
build_salt=`ldd --version | sha256sum | awk ' {print $1} '`
51-
bazel run publish \
52-
--copt=-DPLATFORM_FINGERPRINT=$build_salt \
53-
--action_env=PLATFORM_FINGERPRINT=$build_salt && exit 0
48+
bazel run publish && exit 0
5449
5550
max_attempts=3
5651
attempt=1
5752
until [ "$attempt" -ge "$max_attempts" ]
5853
do
5954
echo "Attempt $attempt failed. Retrying..."
6055
attempt=$((attempt+1))
61-
bazel run publish \
62-
--copt=-DPLATFORM_FINGERPRINT=$build_salt \
63-
--action_env=PLATFORM_FINGERPRINT=$build_salt && exit 0
56+
bazel run publish && exit 0
6457
done
6558
echo "All $max_attempts attempts failed."
6659
exit 1

.github/workflows/ci-Ubuntu_24.04-arm64.yml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,8 @@ jobs:
3333
configFile: ./.devcontainer/ubuntu_24.04-llvm-${{ matrix.LLVM_VERSION }}/devcontainer.json
3434
runCmd: |
3535
mkdir -p packages
36-
# https://arrdem.com/2024/01/11/bazel-glibc/
37-
build_salt=`ldd --version | sha256sum | awk ' {print $1} '`
38-
bazel build //... --copt=-DPLATFORM_FINGERPRINT=$build_salt --action_env=PLATFORM_FINGERPRINT=$build_salt
39-
bazel test //... --copt=-DPLATFORM_FINGERPRINT=$build_salt --action_env=PLATFORM_FINGERPRINT=$build_salt
36+
bazel build //...
37+
bazel test //...
4038
mv -v bazel-bin/Mull-*.deb packages/
4139
- name: Publish package
4240
uses: devcontainers/[email protected]
@@ -47,20 +45,15 @@ jobs:
4745
push: never
4846
env: CLOUDSMITH_API_KEY
4947
runCmd: |
50-
build_salt=`ldd --version | sha256sum | awk ' {print $1} '`
51-
bazel run publish \
52-
--copt=-DPLATFORM_FINGERPRINT=$build_salt \
53-
--action_env=PLATFORM_FINGERPRINT=$build_salt && exit 0
48+
bazel run publish && exit 0
5449
5550
max_attempts=3
5651
attempt=1
5752
until [ "$attempt" -ge "$max_attempts" ]
5853
do
5954
echo "Attempt $attempt failed. Retrying..."
6055
attempt=$((attempt+1))
61-
bazel run publish \
62-
--copt=-DPLATFORM_FINGERPRINT=$build_salt \
63-
--action_env=PLATFORM_FINGERPRINT=$build_salt && exit 0
56+
bazel run publish && exit 0
6457
done
6558
echo "All $max_attempts attempts failed."
6659
exit 1

.github/workflows/ci-Ubuntu_24.04-x86_64.yml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,8 @@ jobs:
3333
configFile: ./.devcontainer/ubuntu_24.04-llvm-${{ matrix.LLVM_VERSION }}/devcontainer.json
3434
runCmd: |
3535
mkdir -p packages
36-
# https://arrdem.com/2024/01/11/bazel-glibc/
37-
build_salt=`ldd --version | sha256sum | awk ' {print $1} '`
38-
bazel build //... --copt=-DPLATFORM_FINGERPRINT=$build_salt --action_env=PLATFORM_FINGERPRINT=$build_salt
39-
bazel test //... --copt=-DPLATFORM_FINGERPRINT=$build_salt --action_env=PLATFORM_FINGERPRINT=$build_salt
36+
bazel build //...
37+
bazel test //...
4038
mv -v bazel-bin/Mull-*.deb packages/
4139
- name: Publish package
4240
uses: devcontainers/[email protected]
@@ -47,20 +45,15 @@ jobs:
4745
push: never
4846
env: CLOUDSMITH_API_KEY
4947
runCmd: |
50-
build_salt=`ldd --version | sha256sum | awk ' {print $1} '`
51-
bazel run publish \
52-
--copt=-DPLATFORM_FINGERPRINT=$build_salt \
53-
--action_env=PLATFORM_FINGERPRINT=$build_salt && exit 0
48+
bazel run publish && exit 0
5449
5550
max_attempts=3
5651
attempt=1
5752
until [ "$attempt" -ge "$max_attempts" ]
5853
do
5954
echo "Attempt $attempt failed. Retrying..."
6055
attempt=$((attempt+1))
61-
bazel run publish \
62-
--copt=-DPLATFORM_FINGERPRINT=$build_salt \
63-
--action_env=PLATFORM_FINGERPRINT=$build_salt && exit 0
56+
bazel run publish && exit 0
6457
done
6558
echo "All $max_attempts attempts failed."
6659
exit 1

0 commit comments

Comments
 (0)