IMPALA-10646: Add non-server RHEL 8 signature to toolchain bootstrap

Recent Red Hat Enterprise Linux 8.x version return a shorter release
name string from `lsb_release -si` than earlier versions. This shorter
string was not recognized in the OS mapper logic in
bin/bootstrap_toolchain.py, makig it -- and the build process -- break
on Red Hat 8.2

The patch adds the shorter signature as a point fix.

Rename a local variable to fix an unrelated name conflict (shadowing)
found by flake8.

Tests: run bin/bootstrap_toolchain.py manually on Red Hat 8.2, then run
  a complete build on the same OS.

Regression-tested (build and dataload only) on the following versions:
- Centos 8.2 (as opposed to Red Hat 8.2)
- Centos 7.9
- Ubuntu 18.04

Change-Id: Icb1a6c215b1b5a65691042bb7d94fb034392d135
Reviewed-on: http://gerrit.cloudera.org:8080/17292
Reviewed-by: Joe McDonnell <joemcdonnell@cloudera.com>
Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
This commit is contained in:
Laszlo Gaal
2021-04-08 23:54:29 +02:00
committed by Impala Public Jenkins
parent 1dcd59638c
commit bf4c2dfb38

View File

@@ -82,6 +82,7 @@ OS_MAPPING = [
OsMapping("redhatenterpriseserver5", "ec2-package-centos-5", None),
OsMapping("redhatenterpriseserver6", "ec2-package-centos-6", "redhat6"),
OsMapping("redhatenterpriseserver7", "ec2-package-centos-7", "redhat7"),
OsMapping("redhatenterprise8", "ec2-package-centos-8", "redhat8"),
OsMapping("redhatenterpriseserver8", "ec2-package-centos-8", "redhat8"),
OsMapping("debian6", "ec2-package-debian-6", None),
OsMapping("debian7", "ec2-package-debian-7", None),
@@ -364,9 +365,9 @@ def get_platform_release_label(release=None):
else:
lsb_release = check_output(["lsb_release", "-irs"])
release = "".join(map(lambda x: x.lower(), lsb_release.split()))
# Only need to check against the major release if RHEL or CentOS
for platform in ['centos', 'redhatenterpriseserver', 'suse']:
if platform in release:
# Only need to check against the major release if RHEL, CentOS or Suse
for distro in ['centos', 'redhatenterprise', 'redhatenterpriseserver', 'suse']:
if distro in release:
release = release.split('.')[0]
break
lsb_release_cache = release