From 60428fd0fcadf7f71b4b56c0b9b0ce26597ab4c2 Mon Sep 17 00:00:00 2001 From: Jonathan Rajotte Date: Fri, 3 Sep 2021 09:52:19 -0400 Subject: [PATCH] jjb: Add "Depends-on: userspace-rcu:" for lttng-tools While there we can remove some conditional actions based on `conf` "static" and "debug_rcu", since they are not defined for the gerrit job. It facilitate the condition handling for `depends-on` handling. Babeltrace is now always pulled and does not depends on any "$conf" conditional action. Since that for the remaining `conf` ("std", "agents", "no-ust") userspace_rcu is required, use conditional only to handle the `Depends-on` feature. Signed-off-by: Jonathan Rajotte --- jobs/lttng-tools.yaml | 90 ++++++------------------ scripts/lttng-tools/gerrit-depends-on.sh | 18 +++-- 2 files changed, 34 insertions(+), 74 deletions(-) diff --git a/jobs/lttng-tools.yaml b/jobs/lttng-tools.yaml index c72dd8f..e175f2b 100644 --- a/jobs/lttng-tools.yaml +++ b/jobs/lttng-tools.yaml @@ -316,6 +316,13 @@ !include-raw-escape: scripts/lttng-tools/gerrit-depends-on.sh - inject: properties-file: gerrit_custom_dependencies.properties + - copyartifact: + project: babeltrace_${{babeltrace_version}}_{buildtype}/arch=${{arch}},conf=std,build=std + which-build: last-successful + stable: false + filter: 'build/**' + target: 'deps' + do-not-fingerprint: true - conditional-step: condition-kind: and on-evaluation-failure: run @@ -324,7 +331,7 @@ condition-command: 'test -z "$GERRIT_DEP_LTTNG_UST"' - condition-kind: regex-match label: '$conf' - regex: (std|static|agents|debug-rcu) + regex: (std|agents) steps: - copyartifact: project: lttng-ust_${{GERRIT_BRANCH}}_{buildtype}/liburcu_version=${{liburcu_version}},arch=${{arch}},conf=${{conf}},build=std @@ -334,50 +341,9 @@ target: 'deps' do-not-fingerprint: true - conditional-step: - condition-kind: regex-match - label: '$conf' - regex: (std|static) - on-evaluation-failure: run - steps: - - copyartifact: - project: liburcu_${{liburcu_version}}_{buildtype}/arch=${{arch}},conf=${{conf}},build=std - which-build: last-successful - stable: false - filter: 'build/**' - target: 'deps' - do-not-fingerprint: true - - copyartifact: - project: babeltrace_${{babeltrace_version}}_{buildtype}/arch=${{arch}},conf=${{conf}},build=std - which-build: last-successful - stable: false - filter: 'build/**' - target: 'deps' - do-not-fingerprint: true - - conditional-step: - condition-kind: regex-match - label: '$conf' - regex: no-ust - on-evaluation-failure: run - steps: - - copyartifact: - project: liburcu_${{liburcu_version}}_{buildtype}/arch=${{arch}},conf=std,build=std - which-build: last-successful - stable: false - filter: 'build/**' - target: 'deps' - do-not-fingerprint: true - - copyartifact: - project: babeltrace_${{babeltrace_version}}_{buildtype}/arch=${{arch}},conf=std,build=std - which-build: last-successful - stable: false - filter: 'build/**' - target: 'deps' - do-not-fingerprint: true - - conditional-step: - condition-kind: regex-match - label: '$conf' - regex: (agents|relayd-only) + condition-kind: shell on-evaluation-failure: run + condition-command: 'test -z "$GERRIT_DEP_USERSPACE_RCU"' steps: - copyartifact: project: liburcu_${{liburcu_version}}_{buildtype}/arch=${{arch}},conf=std,build=std @@ -386,35 +352,19 @@ filter: 'build/**' target: 'deps' do-not-fingerprint: true - - copyartifact: - project: babeltrace_${{babeltrace_version}}_{buildtype}/arch=${{arch}},conf=std,build=std - which-build: last-successful - stable: false - filter: 'build/**' - target: 'deps' - do-not-fingerprint: true + - shell: + !include-raw-escape: scripts/lttng-tools/clean_processes_coredump.sh - conditional-step: - condition-kind: regex-match - label: '$conf' - regex: debug-rcu - on-evaluation-failure: run + condition-kind: shell + condition-command: 'test ! -z "$GERRIT_DEP_USERSPACE_RCU"' steps: - - copyartifact: - project: liburcu_${{liburcu_version}}_{buildtype}/arch=${{arch}},conf=${{conf}},build=std - which-build: last-successful - stable: false - filter: 'build/**' - target: 'deps' - do-not-fingerprint: true - - copyartifact: - project: babeltrace_${{babeltrace_version}}_{buildtype}/arch=${{arch}},conf=std,build=std - which-build: last-successful - stable: false - filter: 'build/**' - target: 'deps' - do-not-fingerprint: true + - shell: + !include-raw-escape: + - scripts/common/override-build-std.sh + - scripts/common/print.sh + - scripts/liburcu/build.sh - shell: - !include-raw-escape: scripts/lttng-tools/clean_processes_coredump.sh + !include-raw-escape: scripts/lttng-tools/gerrit-install-deps.sh - conditional-step: condition-kind: shell condition-command: 'test ! -z "$GERRIT_DEP_LTTNG_UST"' diff --git a/scripts/lttng-tools/gerrit-depends-on.sh b/scripts/lttng-tools/gerrit-depends-on.sh index 7f62f82..42b6225 100755 --- a/scripts/lttng-tools/gerrit-depends-on.sh +++ b/scripts/lttng-tools/gerrit-depends-on.sh @@ -28,7 +28,7 @@ gerrit_query="?o=CURRENT_REVISION&o=DOWNLOAD_COMMANDS" gerrit_json_query=".revisions[.current_revision].ref" gerrit_json_query_status=".status" -possible_depends_on="lttng-ust|lttng-modules" +possible_depends_on="lttng-ust|lttng-modules|userspace-rcu" re="Depends-on: (${possible_depends_on}): ([^'$'\n'']*)" property_file="${WORKSPACE}/gerrit_custom_dependencies.properties" @@ -84,7 +84,7 @@ git rev-list --format=%B --max-count=1 HEAD | while read -r line; do ref="refs/heads/master" elif [ "$change_status" == "ABANDONED" ]; then # We have a situation where the "HEAD" commit for feature branch are - # not merged and abandonned. Default to the master branch and hope + # not merged and abandoned. Default to the master branch and hope # for the best. This is far from ideal but we need might also need # to find a better way to handle feature branch here. In the # meantime use master for such cases. @@ -92,8 +92,18 @@ git rev-list --format=%B --max-count=1 HEAD | while read -r line; do ref="refs/heads/master" fi - git clone "${gerrit_url}/${project}" "$WORKSPACE/src/$project" - pushd "$WORKSPACE/src/$project" + # The build.sh script from userspace-rcu expects the source to be located in + # `liburcu` instead of userspace-rcu. Accommodate for this here. + if [ "$project" = "userspace-rcu" ]; then + clone_directory="liburcu" + else + clone_directory="$project" + fi + + clone_directory="$WORKSPACE/src/$clone_directory" + + git clone "${gerrit_url}/${project}" "$clone_directory" + pushd "$clone_directory" git fetch "${gerrit_url}/${project}" "$ref" git checkout FETCH_HEAD popd -- 2.34.1