Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chronos: Some fixes. #12995

Merged
merged 2 commits into from
Jan 31, 2025
Merged
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
26 changes: 11 additions & 15 deletions infra/experimental/chronos/build_cache_local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,17 +97,16 @@ REPLAY_WORKED=
# If this step is successful, then the process can exit as it's ready.
if [[ "$executables_replay" == "$executables_vanilla" ]]
then
echo "Replay worked"
echo "Vanilla compile time: ${B_TIME}"
echo "Replay compile time: ${R_TIME}"

REPLAY_WORKED=1

if [ -z "${RUN_ALL+1}" ]; then
echo "${_PROJECT}: Replay worked."
echo "${_PROJECT}: Compile times: Vanilla=${B_TIME}; Replay=${R_TIME};"
exit 0
fi
else
echo "Replay did not work"
echo "${_PROJECT}: Replay did not work"
R_TIME="N/A"
fi

# Step 8: prepare Dockerfile for ccache
Expand Down Expand Up @@ -145,25 +144,22 @@ executables_ccache="$(find ./build/out/${_PROJECT}/ -executable -type f | sort)"
# Step 12: validate the ccache builds are successful
if [[ "$executables_ccache" == "$executables_vanilla" ]]
then
echo "Vanilla compile time: ${B_TIME}"
if [[ "$executables_replay" == "$executables_vanilla" ]]
then
echo "Replay worked"
echo "Replay compile time: ${R_TIME}"
fi
echo "${_PROJECT}: Compile times: Vanilla=${B_TIME}; Replay=${R_TIME}; CCache=${A_TIME};"

echo "Ccache compile time: ${A_TIME}"
if [[ -z "${REPLAY_WORKED}" || ${R_TIME} -gt ${A_TIME} ]]; then
if [ ${R_TIME} -gt ${A_TIME} ]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it a typo to check ${R_TIME} -gt ${A_TIME} twice?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to log this specific case, which is why I'm repeating it here.

echo "Replay was slower than ccache."
fi

if [ -z "${REPLAY_WORKED}" ]; then
# Replay didn't work, so make the default "cached" image use the ccache one.
# Replay didn't work or was slower, so make the default "cached" image use the ccache one.
docker image tag \
$CCACHE_IMAGE_NAME \
$FINAL_IMAGE_NAME
fi

exit 0
else
echo "Replay and ccaching did not work."
echo "${_PROJECT}: Replay and ccaching did not work."
exit 1
fi

Loading