From 28974ee1795bcdac3a2434735ba2d4699aad67db Mon Sep 17 00:00:00 2001 From: Sam Roberts Date: Thu, 27 Jun 2019 14:37:42 -0700 Subject: [PATCH 1/2] tools: fix v8 testing with devtoolset on ppcle The devtoolset doesn't use or set the CXX, etc, env vars, so ignore them if not present. --- tools/make-v8.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tools/make-v8.sh b/tools/make-v8.sh index fd66fda94274df..1a6e175b6158cc 100755 --- a/tools/make-v8.sh +++ b/tools/make-v8.sh @@ -12,7 +12,9 @@ if [[ "$ARCH" == "s390x" ]] || [[ "$ARCH" == "ppc64le" ]]; then export BUILD_TOOLS=/home/iojs/build-tools export LD_LIBRARY_PATH=$BUILD_TOOLS:$LD_LIBRARY_PATH export PATH=$BUILD_TOOLS:$PATH - CXX_PATH=`which $CXX |grep g++` + if [[ X"$CXX" != X ]]; then + CXX_PATH=`which $CXX |grep g++` + fi rm -f "$BUILD_TOOLS/g++" rm -f "$BUILD_TOOLS/gcc" fi @@ -24,8 +26,10 @@ if [[ "$ARCH" == "s390x" ]]; then gn gen -v out.gn/$BUILD_ARCH_TYPE --args='is_component_build=false is_debug=false use_goma=false goma_dir="None" use_custom_libcxx=false v8_target_cpu="s390x" target_cpu="s390x"' ninja -v -C out.gn/$BUILD_ARCH_TYPE d8 cctest inspector-test elif [[ "$ARCH" == "ppc64le" ]]; then - ln -s /usr/bin/$CXX "$BUILD_TOOLS/g++" - ln -s /usr/bin/$CC "$BUILD_TOOLS/gcc" + if [[ X"$CXX" != X ]]; then + ln -s /usr/bin/$CXX "$BUILD_TOOLS/g++" + ln -s /usr/bin/$CC "$BUILD_TOOLS/gcc" + fi g++ --version export PKG_CONFIG_PATH=$BUILD_TOOLS/pkg-config-files gn gen out.gn/$BUILD_ARCH_TYPE --args='is_component_build=false is_debug=false use_goma=false goma_dir="None" use_custom_libcxx=false v8_target_cpu="ppc64" target_cpu="ppc64"' From c3db2ca06b72d970eb78057347c32faa2ae93cbf Mon Sep 17 00:00:00 2001 From: Sam Roberts Date: Thu, 27 Jun 2019 14:39:15 -0700 Subject: [PATCH 2/2] tools: move python code out of jenkins shell https://ci.nodejs.org/job/node-test-commit-v8-linux/configure echoes python code into tools and runs it. Move these scripts into tools for better maintainability. Once this lands and is back-ported into LTS branches a bunch of shell code can be deleted from the job. --- tools/getarch.py | 10 ++++++++++ tools/getendian.py | 4 ++++ tools/getmachine.py | 3 +++ tools/getnodeversion.py | 1 + 4 files changed, 18 insertions(+) create mode 100644 tools/getarch.py create mode 100644 tools/getendian.py create mode 100644 tools/getmachine.py diff --git a/tools/getarch.py b/tools/getarch.py new file mode 100644 index 00000000000000..3c366525463340 --- /dev/null +++ b/tools/getarch.py @@ -0,0 +1,10 @@ +from __future__ import print_function +from utils import GuessArchitecture +arch = GuessArchitecture() + +# assume 64 bit unless set specifically +print(GuessArchitecture() \ + .replace('ia32', 'x64') \ + .replace('ppc', 'ppc64') \ + .replace('arm', 'arm64') \ + .replace('s390', 's390x')) diff --git a/tools/getendian.py b/tools/getendian.py new file mode 100644 index 00000000000000..0f9fcc1c860584 --- /dev/null +++ b/tools/getendian.py @@ -0,0 +1,4 @@ +from __future__ import print_function +import sys +# "little" or "big" +print(sys.byteorder) diff --git a/tools/getmachine.py b/tools/getmachine.py new file mode 100644 index 00000000000000..046d8b17a797fd --- /dev/null +++ b/tools/getmachine.py @@ -0,0 +1,3 @@ +from __future__ import print_function +import platform +print(platform.machine()) diff --git a/tools/getnodeversion.py b/tools/getnodeversion.py index 59f8aabe49eceb..c9f82160c0f386 100644 --- a/tools/getnodeversion.py +++ b/tools/getnodeversion.py @@ -1,3 +1,4 @@ +from __future__ import print_function import os import re