Skip to content

Commit

Permalink
Make stamping reproducible in CI
Browse files Browse the repository at this point in the history
Signed-off-by: Amaury Pouly <[email protected]>
  • Loading branch information
pamaury committed Jan 17, 2024
1 parent ba29580 commit 00dddfb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ci/bazelisk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ fi
# See #14695 for more information.
echo "build --remote_default_exec_properties=OSVersion=\"$(lsb_release -ds)\"" >> "${GCP_BAZELRC}"

# Override workspace status in CI.
# NOTE: it seems the first instance of --workspace_status_command has precedence so this
# will override the one in .bazelrc, but this behaviour does not seem to be documented.
echo "build --workspace_status_command=ci/scripts/get_workspace_status.sh" >> "${GCP_BAZELRC}"

"$(dirname $0)"/../bazelisk.sh \
--bazelrc="${GCP_BAZELRC}" \
--bazelrc="$(dirname $0)"/.bazelrc \
Expand Down
13 changes: 13 additions & 0 deletions ci/scripts/get_workspace_status.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0

# This script is passed to bazel's `--workspace_status_command` to generate
# the workspace status. To ensure reproducible builds, we output constant
# values.

echo "BUILD_GIT_VERSION OpenTitanCI"
echo "BUILD_SCM_REVISION 123456789"
echo "BUILD_SCM_STATUS modified"
echo "BUILD_TIMESTAMP 315532800"

0 comments on commit 00dddfb

Please sign in to comment.