From 7991790f94bc3e927c36df2dd1caeb1aeab9b8c4 Mon Sep 17 00:00:00 2001 From: Jay Lee Date: Fri, 11 Oct 2019 19:51:36 -0400 Subject: [PATCH] reformat linux x86 before install, attempt to fix ruby on arm64 --- src/travis/linux-arm64-before-install.sh | 4 + src/travis/linux-x86_64-before-install.sh | 150 +++++++++++----------- src/travis/linux-x86_64-install.sh | 1 - 3 files changed, 76 insertions(+), 79 deletions(-) diff --git a/src/travis/linux-arm64-before-install.sh b/src/travis/linux-arm64-before-install.sh index 40b63580..9790f3ba 100755 --- a/src/travis/linux-arm64-before-install.sh +++ b/src/travis/linux-arm64-before-install.sh @@ -72,3 +72,7 @@ echo "Upgrading pip packages..." $pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 $pip install -U $pip install --upgrade -r src/requirements.txt $pip install --upgrade pyinstaller + +mkdir ~/.ruby +export GEM_HOME=~/.ruby +export "$PATH:~/.ruby/bin" diff --git a/src/travis/linux-x86_64-before-install.sh b/src/travis/linux-x86_64-before-install.sh index be1cf4a5..58f79648 100755 --- a/src/travis/linux-x86_64-before-install.sh +++ b/src/travis/linux-x86_64-before-install.sh @@ -7,95 +7,89 @@ else export whereibelong=$(pwd) export dist=$(lsb_release --codename --short) echo "We are running on Ubuntu $dist" - echo "RUNNING: apt update..." - sudo apt-get -qq --yes update > /dev/null - echo "RUNNING: apt dist-upgrade..." -# sudo apt-get -qq --yes dist-upgrade > /dev/null - echo "Installing build tools..." - sudo apt-get -qq --yes install build-essential + export LD_LIBRARY_PATH=~/ssl/lib:~/python/lib + SSLVER=$(~/ssl/bin/openssl version) + SSLRESULT=$? + PYVER=$(~/python/bin/python -V) + PYRESULT=$? + if [[ "$SSLRESULT" != "0" ]] || [[ "$SSLVER" != *"$BUILD_OPENSSL_VERSION"* ]] || [[ "$PYRESULT" != "0" ]] || [[ "$PYVER" != *"$PYTHON_BUILD_VERSION"* ]]; then + echo "RUNNING: apt update..." + sudo apt-get -qq --yes update > /dev/null + echo "RUNNING: apt dist-upgrade..." + sudo apt-get -qq --yes dist-upgrade > /dev/null + echo "Installing build tools..." + sudo apt-get -qq --yes install build-essential + echo "Installing deps for python3" + sudo cp -v /etc/apt/sources.list /tmp + sudo chmod a+rwx /tmp/sources.list + echo "deb-src http://archive.ubuntu.com/ubuntu/ $dist main" >> /tmp/sources.list + sudo cp -v /tmp/sources.list /etc/apt + sudo apt-get -qq --yes update > /dev/null + sudo apt-get -qq --yes build-dep python3 > /dev/null + mypath=$HOME + echo "My Path is $mypath" + cpucount=$(nproc --all) + echo "This device has $cpucount CPUs for compiling..." - echo "Installing deps for python3" - sudo cp -v /etc/apt/sources.list /tmp - sudo chmod a+rwx /tmp/sources.list - echo "deb-src http://archive.ubuntu.com/ubuntu/ $dist main" >> /tmp/sources.list - sudo cp -v /tmp/sources.list /etc/apt - sudo apt-get -qq --yes update > /dev/null - sudo apt-get -qq --yes build-dep python3 > /dev/null - - mypath=$HOME - echo "My Path is $mypath" - cpucount=$(nproc --all) - echo "This device has $cpucount CPUs for compiling..." - - cd ~/pybuild - # Compile latest OpenSSL - if [ ! -d openssl-$BUILD_OPENSSL_VERSION ]; then + # Compile latest OpenSSL wget --quiet https://www.openssl.org/source/openssl-$BUILD_OPENSSL_VERSION.tar.gz echo "Extracting OpenSSL..." tar xf openssl-$BUILD_OPENSSL_VERSION.tar.gz - fi - cd openssl-$BUILD_OPENSSL_VERSION - echo "Compiling OpenSSL $BUILD_OPENSSL_VERSION..." - ./config shared --prefix=$mypath/ssl - echo "Running make for OpenSSL..." - make -j$cpucount -s - echo "Running make install for OpenSSL..." - make install > /dev/null - export LD_LIBRARY_PATH=~/ssl/lib - cd ~ + cd openssl-$BUILD_OPENSSL_VERSION + echo "Compiling OpenSSL $BUILD_OPENSSL_VERSION..." + ./config shared --prefix=$mypath/ssl + echo "Running make for OpenSSL..." + make -j$cpucount -s + echo "Running make install for OpenSSL..." + make install > /dev/null + cd ~ - cd ~/pybuild - # Compile latest Python - if [ ! -d Python-$BUILD_PYTHON_VERSION ]; then + # Compile latest Python echo "Downloading Python $BUILD_PYTHON_VERSION..." curl -O https://www.python.org/ftp/python/$BUILD_PYTHON_VERSION/Python-$BUILD_PYTHON_VERSION.tar.xz echo "Extracting Python..." tar xf Python-$BUILD_PYTHON_VERSION.tar.xz - fi - cd Python-$BUILD_PYTHON_VERSION - echo "Compiling Python $BUILD_PYTHON_VERSION..." - safe_flags="--with-openssl=$mypath/ssl --enable-shared --prefix=$mypath/python --with-ensurepip=upgrade" - unsafe_flags="--enable-optimizations --with-lto" - if [ ! -e Makefile ]; then - echo "running configure with safe and unsafe" - ./configure $safe_flags $unsafe_flags > /dev/null - fi - make -j$cpucount PROFILE_TASK="-m test.regrtest --pgo -j$(( $cpucount * 2 ))" -s - RESULT=$? - echo "First make exited with $RESULT" - if [ $RESULT != 0 ]; then - echo "Trying Python compile again without unsafe flags..." - make clean - ./configure $safe_flags > /dev/null - make -j$cpucount -s - echo "Sticking with safe Python for now..." - fi - echo "Installing Python..." - make install > /dev/null - cd ~ - - export LD_LIBRARY_PATH=~/ssl/lib:~/python/lib - python=~/python/bin/python3 - pip=~/python/bin/pip3 - - $python -V - - if [[ "$dist" == "precise" ]]; then - echo "Installing deps for StaticX..." - sudo apt-get install --yes scons - if [ ! -d patchelf-$PATCHELF_VERSION ]; then - echo "Downloading PatchELF $PATCHELF_VERSION" - wget https://nixos.org/releases/patchelf/patchelf-$PATCHELF_VERSION/patchelf-$PATCHELF_VERSION.tar.bz2 - tar xf patchelf-$PATCHELF_VERSION.tar.bz2 - cd patchelf-$PATCHELF_VERSION - ./configure - make - sudo make install + cd Python-$BUILD_PYTHON_VERSION + echo "Compiling Python $BUILD_PYTHON_VERSION..." + safe_flags="--with-openssl=$mypath/ssl --enable-shared --prefix=$mypath/python --with-ensurepip=upgrade" + unsafe_flags="--enable-optimizations --with-lto" + if [ ! -e Makefile ]; then + echo "running configure with safe and unsafe" + ./configure $safe_flags $unsafe_flags > /dev/null fi - $pip install git+https://github.com/JonathonReinhart/staticx.git@master - fi - cd $whereibelong + make -j$cpucount PROFILE_TASK="-m test.regrtest --pgo -j$(( $cpucount * 2 ))" -s + RESULT=$? + echo "First make exited with $RESULT" + if [ $RESULT != 0 ]; then + echo "Trying Python compile again without unsafe flags..." + make clean + ./configure $safe_flags > /dev/null + make -j$cpucount -s + echo "Sticking with safe Python for now..." + fi + echo "Installing Python..." + make install > /dev/null + cd ~ fi +python=~/python/bin/python3 +pip=~/python/bin/pip3 +$python -V + +if [[ "$dist" == "precise" ]]; then + echo "Installing deps for StaticX..." + sudo apt-get install --yes scons + if [ ! -d patchelf-$PATCHELF_VERSION ]; then + echo "Downloading PatchELF $PATCHELF_VERSION" + wget https://nixos.org/releases/patchelf/patchelf-$PATCHELF_VERSION/patchelf-$PATCHELF_VERSION.tar.bz2 + tar xf patchelf-$PATCHELF_VERSION.tar.bz2 + cd patchelf-$PATCHELF_VERSION + ./configure + make + sudo make install + fi + $pip install git+https://github.com/JonathonReinhart/staticx.git@master +fi +cd $whereibelong echo "Upgrading pip packages..." $pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 $pip install -U diff --git a/src/travis/linux-x86_64-install.sh b/src/travis/linux-x86_64-install.sh index d8c0c1a9..203b9169 100755 --- a/src/travis/linux-x86_64-install.sh +++ b/src/travis/linux-x86_64-install.sh @@ -29,5 +29,4 @@ else du -h gam/gam time $gam version extended fi - fi