blob: 8a28e6428bc27c8eddf3a402ee79a324ea78ac08 [file] [log] [blame]
Leonardo Sandoval9dfdd1b2020-08-06 17:08:11 -05001#!/usr/bin/env bash
Fathi Boudra422bf772019-12-02 11:10:16 +02002#
laurenw-arme78b1292024-03-28 12:57:42 -05003# Copyright (c) 2019-2024, Arm Limited. All rights reserved.
Fathi Boudra422bf772019-12-02 11:10:16 +02004#
5# SPDX-License-Identifier: BSD-3-Clause
6#
7
8# This file is meant to be SOURCED only after setting $ci_root. $ci_root must be
9# the absolute path to the root of the CI repository
10#
11# A convenient way to set ci_root from the calling script like this:
12# ci_root="$(readlink -f "$(dirname "$0")/..")"
13#
14
15# Accept root of CI location from $CI_ROOT or $ci_root, in that order
16ci_root="${ci_root:-$CI_ROOT}"
17ci_root="${ci_root:?}"
18
Harrison Mutai9b099892023-01-13 11:34:36 +000019source "${ci_root}/lava_utils.sh"
20
Sandrine Bailleuxaaaffe02020-08-07 11:15:55 +020021# Optionally source a file containing environmental settings.
22if [ -n "$host_env" ]; then
23 source "$host_env"
24else
Saheer Babu971859f2025-05-20 21:03:33 +010025 if echo "$JENKINS_PUBLIC_URL" | grep -q "staging"; then
26 source "$ci_root/openci-staging-env.sh"
27 else
Saheer Babu2206b872025-02-10 14:32:54 +000028 source "$ci_root/openci-env.sh"
Sandrine Bailleuxaaaffe02020-08-07 11:15:55 +020029 fi
30fi
31
Fathi Boudra422bf772019-12-02 11:10:16 +020032# Storage area to host toolchains, rootfs, tools, models, binaries, etc...
33nfs_volume="${nfs_volume:-$NFS_VOLUME}"
34nfs_volume="${nfs_volume:?}"
35
36# Override workspace for local runs
37workspace="${workspace:-$WORKSPACE}"
38workspace="${workspace:?}"
39workspace="$(readlink -f "$workspace")"
40artefacts="$workspace/artefacts"
41
42# pushd and popd outputs the directory stack every time, which could be
43# confusing when shown on the log. Suppress its output.
44pushd() {
45 builtin pushd "$1" &>/dev/null
46}
47popd() {
48 builtin popd &>/dev/null
49}
50
51# Copy a file to the $archive directory
52archive_file() {
53 local f out target md5
54 f="${1:?}"
55
56 out="${archive:?}"
57 [ ! -d "$out" ] && die "$out is not a directory"
58
59 target="$out/$(basename $f)"
60 if [ -f "$target" ]; then
61 # Prevent same file error
62 if [ "$(stat --format=%i "$target")" = \
63 "$(stat --format=%i "$f")" ]; then
64 return
65 fi
66 fi
67
68 md5="$(md5sum "$f" | awk '{print $1}')"
69 cp -t "$out" "$f"
70 echo "Archived: $f (md5: $md5)"
71}
72
73die() {
74 [ "$1" ] && echo "$1" >&2
75 exit 1
76}
77
78# Emit environment variables for the purpose of sourcing from shells and as
79# Jenkins property files. Whether the RHS is quoted depends on "$quote".
80emit_env() {
81 local env_file="${env_file:?}"
82 local var="${1:?}"
83
84 # Value parameter is mandatory, but allow for it to be empty
85 local val="${2?}"
86
87 if upon "$quote"; then
88 val="\"$val\""
89 else
90 # If RHS is not required to be quoted, any white space in it
91 # won't go well with a shell sourcing this file.
92 if echo "$var" | grep -q '\s'; then
93 die "$var: value '$val' has white space"
94 fi
95 fi
96
97 echo "$var=$val" >> "$env_file"
98}
99
Fathi Boudra422bf772019-12-02 11:10:16 +0200100fetch_directory() {
101 local base="$(basename "${url:?}")"
102 local sa
103
Fathi Boudradd31e7b2020-01-29 15:44:42 +0200104 case "${url}" in
105 http*://*)
106 # Have exactly one trailing /
107 local modified_url="$(echo "${url}" | sed 's#/*$##')/"
Fathi Boudra422bf772019-12-02 11:10:16 +0200108
Fathi Boudradd31e7b2020-01-29 15:44:42 +0200109 # Figure out the number of components between hostname and the
110 # final one
111 local cut_dirs="$(echo "$modified_url" | awk -F/ '{print NF - 5}')"
112 sa="${saveas:-$base}"
113 echo "Fetch: $modified_url -> $sa"
laurenw-arm2d62c712022-09-13 14:27:15 -0500114 wget -rq -nH --cut-dirs="$cut_dirs" --no-parent -e robots=off \
Fathi Boudradd31e7b2020-01-29 15:44:42 +0200115 --reject="index.html*" "$modified_url"
116 if [ "$sa" != "$base" ]; then
117 mv "$base" "$sa"
118 fi
119 ;;
120 file://*)
121 sa="${saveas:-.}"
122 echo "Fetch: ${url} -> $sa"
123 cp -r "${url#file://}" "$sa"
124 ;;
125 *)
126 sa="${saveas:-.}"
127 echo "Fetch: ${url} -> $sa"
128 cp -r "${url}" "$sa"
129 ;;
130 esac
Fathi Boudra422bf772019-12-02 11:10:16 +0200131}
132
133fetch_file() {
134 local url="${url:?}"
135 local sa
136 local saveas
137
138 if is_url "$url"; then
Fathi Boudra422bf772019-12-02 11:10:16 +0200139 saveas="${saveas-"$(basename "$url")"}"
Sandrine Bailleux3da4bd12020-08-06 16:18:36 +0200140 sa="${saveas+-o $saveas}"
Fathi Boudra422bf772019-12-02 11:10:16 +0200141 echo "Fetch: $url -> $saveas"
142 # Use curl to support file protocol
Paul Sokolovsky532a4882023-05-22 15:50:04 +0300143 curl --fail --no-progress-meter --connect-timeout 10 --retry 6 -LS $sa "$url"
Fathi Boudra422bf772019-12-02 11:10:16 +0200144 else
145 sa="${saveas-.}"
146 echo "Fetch: $url -> $sa"
147 cp "$url" "$sa"
148 fi
149}
150
Harrison Mutaia197d5d2022-09-15 13:45:21 +0100151fetch_and_archive() {
152 url=${url:?}
153 filename=${filename:-basename $url}
154
155 url="$url" saveas="$filename" fetch_file
156 archive_file "$filename"
157}
158
159filter_artefacts(){
160 local model_param_file="${model_param_file-$archive/model_params}"
161
162 # Bash doesn't have array values, we have to create references to the
163 # array of artefacts and the artefact filters.
164 declare -ga "$1"
165 declare -n artefacts="$1"
166 declare -n filters="$2"
167
168 for artefact in "${!filters[@]}"; do
169 if grep -E -q "${filters[${artefact}]}" "$model_param_file"; then
170 artefacts+=("${artefact}")
171 fi
172 done
173}
174
Harrison Mutaia197d5d2022-09-15 13:45:21 +0100175# Generate link to an archived binary.
176gen_bin_url() {
177 local bin_mode="${bin_mode:?}"
178 local bin="${1:?}"
179
180 if upon "$jenkins_run"; then
181 echo "$jenkins_url/job/$JOB_NAME/$BUILD_NUMBER/artifact/artefacts/$bin_mode/$bin"
182 else
183 echo "file://$workspace/artefacts/$bin_mode/$bin"
184 fi
185}
186
Harrison Mutaid993ce12023-03-27 13:21:28 +0100187get_boot_image() {
188 local image=${image:?}
189 local type=${type:?}
Harrison Mutaia197d5d2022-09-15 13:45:21 +0100190
Harrison Mutaid993ce12023-03-27 13:21:28 +0100191 declare -n image_list=${image_list-${image}_list}
192
193 local url="${image_list[${type}]}"
194
195 url="${url:?}" filename="${image}.bin" fetch_and_archive
Harrison Mutaia197d5d2022-09-15 13:45:21 +0100196}
197
Harrison Mutaid993ce12023-03-27 13:21:28 +0100198get_boot_image_from_fip() {(
199 local url="${url:?}"
200 local image="${image:?}"
201 local output_name="${output_name-bl32.bin}"
202
203 cd "$(mktempdir)"
204
205 extract_fip "$url"
206 mv "$image" "$output_name"
207 archive_file "$output_name"
208)}
209
Chris Kay03ffbe72022-11-17 18:53:50 +0000210# Get the path to the run environment variables file.
211#
212# Run environment variables are the test-specific environment variables
213# configured by the CI's test configuration.
214#
215# Usage: get_run_env_path <archive>
216get_run_env_path() {
217 echo "${1:?}/run/env"
218}
219
220# Get a run environment variable.
221#
222# Run environment variables are the test-specific environment variables
223# configured by the CI's test configuration.
224#
225# Usage: get_run_env <archive> <variable> [default]
226get_run_env() {
227 if [ -f "$(get_run_env_path "${1:?}")" ] && [ ! -v "${2:?}" ]; then
228 . "$(get_run_env_path "${1:?}")"
229 fi
230
231 echo "${!2:-${3}}"
232}
233
234# Get the number of UARTs configured by the current test configuration. This
235# defaults to `4`.
236#
237# Usage: get_num_uarts <archive> [default]
238get_num_uarts() {
239 local default=4
240
241 get_run_env "${1:?}" num_uarts "${2-${default}}"
242}
243
244# Get the ports script configured by the current test configuration. This
245# defaults to `script/default-ports-script.awk`.
246#
247# Usage: get_ports_script <archive> [default]
248get_ports_script() {
249 local default="${ci_root}/script/default-ports-script.awk"
250
251 get_run_env "${1:?}" ports_script "${2-${default}}"
252}
253
254# Get the primary UART configured by the current test configuration. This
255# defaults to `0`.
256#
257# Usage: get_primary_uart <archive> [default]
258get_primary_uart() {
259 local default=0
260
261 get_run_env "${1:?}" primary_uart "${2-${default}}"
262}
263
264# Get the payload UART configured by the current test configuration. This
265# defaults to the primary UART.
266#
267# Usage: get_payload_uart <archive> [default]
268get_payload_uart() {
269 local default="$(get_primary_uart "${1:?}")"
270
271 get_run_env "${1:?}" payload_uart "${2-${default}}"
272}
273
274# Get the path to a UART's environment variable directory.
275#
276# UART environment variables are the UART-specific environment variables
277# configured by the CI's test configuration.
278#
279# Usage: get_uart_env_path <archive> <uart>
280get_uart_env_path() {
281 echo "${1:?}/run/uart${2:?}"
282}
283
284# Get a UART environment variable.
285#
286# UART environment variables are the UART-specific environment variables
287# configured by the CI's test configuration.
288#
289# Usage: get_uart_env <archive> <uart> <variable> [default]
290get_uart_env() {
291 if [ ! -v "${3:?}" ] && [ -f "$(get_uart_env_path "${1:?}" "${2:?}")/${3:?}" ]; then
292 cat "$(get_uart_env_path "${1:?}" "${2:?}")/${3:?}"
293 else
Chris Kayfab6edc2022-11-17 19:18:32 +0000294 echo "${!3-${4}}"
Chris Kay03ffbe72022-11-17 18:53:50 +0000295 fi
296}
297
298# Get the path to the Expect script for a given UART. This defaults to nothing.
299#
300# Usage: get_uart_expect_script <archive> <uart> [default]
301get_uart_expect_script() {
302 local default=
303
304 get_uart_env "${1:?}" "${2:?}" expect "${3-${default}}"
305}
306
307# Get the FVP port for a given UART. This defaults to `5000 + ${uart}`.
308#
309# Usage: get_uart_port <archive> <uart> [default]
310get_uart_port() {
311 local default="$(( 5000 + "${2:?}" ))"
312
313 get_uart_env "${1:?}" "${2:?}" port "${3-${default}}"
314}
315
Chris Kay24d039f2022-11-23 12:53:30 +0000316# Set a UART environment variable.
317#
318# UART environment variables are the UART-specific environment variables
319# configured by the CI's test configuration.
320#
321# Usage: set_uart_env <archive> <uart> <variable> <value>
322set_uart_env() {
323 local path="$(get_uart_env_path "${1:?}" "${2:?}")"
324
325 mkdir -p "${path}" && \
326 echo "${4:?}" > "${path}/${3:?}"
327}
328
329# Set the FVP port for a given UART.
330#
331# Usage: set_uart_port <archive> <uart> <port>
332set_uart_port() {
333 set_uart_env "${1:?}" "${2:?}" port "${3:?}"
334}
335
Fathi Boudra422bf772019-12-02 11:10:16 +0200336# Make a temporary directory/file insdie workspace, so that it doesn't need to
337# be cleaned up. Jenkins is setup to clean up workspace before a job runs.
338mktempdir() {
339 local ws="${workspace:?}"
340
341 mktemp -d --tmpdir="$ws"
342}
343mktempfile() {
344 local ws="${workspace:?}"
345
346 mktemp --tmpdir="$ws"
347}
348
349not_upon() {
350 ! upon "$1"
351}
352
353# Use "$1" as a boolean
354upon() {
355 case "$1" in
356 "" | "0" | "false") return 1;;
357 *) return 0;;
358 esac
359}
360
361# Check if the argument is a URL
362is_url() {
363 echo "$1" | grep -q "://"
364}
365
366# Check if a path is absolute
367is_abs() {
368 [ "${1:0:1}" = "/" ]
369}
370
371# Unset a variable based on its boolean value
372# If foo=, foo will be unset
373# If foo=blah, then leave it as is
374reset_var() {
375 local var="$1"
376 local val="${!var}"
377
378 if [ -z "$val" ]; then
379 unset "$var"
380 else
381 var="$val"
382 fi
383}
384
385default_var() {
386 local var="$1"
387 local val="${!var}"
388 local default="$2"
389
390 if [ -z "$val" ]; then
391 eval "$var=$default"
392 fi
393}
394
395# String various items joined by ":" to form a path. Items are prepended by
396# default; or 'op' can be set to 'append' to have them appended.
397# For example, to set: PATH=foo:bar:baz:$PATH
398extend_path() {
399 local path_var="$1"
400 local array_var="$2"
Leonardo Sandoval2af93202020-07-16 17:29:18 -0500401 local path_val="${!path_var}"
Fathi Boudra422bf772019-12-02 11:10:16 +0200402 local op="${op:-prepend}"
Leonardo Sandoval2af93202020-07-16 17:29:18 -0500403 local sep=':'
404 local array_val
Fathi Boudra422bf772019-12-02 11:10:16 +0200405
Leonardo Sandoval2af93202020-07-16 17:29:18 -0500406 eval "array_val=\"\${$array_var[@]}\""
407 array_val="$(echo ${array_val// /:})"
408
409 [ -z "$path_val" ] && sep=''
410
411 if [ "$op" = "prepend" ]; then
412 array_val="${array_val}${sep}${path_val}"
413 elif [ "$op" = "append" ]; then
414 array_val="${path_val}${sep}${array_val}"
415 fi
416
417 eval "$path_var=\"$array_val\""
Fathi Boudra422bf772019-12-02 11:10:16 +0200418}
419
Chris Kay3d807882022-08-31 16:00:02 +0100420# Expand and evaluate Bash variables and expressions in a file, whose path is
421# given by the first parameter.
422#
423# For example, to expand a file containing the following:
424#
425# My name is ${name}!
426#
427# You might use:
428#
429# name="Chris" expand_template "path-to-my-file.txt"
430#
431# This would yield:
432#
433# My name is Chris!
434#
435# If you need to run multiple expansions on a file (e.g. to fill out information
436# incrementally), then you can escape expansion of a variable with a backslash,
437# e.g. `\${name}`.
438#
439# The expanded output is printed to the standard output stream.
440expand_template() {
441 local path="$1"
442
443 eval "cat <<-EOF
444 $(<${path})
445 EOF"
446}
447
Harrison Mutai013f6332022-02-16 16:06:33 +0000448# Fetch and extract the latest supported version of the LLVM toolchain from
449# a compressed archive file to a target directory, if it is required.
450setup_llvm_toolchain() {
451 link="${1:-$llvm_archive}"
452 archive="${2:-"$workspace/llvm.tar.xz"}"
453 target_dir="${3:-$llvm_dir}"
454
455 if is_arm_jenkins_env || upon "$local_ci"; then
456 url="$link" saveas="$archive" fetch_file
457 mkdir -p $target_dir
458 extract_tarball $archive $target_dir --strip-components=1 -k
459 fi
460}
461
462# Extract files from compressed archive to target directory. Supports .zip,
463# .tar.gz, and tar.xf format
Madhukar Pappireddy4b686cf2020-03-31 13:05:14 -0500464extract_tarball() {
465 local archive="$1"
466 local target_dir="$2"
Leonardo Sandovalec9e16c2020-09-09 14:32:40 -0500467 local extra_params="${3:-}"
Madhukar Pappireddy4b686cf2020-03-31 13:05:14 -0500468
469 pushd "$target_dir"
470 case $(file --mime-type -b "$archive") in
471 application/gzip)
Leonardo Sandovalec9e16c2020-09-09 14:32:40 -0500472 tar -xz $extra_params -f $archive
Zelalem219df412020-05-17 19:21:20 -0500473 ;;
Madhukar Pappireddy4b686cf2020-03-31 13:05:14 -0500474 application/zip)
Leonardo Sandovalec9e16c2020-09-09 14:32:40 -0500475 unzip -q $extra_params $archive
Zelalem219df412020-05-17 19:21:20 -0500476 ;;
Harrison Mutai013f6332022-02-16 16:06:33 +0000477 application/x-xz)
478 tar -x $extra_params -f $archive
479 ;;
Madhukar Pappireddy4b686cf2020-03-31 13:05:14 -0500480 esac
Zelalem219df412020-05-17 19:21:20 -0500481 popd "$target_dir"
Madhukar Pappireddy4b686cf2020-03-31 13:05:14 -0500482}
483
Gary Morrison999a9d72022-03-14 18:29:06 -0500484# See if execution is done by Jenkins. If called with a parameter,
485# representing a 'domain', e.g. arm.com, it will also check if
Arthur She0d997d02025-02-03 21:39:57 -0800486# JENKINS_PUBLIC_URL contains the latter.
Leonardo Sandoval795b6212020-08-14 16:20:00 -0500487is_jenkins_env () {
488 local domain="${1-}"
489
490 # check if running under Jenkins, if not, return non-zero
491 # the checks assumes Jenkins executing if JENKINS_HOME is set
492 [ -z "$JENKINS_HOME" ] && return 1
493
494 # if no parameter passed, no more checks, quit
495 [ -z "$domain" ] && return 0
496
Arthur She0d997d02025-02-03 21:39:57 -0800497 if echo "$JENKINS_PUBLIC_URL" | grep -q "$domain"; then
Leonardo Sandoval795b6212020-08-14 16:20:00 -0500498 return 0
499 fi
500
501 return 1
502}
503
504
505# Check if execution is under ARM's jenkins
506is_arm_jenkins_env() {
Saheer Babu43523b62025-01-08 16:32:17 +0000507 local arm_domain="oss.arm.com"
Leonardo Sandoval795b6212020-08-14 16:20:00 -0500508 return $(is_jenkins_env "$arm_domain")
509}
510
Leonardo Sandovalfeae3a22020-11-17 16:53:59 -0600511
512# Provide correct linaro cross toolchain based on environment
513set_cross_compile_gcc_linaro_toolchain() {
514 local cross_compile_path="/home/buildslave/tools"
515
516 # if under arm enviroment, overide cross-compilation path
Madhukar Pappireddy21a5e672021-03-08 17:49:45 -0600517 is_arm_jenkins_env || upon "$local_ci" && cross_compile_path="/arm/pdsw/tools"
Leonardo Sandovalfeae3a22020-11-17 16:53:59 -0600518
519 echo "${cross_compile_path}/gcc-linaro-6.2.1-2016.11-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-"
520}
521
Leonardo Sandoval795b6212020-08-14 16:20:00 -0500522if is_jenkins_env; then
Fathi Boudra422bf772019-12-02 11:10:16 +0200523 jenkins_run=1
524 umask 0002
525else
526 unset jenkins_run
527fi
528
529# Project scratch location for Trusted Firmware CI
530project_filer="${nfs_volume}/projectscratch/ssg/trusted-fw"
531project_scratch="${PROJECT_SCRATCH:-$project_filer/ci-workspace}"
532warehouse="${nfs_volume}/warehouse"
Arthur She0d997d02025-02-03 21:39:57 -0800533jenkins_url="${JENKINS_PUBLIC_URL%/*}"
Fathi Boudra422bf772019-12-02 11:10:16 +0200534jenkins_url="${jenkins_url:-https://ci.trustedfirmware.org/}"
535
536# Model revisions
Govindraj Raja72fceec2024-06-18 13:34:17 -0500537model_version_11_24="${model_version:-11.24}"
538model_build_11_24="${model_build:-24}"
539
Govindraj Raja5adcd7d2024-06-04 14:50:28 -0500540model_version="${model_version:-11.26}"
541model_build="${model_build:-11}"
Maksims Svecovs5c542512022-03-29 10:13:05 +0100542model_flavour="${model_flavour:-Linux64_GCC-9.3}"
Fathi Boudra422bf772019-12-02 11:10:16 +0200543
544# Model snapshots from filer are not normally not accessible from developer
545# systems. Ignore failures from picking real path for local runs.
546pinned_cortex="$(readlink -f ${pinned_cortex:-$project_filer/models/cortex})" || true
547pinned_css="$(readlink -f ${pinned_css:-$project_filer/models/css})" || true
548
Fathi Boudra422bf772019-12-02 11:10:16 +0200549tforg_gerrit_url="review.trustedfirmware.org"
550
551# Repository URLs. We're using anonymous HTTP as they appear to be faster rather
552# than any scheme with authentication.
Fathi Boudra422bf772019-12-02 11:10:16 +0200553tf_src_repo_url="${tf_src_repo_url:-$TF_SRC_REPO_URL}"
554tf_src_repo_url="${tf_src_repo_url:-https://$tforg_gerrit_url/TF-A/trusted-firmware-a}"
Fathi Boudra422bf772019-12-02 11:10:16 +0200555tftf_src_repo_url="${tftf_src_repo_url:-$TFTF_SRC_REPO_URL}"
556tftf_src_repo_url="${tftf_src_repo_url:-https://$tforg_gerrit_url/TF-A/tf-a-tests}"
Jimmy Brisson29ca0a02020-09-22 16:15:35 -0500557ci_src_repo_url="${ci_src_repo_url:-$CI_SRC_REPO_URL}"
558ci_src_repo_url="${ci_src_repo_url:-https://$tforg_gerrit_url/ci/tf-a-ci-scripts}"
Zelalemdd655272020-10-06 16:29:05 -0500559tf_ci_repo_url="$ci_src_repo_url"
Fathi Boudra422bf772019-12-02 11:10:16 +0200560scp_src_repo_url="${scp_src_repo_url:-$SCP_SRC_REPO_URL}"
Girish Pathak97f7ad42020-08-27 11:38:15 +0100561scp_src_repo_url="${scp_src_repo_url:-$scp_src_repo_default}"
Olivier Deprez965a7792019-12-16 14:09:03 +0100562spm_src_repo_url="${spm_src_repo_url:-$SPM_SRC_REPO_URL}"
563spm_src_repo_url="${spm_src_repo_url:-https://$tforg_gerrit_url/hafnium/hafnium}"
Jimmy Brisson0d5e12c2023-05-16 14:51:51 -0500564tf_m_tests_src_repo_url="${tf_m_tests_src_repo_url:-$TF_M_TESTS_REPO_URL}"
565tf_m_tests_src_repo_url="${tf_m_tests_src_repo_url:-https://$tforg_gerrit_url/TF-M/tf-m-tests}"
566tf_m_extras_src_repo_url="${tf_m_extras_src_repo_url:-$TF_M_EXTRAS_REPO_URL}"
567tf_m_extras_src_repo_url="${tf_m_extras_src_repo_url:-https://$tforg_gerrit_url/TF-M/tf-m-extras}"
Fathi Boudra422bf772019-12-02 11:10:16 +0200568
Leonardo Sandovald98f8332021-04-13 16:46:38 -0500569tf_downloads="${tf_downloads:-file:///downloads/}"
Fathi Boudra422bf772019-12-02 11:10:16 +0200570tfa_downloads="${tfa_downloads:-file:///downloads/tf-a}"
571css_downloads="${css_downloads:-$tfa_downloads/css}"
572
Chris Kay52b8d432023-04-27 16:10:57 +0100573# SCP/MCP release binaries.
Manish V Badarkhe8b896ef2024-01-29 18:44:03 +0000574scp_mcp_downloads="${scp_mcp_downloads:-$tfa_downloads/css_scp_2.13.0}"
Alexei Fedorov9e4473d2020-11-04 10:13:07 +0000575
Leonardo Sandoval15676062020-11-19 11:58:09 -0600576linaro_2001_release="${linaro_2001_release:-$tfa_downloads/linaro/20.01}"
Alexei Fedorove405cc32020-09-30 18:13:55 +0100577linaro_release="${linaro_release:-$linaro_2001_release}"
Lauren Wehrmeisterdc9c6252025-04-03 12:56:54 -0500578mbedtls_version="${mbedtls_version:-3.6.3}"
Zelalem219df412020-05-17 19:21:20 -0500579
Madhukar Pappireddy4b686cf2020-03-31 13:05:14 -0500580# mbedTLS archive public hosting available at github.com
Govindraj Raja827823f2023-02-28 14:19:00 +0000581mbedtls_archive="${mbedtls_archive:-https://github.com/Mbed-TLS/mbedtls/archive/mbedtls-${mbedtls_version}.tar.gz}"
Fathi Boudra422bf772019-12-02 11:10:16 +0200582
Harrison Mutai013f6332022-02-16 16:06:33 +0000583# FIXME: workaround to allow all on-prem host machines to access the latest LLVM
584# LLVM archive public hosting available at github.com
585llvm_version="${llvm_version:-14.0.0}"
586llvm_dir="$workspace/llvm-$llvm_version"
587llvm_archive="${llvm_archive:-https://github.com/llvm/llvm-project/releases/download/llvmorg-$llvm_version/clang+llvm-$llvm_version-x86_64-linux-gnu-ubuntu-18.04.tar.xz}"
588
Mark Dykes30138ad2021-11-09 16:48:17 -0600589coverity_path="${coverity_path:-${nfs_volume}/tools/coverity/static-analysis/2020.12}"
Fathi Boudra422bf772019-12-02 11:10:16 +0200590coverity_default_checkers=(
591"--all"
592"--checker-option DEADCODE:no_dead_default:true"
Fathi Boudra422bf772019-12-02 11:10:16 +0200593"--enable AUDIT.SPECULATIVE_EXECUTION_DATA_LEAK"
Zelalem219df412020-05-17 19:21:20 -0500594"--enable ENUM_AS_BOOLEAN"
Fathi Boudra422bf772019-12-02 11:10:16 +0200595"--enable-constraint-fpp"
Fathi Boudra422bf772019-12-02 11:10:16 +0200596"--ticker-mode none"
Zelalem219df412020-05-17 19:21:20 -0500597"--hfa"
Fathi Boudra422bf772019-12-02 11:10:16 +0200598)
599
Leonardo Sandovald76d1e22020-10-06 16:02:52 -0500600docker_registry="${docker_registry:-}"
601
Leonardo Sandoval1c24ae52020-07-08 11:47:23 -0500602# Define toolchain version and toolchain binary paths
Jayanth Dodderi Chidanand07cec232023-09-07 11:34:44 +0100603toolchain_version="12.3.rel1"
Leonardo Sandoval1c24ae52020-07-08 11:47:23 -0500604
Jayanth Dodderi Chidanandcc4d2342022-09-12 14:44:21 +0100605aarch64_none_elf_dir="${nfs_volume}/pdsw/tools/arm-gnu-toolchain-${toolchain_version}-x86_64-aarch64-none-elf"
Leonardo Sandoval1c24ae52020-07-08 11:47:23 -0500606aarch64_none_elf_prefix="aarch64-none-elf-"
607
Jayanth Dodderi Chidanandcc4d2342022-09-12 14:44:21 +0100608arm_none_eabi_dir="${nfs_volume}/pdsw/tools/arm-gnu-toolchain-${toolchain_version}-x86_64-arm-none-eabi"
Leonardo Sandoval1c24ae52020-07-08 11:47:23 -0500609arm_none_eabi_prefix="arm-none-eabi-"
610
Fathi Boudra422bf772019-12-02 11:10:16 +0200611path_list=(
Leonardo Sandoval1c24ae52020-07-08 11:47:23 -0500612 "${aarch64_none_elf_dir}/bin"
613 "${arm_none_eabi_dir}/bin"
Harrison Mutai013f6332022-02-16 16:06:33 +0000614 "${llvm_dir}/bin"
Leonardo Sandoval1c24ae52020-07-08 11:47:23 -0500615 "${nfs_volume}/pdsw/tools/gcc-arm-none-eabi-5_4-2016q3/bin"
616 "$coverity_path/bin"
Fathi Boudra422bf772019-12-02 11:10:16 +0200617)
618
619ld_library_path_list=(
620)
621
Sandrine Bailleuxa6a1d6e2020-08-07 10:24:17 +0200622license_path_list=${license_path_list-(
623)}
Fathi Boudra422bf772019-12-02 11:10:16 +0200624
625# Setup various paths
626if upon "$retain_paths"; then
627 # If explicitly requested, retain local paths; apppend CI paths to the
628 # existing ones.
629 op="append" extend_path "PATH" "path_list"
630 op="append" extend_path "LD_LIBRARY_PATH" "ld_library_path_list"
631 op="append" extend_path "LM_LICENSE_FILE" "license_path_list"
632else
633 # Otherwise, prepend CI paths so that they take effect before local ones
634 extend_path "PATH" "path_list"
635 extend_path "LD_LIBRARY_PATH" "ld_library_path_list"
636 extend_path "LM_LICENSE_FILE" "license_path_list"
637fi
638
639export LD_LIBRARY_PATH
640export LM_LICENSE_FILE
Fathi Boudra422bf772019-12-02 11:10:16 +0200641export ARM_TOOL_VARIANT=ult
642
643# vim: set tw=80 sw=8 noet: