Change in osmo-ci[master]: build-old-tags: build libosmo-legacy-mgcp

osmith gerrit-no-reply at lists.osmocom.org
Tue Apr 2 08:03:24 UTC 2019


osmith has submitted this change and it was merged. ( https://gerrit.osmocom.org/13454 )

Change subject: build-old-tags: build libosmo-legacy-mgcp
......................................................................

build-old-tags: build libosmo-legacy-mgcp

Build osmo-mgw 1.4.0 (which provides libosmo-legacy-mgcp) and install
it into a different temp dir. Allows properly building osmo-bsc 1.2.x,
as soon as a new release is tagged, which makes it use
LIBOSMOLEGACYMGCP_CFLAGS and therefore pick up the include path
properly [1].

osmo-mgw 1.4.0's "make check" doesn't pass right now, so add a check
parameter to build_repo() and disable them when building
libosmo-legacy-mgcp. The checks will get executed later, when the
depends are installed and we are building various tags of Osmocom repos,
including osmo-mgw 1.4.0.

While at it, slightly refactor build_repo() to put all arguments into
descriptive variable names (as it is getting a bit longer now).

[1]: Change-Id: Ibd7948f12da710f8ca2b8fde8870f134308eb908

Related: OS#3867
Change-Id: I63d16f8e44c14dee46e2ef3fd050a421017c56b0
---
M scripts/osmocom-build-old-tags-against-master.sh
1 file changed, 44 insertions(+), 10 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Daniel Willmann: Looks good to me, but someone else must approve
  osmith: Verified



diff --git a/scripts/osmocom-build-old-tags-against-master.sh b/scripts/osmocom-build-old-tags-against-master.sh
index 0ac220e..c5e9685 100755
--- a/scripts/osmocom-build-old-tags-against-master.sh
+++ b/scripts/osmocom-build-old-tags-against-master.sh
@@ -2,6 +2,7 @@
 # Environment variables:
 # * PARALLEL_MAKE: -jN argument for make (default: -j5).
 # * SKIP_MASTER: don't build REPOS_MASTER (assume that they were just built and keep _temp).
+# * SKIP_LEGACY: don't build libosmo-legacy-mgcp (assume that it was just built and keep _temp).
 #
 # Latest result:
 # https://jenkins.osmocom.org/jenkins/job/Osmocom-build-tags-against-master/lastBuild/console
@@ -53,7 +54,9 @@
 			echo "1.0.0" # testsuite
 			;;
 		osmo-bsc)
-			echo "1.2.1" # depends on libosmo-legacy-mgcp
+			# Depends on libosmo-legacy-mgcp, but missing LIBOSMOLEGACYMGCP_CFLAGS so we can't build it with
+			# this script (we put that legacy lib into a different temp install dir). Fixed in 1.2.2.
+			echo "1.2.1"
 			echo "1.4.0" # testsuite
 			;;
 		osmo-bts)
@@ -97,9 +100,9 @@
 # Delete existing temp dir and create a new one, output the path.
 prepare_temp_dir() {
 	TEMP="$(cd ..; pwd)/_temp"
-	if [ -n "$SKIP_MASTER" ]; then
+	if [ -n "$SKIP_MASTER" ] || [ -n "$SKIP_LEGACY" ]; then
 		if ! [ -d "$TEMP" ]; then
-			echo "ERROR: SKIP_MASTER is set, but temp dir not found: $TEMP"
+			echo "ERROR: SKIP_MASTER or SKIP_LEGACY is set, but temp dir not found: $TEMP"
 			exit 1
 		fi
 	else
@@ -136,20 +139,27 @@
 # $1: installation path (either $TEMP/inst_master or $TEMP/inst)
 # $2: repository
 # $3: branch, tag or commit
+# $4: run tests (set to 0 to disable tests, default is 1)
 # returns: 0 on sucessful build, 1 on error
 build_repo() {
-	local log="$TEMP/log/$2-$3.txt"
+	local inst="$1"
+	local repo="$2"
+	local branch="$3"
+	local check=""
+	if [ "$4" != "0" ]; then
+		check="1"
+	fi
 
 	if ! PATH="$PWD:$PATH"\
-		PKG_CONFIG_PATH="$TEMP/inst_master/lib/pkgconfig:$PKG_CONFIG_PATH" \
-		LD_LIBRARY_PATH="$TEMP/inst_master/lib:$LD_LIBRARY_PATH" \
+		PKG_CONFIG_PATH="$TEMP/inst_master/lib/pkgconfig:$TEMP/inst_legacy/lib/pkgconfig:$PKG_CONFIG_PATH" \
+		LD_LIBRARY_PATH="$TEMP/inst_master/lib:$TEMP/inst_legacy/lib:$LD_LIBRARY_PATH" \
 		MAKE="make" \
 		PARALLEL_MAKE="$PARALLEL_MAKE" \
-		CHECK="1" \
+		CHECK="$check" \
 		deps="../_deps" \
-		inst="$1" \
-		./osmo-build-dep.sh "$2" "$3" \
-		> "$log" 2>&1
+		inst="$inst" \
+		./osmo-build-dep.sh "$repo" "$branch" \
+		> "$TEMP/log/$repo-$branch.txt" 2>&1
 	then
 		return 1
 	fi
@@ -183,6 +193,29 @@
 	done
 }
 
+# Build libosmo-legacy-mgcp and install to $TEMP/inst_legacy (osmo-bsc 1.2.1 depends on it).
+build_legacy_mgcp() {
+	echo "Building legacy libraries..."
+
+	if [ -n "$SKIP_LEGACY" ]; then
+		echo "=> SKIPPED (SKIP_LEGACY is set)"
+		return
+	fi
+
+	local repo="osmo-mgw"
+	local tag="1.4.0"
+
+	# Don't run "make check" here. The script tries it during build_repos_tags() instead.
+	local check="0"
+	printf "%-21s %10s %s" " * $repo" "$tag" "(provides libosmo-legacy-mgcp)"
+	if ! build_repo "$TEMP/inst_legacy" "$repo" "$tag" "$check"; then
+		printf "\n"
+		ERROR_LOGS="$ERROR_LOGS $TEMP/log/$repo-$tag.txt"
+		show_errors_exit
+	fi
+	printf "\n"
+}
+
 # $1: repository
 # $2: tag
 # returns: 0 when the error should be ignored, 1 otherwise
@@ -231,5 +264,6 @@
 
 prepare_temp_dir
 build_repos_master
+build_legacy_mgcp
 build_repos_tags
 show_errors_exit

-- 
To view, visit https://gerrit.osmocom.org/13454
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I63d16f8e44c14dee46e2ef3fd050a421017c56b0
Gerrit-Change-Number: 13454
Gerrit-PatchSet: 3
Gerrit-Owner: osmith <osmith at sysmocom.de>
Gerrit-Reviewer: Daniel Willmann <dwillmann at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: osmith <osmith at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190402/4a06e669/attachment.html>


More information about the gerrit-log mailing list