aboutsummaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorJordan Bayles <jophba@chromium.org>2020-04-23 11:26:12 -0700
committerCommit Bot <commit-bot@chromium.org>2020-04-23 19:41:10 +0000
commitf3152ffe484c8b562fb01c6fcd404c7c15d41056 (patch)
tree8e4753562e889aa7e47a8c826871312a162d16bf /build
parent9a95cc089fbb642906eafad7d9cb028a9a74465e (diff)
downloadopenscreen-f3152ffe484c8b562fb01c6fcd404c7c15d41056.tar.gz
Readd Debian stretch for bot compilation
Currently the ARM64 bots are using too new of a version of glib, so they are incompatible with all of the bots in the luci.flex.try pool that run ARM64. This patch readds the Debian stretch sysroot for cross compiling, so we link an older version of glib that is either the same or forwards compatible with the newer version linked in the Ubuntu 18.04 bots. Bug: openscreen/18 Change-Id: I3ada49ac5197844b0c49028194a17c993c7b2663 TBR=btolsch@chromium.org Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/2163436 Reviewed-by: Jordan Bayles <jophba@chromium.org> Commit-Queue: Jordan Bayles <jophba@chromium.org>
Diffstat (limited to 'build')
-rw-r--r--build/config/BUILD.gn1
-rw-r--r--build/config/sysroot.gni12
-rwxr-xr-xbuild/scripts/install-sysroot.py10
-rw-r--r--build/scripts/sysroots.json10
4 files changed, 27 insertions, 6 deletions
diff --git a/build/config/BUILD.gn b/build/config/BUILD.gn
index 52f0d6fb..9745e3f0 100644
--- a/build/config/BUILD.gn
+++ b/build/config/BUILD.gn
@@ -233,6 +233,7 @@ config("sysroot_runtime_libraries") {
[
"--print-hash",
"$current_cpu",
+ "$sysroot_platform",
],
"trim string",
[ "//build/scripts/sysroots.json" ])
diff --git a/build/config/sysroot.gni b/build/config/sysroot.gni
index 8ce9455a..deecdeca 100644
--- a/build/config/sysroot.gni
+++ b/build/config/sysroot.gni
@@ -12,20 +12,28 @@ declare_args() {
target_sysroot_dir = "../"
use_sysroot = current_cpu == "arm" || current_cpu == "arm64"
+
+ sysroot_platform = "sid"
}
if (use_sysroot) {
+ assert(sysroot_platform == "sid" || sysroot_platform == "stretch")
assert(current_cpu == "arm" || current_cpu == "arm64")
# By default build against a sysroot image downloaded from Cloud Storage
# during gclient runhooks.
- sysroot = "${target_sysroot_dir}/debian_sid_${current_cpu}-sysroot"
+ sysroot =
+ "${target_sysroot_dir}/debian_${sysroot_platform}_${current_cpu}-sysroot"
_script_arch = current_cpu
if (exec_script("//build/scripts/dir_exists.py",
[ rebase_path(sysroot) ],
"string") != "True") {
print("Missing or outdated sysroot for $current_cpu, downloading latest...")
- exec_script("//build/scripts/install-sysroot.py", [ "$current_cpu" ])
+ exec_script("//build/scripts/install-sysroot.py",
+ [
+ "$current_cpu",
+ "$sysroot_platform",
+ ])
}
}
diff --git a/build/scripts/install-sysroot.py b/build/scripts/install-sysroot.py
index e4a2e92b..374598f1 100755
--- a/build/scripts/install-sysroot.py
+++ b/build/scripts/install-sysroot.py
@@ -44,6 +44,7 @@ URL_PREFIX = 'https://storage.googleapis.com'
URL_PATH = 'openscreen-sysroots'
VALID_ARCHS = ('arm', 'arm64')
+VALID_PLATFORMS = ('stretch', 'sid')
class Error(Exception):
@@ -135,6 +136,9 @@ def parse_args(args):
'arch',
help='Sysroot architecture: %s' % ', '.join(VALID_ARCHS))
p.add_argument(
+ 'platform',
+ help='Sysroot platform: %s' % ', '.join(VALID_PLATFORMS))
+ p.add_argument(
'--print-hash', action="store_true",
help='Print the hash of the sysroot for the specified arch.')
@@ -146,13 +150,11 @@ def main(args):
print('Unsupported platform. Only Linux and Mac OS X are supported.')
return 1
- # Currently, we only support linking against the sid sysroot image.
- PLATFORM = 'sid'
parsed_args = parse_args(args)
if parsed_args.print_hash:
- print(GetSysrootDict(PLATFORM, parsed_args.arch)['Sha1Sum'])
+ print(GetSysrootDict(parsed_args.platform, parsed_args.arch)['Sha1Sum'])
- InstallSysroot(PLATFORM, parsed_args.arch)
+ InstallSysroot(parsed_args.platform, parsed_args.arch)
return 0
diff --git a/build/scripts/sysroots.json b/build/scripts/sysroots.json
index 2772287d..193e9412 100644
--- a/build/scripts/sysroots.json
+++ b/build/scripts/sysroots.json
@@ -1,4 +1,14 @@
{
+ "stretch_arm": {
+ "Sha1Sum": "407ba17bd8a686d1c82dadb593579325e4b9cd61",
+ "SysrootDir": "debian_stretch_arm-sysroot",
+ "Tarball": "debian_stretch_arm_sysroot.tar.xz"
+ },
+ "stretch_arm64": {
+ "Sha1Sum": "5523478d833a735643c0a36feed5d89a1f70846b",
+ "SysrootDir": "debian_stretch_arm64-sysroot",
+ "Tarball": "debian_stretch_arm64_sysroot.tar.xz"
+ },
"sid_arm": {
"Sha1Sum": "07ef353ec66ca510a9b24a927db823e44435c764",
"SysrootDir": "debian_sid_arm-sysroot",