Skip to content

Commit

Permalink
Publish execution logs on unix platforms (#10194)
Browse files Browse the repository at this point in the history
Even with the cache retries something still doesn’t seem to be cached
quite like I expect. I can’t really debug this without exec logs so
this PR starts publishing those.

changelog_begin
changelog_end
  • Loading branch information
cocreature authored Jul 7, 2021
1 parent 4269345 commit 2326d42
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 4 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ execution_log_postfix=${1:-}
export LC_ALL=en_US.UTF-8

ARTIFACT_DIRS="${BUILD_ARTIFACTSTAGINGDIRECTORY:-$PWD}"
mkdir -p "${ARTIFACT_DIRS}/logs"

tag_filter=""
if [[ "$execution_log_postfix" == "_Darwin" ]]; then
Expand All @@ -33,7 +34,8 @@ bazel build //... \
--profile build-profile.json \
--experimental_profile_include_target_label \
--build_event_json_file build-events.json \
--build_event_publish_all_actions
--build_event_publish_all_actions \
--experimental_execution_log_file "$ARTIFACT_DIRS/logs/build_execution${execution_log_postfix}.log"

# Set up a shared PostgreSQL instance.
export POSTGRESQL_ROOT_DIR="${TMPDIR:-/tmp}/daml/postgresql"
Expand Down Expand Up @@ -77,7 +79,7 @@ bazel test //... \
--experimental_profile_include_target_label \
--build_event_json_file test-events.json \
--build_event_publish_all_actions \
--experimental_execution_log_file "$ARTIFACT_DIRS/test_execution${execution_log_postfix}.log"
--experimental_execution_log_file "$ARTIFACT_DIRS/logs/test_execution${execution_log_postfix}.log"

# Make sure that Bazel query works.
bazel query 'deps(//...)' >/dev/null
Expand Down
6 changes: 6 additions & 0 deletions ci/build-unix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ steps:
DAML_SDK_RELEASE_VERSION: ${{parameters.release_tag}}
DAML_SCALA_VERSION: ${{parameters.scala_version}}

- task: PublishBuildArtifacts@1
condition: succeededOrFailed()
inputs:
pathtoPublish: '$(Build.StagingDirectory)/logs'
artifactName: 'Bazel Logs'

- task: PublishBuildArtifacts@1
condition: failed()
displayName: 'Publish the bazel test logs'
Expand Down

0 comments on commit 2326d42

Please sign in to comment.