From 5e6440792340a5e0def0500bf28c827288359540 Mon Sep 17 00:00:00 2001 From: Adam Retter Date: Thu, 17 Feb 2022 12:47:45 -0800 Subject: [PATCH] Support C++17 Docker build environments for RocksJava (#9500) Summary: See https://github.com/facebook/rocksdb/issues/9388#issuecomment-1029583789 Pull Request resolved: https://github.com/facebook/rocksdb/pull/9500 Reviewed By: pdillinger Differential Revision: D34114687 Pulled By: jay-zhuang fbshipit-source-id: 22129d99ccd0dba7e8f1b263ddc5520d939641bf --- Makefile | 2 +- java/crossbuild/docker-build-linux-centos.sh | 32 +++++++++++--------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index 6a3ae6977..c2ced30f8 100644 --- a/Makefile +++ b/Makefile @@ -2324,7 +2324,7 @@ rocksdbjavastaticdockerarm64v8: rocksdbjavastaticdockers390x: mkdir -p java/target - docker run --rm --name rocksdb_linux_s390x-be --attach stdin --attach stdout --attach stderr --volume $(HOME)/.m2:/root/.m2:ro --volume `pwd`:/rocksdb-host:ro --volume /rocksdb-local-build --volume `pwd`/java/target:/rocksdb-java-target --env DEBUG_LEVEL=$(DEBUG_LEVEL) evolvedbinary/rocksjava:centos7_s390x-be /rocksdb-host/java/crossbuild/docker-build-linux-centos.sh + docker run --rm --name rocksdb_linux_s390x-be --attach stdin --attach stdout --attach stderr --volume $(HOME)/.m2:/root/.m2:ro --volume `pwd`:/rocksdb-host:ro --volume /rocksdb-local-build --volume `pwd`/java/target:/rocksdb-java-target --env DEBUG_LEVEL=$(DEBUG_LEVEL) evolvedbinary/rocksjava:ubuntu18_s390x-be /rocksdb-host/java/crossbuild/docker-build-linux-centos.sh rocksdbjavastaticdockerx86musl: mkdir -p java/target diff --git a/java/crossbuild/docker-build-linux-centos.sh b/java/crossbuild/docker-build-linux-centos.sh index 78dbfb6da..16581dec7 100755 --- a/java/crossbuild/docker-build-linux-centos.sh +++ b/java/crossbuild/docker-build-linux-centos.sh @@ -13,21 +13,25 @@ cd /rocksdb-local-build # Use scl devtoolset if available if hash scl 2>/dev/null; then - if scl --list | grep -q 'devtoolset-7'; then - # CentOS 7+ - scl enable devtoolset-7 'make clean-not-downloaded' - scl enable devtoolset-7 'PORTABLE=1 make -j2 rocksdbjavastatic' - elif scl --list | grep -q 'devtoolset-2'; then - # CentOS 5 or 6 - scl enable devtoolset-2 'make clean-not-downloaded' - scl enable devtoolset-2 'PORTABLE=1 make -j2 rocksdbjavastatic' - else - echo "Could not find devtoolset" - exit 1; - fi + if scl --list | grep -q 'devtoolset-8'; then + # CentOS 6+ + scl enable devtoolset-8 'make clean-not-downloaded' + scl enable devtoolset-8 'PORTABLE=1 make -j2 rocksdbjavastatic' + elif scl --list | grep -q 'devtoolset-7'; then + # CentOS 6+ + scl enable devtoolset-7 'make clean-not-downloaded' + scl enable devtoolset-7 'PORTABLE=1 make -j2 rocksdbjavastatic' + elif scl --list | grep -q 'devtoolset-2'; then + # CentOS 5 or 6 + scl enable devtoolset-2 'make clean-not-downloaded' + scl enable devtoolset-2 'PORTABLE=1 make -j2 rocksdbjavastatic' + else + echo "Could not find devtoolset" + exit 1; + fi else - make clean-not-downloaded - PORTABLE=1 make -j2 rocksdbjavastatic + make clean-not-downloaded + PORTABLE=1 make -j2 rocksdbjavastatic fi cp java/target/librocksdbjni-linux*.so java/target/rocksdbjni-*-linux*.jar java/target/rocksdbjni-*-linux*.jar.sha1 /rocksdb-java-target