Repository: apache/incubator-heron (language: python)

Issue:
C++ unit tests fail on newer MacOS.
**Describe the bug**
When running Heron unit tests on newer MacOS, a number of tests fail. I found that adding `-lc++` library back fixed a lot of the issues. Finally found reference to the Bazel issue here which causes all standard libraries to be stripped.
https://github.com/bazelbuild/bazel/issues/14273

**To Reproduce**
Steps to reproduce the behavior:
`bazel test --config=darwin_nostyle heron/stmgr/...`

**Expected behavior**
All tests should pass.

**Operating System**
 - OS: MacOS
 - Version: 12.1




Discussion / hints:

Fix patch:
diff --git a/.bazelversion b/.bazelversion
index ee74734aa22..af8c8ec7c13 100644
--- a/.bazelversion
+++ b/.bazelversion
@@ -1,1 +1,1 @@
-4.1.0
+4.2.2
diff --git a/.travis.yml b/.travis.yml
index 532a3357dd2..3848fc1221b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -29,7 +29,7 @@ addons:
       - libgoogle-perftools-dev
 
 env:
-  - BAZEL_VERSION=4.1.0 ENABLE_HEAPCHECK=1
+  - BAZEL_VERSION=4.2.2 ENABLE_HEAPCHECK=1
 
 before_install:
   # download and install bazel
diff --git a/README.md b/README.md
index 5555e7e0f40..a3814dcaa6d 100644
--- a/README.md
+++ b/README.md
@@ -33,7 +33,7 @@ Confluence: https://cwiki.apache.org/confluence/display/HERON
 #### Heron Requirements:
  * Java 11
  * Python 3.6
- * Bazel 4.1.0
+ * Bazel 4.2.2
 
 ## Contact
 
diff --git a/docker/compile/Dockerfile.centos7 b/docker/compile/Dockerfile.centos7
index 8b27002fe00..e4fadfa5570 100644
--- a/docker/compile/Dockerfile.centos7
+++ b/docker/compile/Dockerfile.centos7
@@ -46,7 +46,7 @@ RUN yum -y install \
 
 ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk
 
-ENV bazelVersion 4.1.0
+ENV bazelVersion 4.2.2
 
 RUN wget -O /tmp/bazel.sh https://github.com/bazelbuild/bazel/releases/download/$bazelVersion/bazel-$bazelVersion-installer-linux-x86_64.sh \
       && chmod +x /tmp/bazel.sh \
diff --git a/docker/compile/Dockerfile.debian10 b/docker/compile/Dockerfile.debian10
index 99edf1e2430..1c6c11eeb21 100644
--- a/docker/compile/Dockerfile.debian10
+++ b/docker/compile/Dockerfile.debian10
@@ -42,7 +42,7 @@ RUN apt-get update && apt-get -y install \
       wget \
       zip
 
-ENV bazelVersion 4.1.0
+ENV bazelVersion 4.2.2
 
 RUN wget -O /tmp/bazel.sh https://github.com/bazelbuild/bazel/releases/download/$bazelVersion/bazel-$bazelVersion-installer-linux-x86_64.sh \
       && chmod +x /tmp/bazel.sh \
diff --git a/docker/compile/Dockerfile.ubuntu18.04 b/docker/compile/Dockerfile.ubuntu18.04
index 15c62cad96d..937087242f1 100644
--- a/docker/compile/Dockerfile.ubuntu18.04
+++ b/docker/compile/Dockerfile.ubuntu18.04
@@ -43,7 +43,7 @@ RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 10
 
 ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk-amd64
 
-ENV bazelVersion 4.1.0
+ENV bazelVersion 4.2.2
 
 RUN wget -O /tmp/bazel.sh https://github.com/bazelbuild/bazel/releases/download/$bazelVersion/bazel-$bazelVersion-installer-linux-x86_64.sh \
       && chmod +x /tmp/bazel.sh \
diff --git a/docker/compile/Dockerfile.ubuntu20.04 b/docker/compile/Dockerfile.ubuntu20.04
index 7ebf7cefb10..4131eb2fbd0 100644
--- a/docker/compile/Dockerfile.ubuntu20.04
+++ b/docker/compile/Dockerfile.ubuntu20.04
@@ -44,7 +44,7 @@ RUN apt-get update && apt-get -y install \
 
 ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk-amd64
 
-ENV bazelVersion 4.1.0
+ENV bazelVersion 4.2.2
 
 RUN wget -O /tmp/bazel.sh https://github.com/bazelbuild/bazel/releases/download/$bazelVersion/bazel-$bazelVersion-installer-linux-x86_64.sh \
       && chmod +x /tmp/bazel.sh \
diff --git a/docker/compile/Dockerfile.ubuntu22.04 b/docker/compile/Dockerfile.ubuntu22.04
index 0cb6f44d26f..e8bdb28dae2 100644
--- a/docker/compile/Dockerfile.ubuntu22.04
+++ b/docker/compile/Dockerfile.ubuntu22.04
@@ -44,7 +44,7 @@ RUN apt-get update && apt-get -y install \
 
 ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk-amd64
 
-ENV bazelVersion 4.1.0
+ENV bazelVersion 4.2.2
 
 RUN wget -O /tmp/bazel.sh https://github.com/bazelbuild/bazel/releases/download/$bazelVersion/bazel-$bazelVersion-installer-linux-x86_64.sh \
       && chmod +x /tmp/bazel.sh \
diff --git a/scripts/ci/setup_bazel.sh b/scripts/ci/setup_bazel.sh
index c61a5814b83..8927586f7b9 100644
--- a/scripts/ci/setup_bazel.sh
+++ b/scripts/ci/setup_bazel.sh
@@ -29,7 +29,7 @@ if [ "$#" -ne 1 ]; then
     exit 1
 fi
 BAZEL_OS=$1
-BAZEL_VERSION=4.1.0
+BAZEL_VERSION=4.2.2
 
 # Install Bazel
 BAZEL_INSTALLER=bazel-$BAZEL_VERSION-installer-$BAZEL_OS-x86_64.sh
diff --git a/vagrant/init.sh b/vagrant/init.sh
index c69492ba7ab..18754bac9e1 100644
--- a/vagrant/init.sh
+++ b/vagrant/init.sh
@@ -44,7 +44,7 @@ install_marathon() {
     service marathon start
 }
 
-bazelVersion=4.1.0
+bazelVersion=4.2.2
 bazel_install() {
     apt-get install -y automake cmake gcc g++ zlib1g-dev zip pkg-config wget libssl-dev libunwind-dev
     mkdir -p /opt/bazel
diff --git a/website2/docs/compiling-osx.md b/website2/docs/compiling-osx.md
index e01983ef18d..251464c63cf 100644
--- a/website2/docs/compiling-osx.md
+++ b/website2/docs/compiling-osx.md
@@ -34,7 +34,7 @@ $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/inst
 
 ### Step 2 -- Install Bazel
 ```bash
-wget -O /tmp/bazel.sh https://github.com/bazelbuild/bazel/releases/download/4.1.0/bazel-4.1.0-installer-darwin-x86_64.sh
+wget -O /tmp/bazel.sh https://github.com/bazelbuild/bazel/releases/download/4.2.2/bazel-4.2.2-installer-darwin-x86_64.sh
 chmod +x /tmp/bazel.sh
 /tmp/bazel.sh --user
 ```
diff --git a/website2/website/scripts/Dockerfile.ubuntu18.04 b/website2/website/scripts/Dockerfile.ubuntu18.04
index 35c8a0b8d25..b9e091f9961 100644
--- a/website2/website/scripts/Dockerfile.ubuntu18.04
+++ b/website2/website/scripts/Dockerfile.ubuntu18.04
@@ -51,7 +51,7 @@ RUN apt-get update && apt-get install -y nodejs
 
 ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk-amd64
 
-ENV bazelVersion 4.1.0
+ENV bazelVersion 4.2.2
 RUN wget -O /tmp/bazel.sh https://github.com/bazelbuild/bazel/releases/download/$bazelVersion/bazel-$bazelVersion-installer-linux-x86_64.sh \
       && chmod +x /tmp/bazel.sh \
       && /tmp/bazel.sh --user
diff --git a/website2/website/scripts/replace.js b/website2/website/scripts/replace.js
index 1dd06cd8185..32cf049958b 100755
--- a/website2/website/scripts/replace.js
+++ b/website2/website/scripts/replace.js
@@ -40,7 +40,7 @@ const bazelVersions = {
     '0.20.2-incubating': '0.26.0',
     '0.20.3-incubating': '3.7.0',
     '0.20.4-incubating': '3.7.2',
-    'latest': '4.1.0',
+    'latest': '4.2.2',
 }
 
 function replaceBazel(version) {


Test patch:
diff --git a/docker/test/Dockerfile.centos7 b/docker/test/Dockerfile.centos7
index bca8ec71dad..f08f1561637 100644
--- a/docker/test/Dockerfile.centos7
+++ b/docker/test/Dockerfile.centos7
@@ -46,7 +46,7 @@ RUN yum -y install \
 
 ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk
 
-ENV bazelVersion 4.1.0
+ENV bazelVersion 4.2.2
 
 RUN wget -O /tmp/bazel.sh https://github.com/bazelbuild/bazel/releases/download/$bazelVersion/bazel-$bazelVersion-installer-linux-x86_64.sh \
       && chmod +x /tmp/bazel.sh \
diff --git a/docker/test/Dockerfile.ubuntu18.04 b/docker/test/Dockerfile.ubuntu18.04
index d74d10297df..f48689d721a 100644
--- a/docker/test/Dockerfile.ubuntu18.04
+++ b/docker/test/Dockerfile.ubuntu18.04
@@ -41,7 +41,7 @@ RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 10
 
 ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk-amd64
 
-ENV bazelVersion 4.1.0
+ENV bazelVersion 4.2.2
 
 RUN wget -O /tmp/bazel.sh https://github.com/bazelbuild/bazel/releases/download/$bazelVersion/bazel-$bazelVersion-installer-linux-x86_64.sh \
       && chmod +x /tmp/bazel.sh \