From 9ddb0d76504f17d82d14e87507827051f99e97c2 Mon Sep 17 00:00:00 2001 From: TheAssassin Date: Sat, 28 Sep 2019 01:33:45 +0200 Subject: [PATCH 1/8] Remove old debug code --- travis/build-centos6.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/travis/build-centos6.sh b/travis/build-centos6.sh index b020790..afc648e 100755 --- a/travis/build-centos6.sh +++ b/travis/build-centos6.sh @@ -17,8 +17,6 @@ LINUXDEPLOY_ARGS=("--appdir" "AppDir" "-e" "bin/linuxdeploy" "-i" "/ws/resources # deploy patchelf which is a dependency of linuxdeploy bin/linuxdeploy "${LINUXDEPLOY_ARGS[@]}" -tar cfvz /out/appdir.tgz AppDir - # cannot add appimage plugin yet, since it won't work on CentOS 6 (at least for now) # therefore we also need to use appimagetool directly to build an AppImage # but we can still prepare the AppDir From 543078c11e84ad29cfe3e3db921a78ed55a85df9 Mon Sep 17 00:00:00 2001 From: TheAssassin Date: Sat, 28 Sep 2019 03:47:05 +0200 Subject: [PATCH 2/8] Clean up Dockerfile --- travis/Dockerfile.centos6-i386 | 5 ----- 1 file changed, 5 deletions(-) diff --git a/travis/Dockerfile.centos6-i386 b/travis/Dockerfile.centos6-i386 index 432836d..407c414 100644 --- a/travis/Dockerfile.centos6-i386 +++ b/travis/Dockerfile.centos6-i386 @@ -28,11 +28,6 @@ RUN git clone https://github.com/Kitware/CMake && \ make install && \ cd .. && \ rm -r CMake/ -# wget https://github.com/Kitware/CMake/releases/download/v3.13.4/cmake-3.13.4-Linux-x86_64.tar.gz -O- | tar xz --strip-components=1 -C/usr/local - -#RUN wget http://springdale.math.ias.edu/data/puias/computational/6/x86_64//patchelf-0.8-2.sdl6.x86_64.rpm && \ -# echo "3d746306f5f7958b9487e6d08f53bb13 patchelf-0.8-2.sdl6.x86_64.rpm" || md5sum -c && \ -# rpm -i patchelf-0.8-2.sdl6.x86_64.rpm RUN yum install -y gcc-c++ && \ git clone https://github.com/NixOS/patchelf.git && \ From f97d1e9a010021d60c9863ac33dfaeb092cd83fa Mon Sep 17 00:00:00 2001 From: TheAssassin Date: Sat, 28 Sep 2019 03:47:24 +0200 Subject: [PATCH 3/8] Improve shell use of Docker images --- travis/Dockerfile.centos6 | 2 ++ travis/Dockerfile.centos6-i386 | 1 + 2 files changed, 3 insertions(+) diff --git a/travis/Dockerfile.centos6 b/travis/Dockerfile.centos6 index 7d81dfb..90578b4 100644 --- a/travis/Dockerfile.centos6 +++ b/travis/Dockerfile.centos6 @@ -20,3 +20,5 @@ RUN yum install -y gcc-c++ && \ make install && \ popd && \ rm -r patchelf/ + +CMD ["bash"] diff --git a/travis/Dockerfile.centos6-i386 b/travis/Dockerfile.centos6-i386 index 407c414..6c762c9 100644 --- a/travis/Dockerfile.centos6-i386 +++ b/travis/Dockerfile.centos6-i386 @@ -41,3 +41,4 @@ RUN yum install -y gcc-c++ && \ popd && \ rm -r patchelf/ +CMD ["bash"] From 019f902b176ab0e19f4a7088898635c3550a8c39 Mon Sep 17 00:00:00 2001 From: TheAssassin Date: Sat, 28 Sep 2019 03:48:18 +0200 Subject: [PATCH 4/8] Fix Docker build artifacts handling --- travis/build-centos6-docker.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/travis/build-centos6-docker.sh b/travis/build-centos6-docker.sh index 9a3952c..691737e 100755 --- a/travis/build-centos6-docker.sh +++ b/travis/build-centos6-docker.sh @@ -15,4 +15,4 @@ fi (cd "$here" && docker build -f "$DOCKERFILE" -t "$IMAGE" .) -docker run --rm -i -v "$here"/..:/ws:ro -v "$old_cwd":/out -e OUTDIR_OWNER=$(id -u) "$IMAGE" /bin/bash -xe /ws/travis/build-centos6.sh +docker run --rm -it -v "$here"/..:/ws:ro -v "$old_cwd":/out -e CI=1 -e OUTDIR_OWNER=$(id -u) "$IMAGE" /bin/bash -xe -c "cd /out && /ws/travis/build-centos6.sh" From 58189efba67eb3a56e96b73004f3f11dff687852 Mon Sep 17 00:00:00 2001 From: TheAssassin Date: Sat, 28 Sep 2019 03:48:53 +0200 Subject: [PATCH 5/8] Build binaries on CentOS 6 --- .travis.yml | 86 ++++++++++++++++++----------------------------------- 1 file changed, 29 insertions(+), 57 deletions(-) diff --git a/.travis.yml b/.travis.yml index e0190e0..9349496 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,30 +3,31 @@ sudo: required matrix: include: - - env: ARCH=x86_64 - addons: - apt: - update: true - packages: - - libmagic-dev - - libjpeg-dev - - libpng-dev - - cimg-dev - - automake # required for patchelf - - env: ARCH=i386 - addons: - apt: - update: true - packages: - - libmagic-dev:i386 - - libjpeg-dev:i386 - - libpng-dev:i386 - - gcc-multilib - - g++-multilib - - automake # required for patchelf - - libfuse2:i386 - - libcairo2:i386 - - env: ARCH=x86_64 BUILD_TYPE=coverage + - name: CentOS 6 x86_64 build + env: ARCH=x86_64 BUILD_TYPE=centos6 + install: true + services: + - docker + script: travis/build-centos6-docker.sh + after_success: + - if [ "$TRAVIS_BRANCH" != "$TRAVIS_TAG" ] && [ "$TRAVIS_BRANCH" != "master" ]; then export TRAVIS_EVENT_TYPE=pull_request; fi + - wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh + - bash upload.sh linuxdeploy-centos6-"$ARCH".AppImage* + + - name: CentOS 6 i386 build + env: ARCH=i386 BUILD_TYPE=centos6 + install: true + services: + - docker + script: travis/build-centos6-docker.sh + after_success: + - if [ "$TRAVIS_BRANCH" != "$TRAVIS_TAG" ] && [ "$TRAVIS_BRANCH" != "master" ]; then export TRAVIS_EVENT_TYPE=pull_request; fi + - wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh + - bash upload.sh linuxdeploy-centos6-"$ARCH".AppImage* + + - name: Ubuntu xenial x86_64 coverage build (no binaries uploaded) + env: ARCH=x86_64 BUILD_TYPE=coverage + dist: xenial addons: apt: update: true @@ -39,7 +40,10 @@ matrix: - sudo pip install gcovr script: travis/test-coverage.sh after_success: true # also, we don't intend to upload release binaries - - env: ARCH=i386 BUILD_TYPE=coverage + + - name: Ubuntu xenial i386 coverage build (no binaries uploaded) + env: ARCH=i386 BUILD_TYPE=coverage + dist: xenial addons: apt: update: true @@ -55,38 +59,6 @@ matrix: - sudo pip install gcovr script: travis/test-coverage.sh after_success: true # also, we don't intend to upload release binaries - - env: ARCH=x86_64 BUILD_TYPE=centos6 - install: true - services: - - docker - script: travis/build-centos6-docker.sh - after_success: - - if [ "$TRAVIS_BRANCH" != "$TRAVIS_TAG" ] && [ "$TRAVIS_BRANCH" != "master" ]; then export TRAVIS_EVENT_TYPE=pull_request; fi - - wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh - - bash upload.sh linuxdeploy-centos6-"$ARCH".AppImage* - - env: ARCH=i386 BUILD_TYPE=centos6 - install: true - services: - - docker - script: travis/build-centos6-docker.sh - after_success: - - if [ "$TRAVIS_BRANCH" != "$TRAVIS_TAG" ] && [ "$TRAVIS_BRANCH" != "master" ]; then export TRAVIS_EVENT_TYPE=pull_request; fi - - wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh - - bash upload.sh linuxdeploy-centos6-"$ARCH".AppImage* - -install: - - git clone https://github.com/NixOS/patchelf.git -b 0.8 - - cd patchelf - - ./bootstrap.sh - - if [ "$ARCH" == "i386" ]; then ./configure --prefix=/usr --build=i686-pc-linux-gnu CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32; fi - - if [ "$ARCH" == "x86_64" ]; then ./configure --prefix=/usr; fi - - make -j$(nproc) - - sudo make install - - cd .. - - rm -rf patchelf - -script: - - travis/build.sh after_success: - ls -lh From 103b637944a1617a7f9ab75af4f526e4ae4bc01c Mon Sep 17 00:00:00 2001 From: TheAssassin Date: Sat, 28 Sep 2019 03:49:15 +0200 Subject: [PATCH 6/8] Make CentOS 6 build script equivalent to old one --- travis/build-centos6.sh | 71 ++++++++++++++++++++++++++++++----------- 1 file changed, 53 insertions(+), 18 deletions(-) diff --git a/travis/build-centos6.sh b/travis/build-centos6.sh index afc648e..c0199ca 100755 --- a/travis/build-centos6.sh +++ b/travis/build-centos6.sh @@ -1,13 +1,34 @@ #! /bin/bash -set -xe +set -e +set -x -mkdir build -cd build +# use RAM disk if possible +if [ "$CI" == "" ] && [ -d /dev/shm ]; then + TEMP_BASE=/dev/shm +else + TEMP_BASE=/tmp +fi -cmake /ws -DCMAKE_INSTALL_PREFIX=/usr -DUSE_SYSTEM_CIMG=Off +BUILD_DIR=$(mktemp -d -p "$TEMP_BASE" linuxdeploy-build-XXXXXX) -make -j8 +cleanup () { + if [ -d "$BUILD_DIR" ]; then + rm -rf "$BUILD_DIR" + fi +} + +trap cleanup EXIT + +# store repo root as variable +REPO_ROOT=$(readlink -f $(dirname $(dirname "$0"))) +OLD_CWD=$(readlink -f .) + +pushd "$BUILD_DIR" + +cmake "$REPO_ROOT" -DCMAKE_INSTALL_PREFIX=/usr -DUSE_SYSTEM_CIMG=Off -DUSE_CCACHE=Off + +make -j$(nproc) ctest -V @@ -17,21 +38,35 @@ LINUXDEPLOY_ARGS=("--appdir" "AppDir" "-e" "bin/linuxdeploy" "-i" "/ws/resources # deploy patchelf which is a dependency of linuxdeploy bin/linuxdeploy "${LINUXDEPLOY_ARGS[@]}" -# cannot add appimage plugin yet, since it won't work on CentOS 6 (at least for now) -# therefore we also need to use appimagetool directly to build an AppImage -# but we can still prepare the AppDir -APPIMAGETOOL_ARCH="$ARCH" -if [ "$APPIMAGETOOL_ARCH" == "i386" ]; then APPIMAGETOOL_ARCH="i686"; fi +# bundle AppImage plugin +mkdir -p AppDir/plugins -wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-"$APPIMAGETOOL_ARCH".AppImage -chmod +x appimagetool-"$APPIMAGETOOL_ARCH".AppImage -sed -i 's/AI\x02/\x00\x00\x00/' appimagetool*.AppImage +wget https://github.com/TheAssassin/linuxdeploy-plugin-appimage/releases/download/continuous/linuxdeploy-plugin-appimage-"$ARCH".AppImage +chmod +x linuxdeploy-plugin-appimage-"$ARCH".AppImage +sed -i 's|AI\x02|\x00\x00\x00|' linuxdeploy*.AppImage +./linuxdeploy-plugin-appimage-"$ARCH".AppImage --appimage-extract +mv squashfs-root/ AppDir/plugins/linuxdeploy-plugin-appimage -appimage=linuxdeploy-centos6-"$ARCH".AppImage -./appimagetool-"$APPIMAGETOOL_ARCH".AppImage --appimage-extract -squashfs-root/AppRun AppDir "$appimage" 2>&1 +ln -s ../../plugins/linuxdeploy-plugin-appimage/AppRun AppDir/usr/bin/linuxdeploy-plugin-appimage -chown "$OUTDIR_OWNER" "$appimage" +export UPD_INFO="gh-releases-zsync|linuxdeploy|linuxdeploy|continuous|linuxdeploy-$ARCH.AppImage" +export OUTPUT=linuxdeploy-"$ARCH".AppImage -mv "$appimage" /out +# build AppImage using plugin +AppDir/usr/bin/linuxdeploy-plugin-appimage --appdir AppDir/ + +# rename AppImage to avoid "Text file busy" issues when using it to create another one +mv "$OUTPUT" test.AppImage +# also have to patch our test AppImage, but we can leave the newly produced one untouched +sed -i 's|AI\x02|\x00\x00\x00|' test.AppImage + +# verify that the resulting AppImage works +./test.AppImage --appimage-extract-and-run "${LINUXDEPLOY_ARGS[@]}" + +# check whether AppImage plugin is found and works +./test.AppImage --appimage-extract-and-run "${LINUXDEPLOY_ARGS[@]}" --output appimage + +chown "$OUTDIR_OWNER" "$OUTPUT" + +mv "$OUTPUT"* "$OLD_CWD"/ From cf5927c521e99abd850c1b787fe8128a88252a8a Mon Sep 17 00:00:00 2001 From: TheAssassin Date: Sat, 28 Sep 2019 03:49:57 +0200 Subject: [PATCH 7/8] Make sure old build script artifacts carry different name --- travis/build.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/travis/build.sh b/travis/build.sh index 9abc2c6..9dc2738 100755 --- a/travis/build.sh +++ b/travis/build.sh @@ -75,12 +75,13 @@ mv squashfs-root/ AppDir/plugins/linuxdeploy-plugin-appimage ln -s ../../plugins/linuxdeploy-plugin-appimage/AppRun AppDir/usr/bin/linuxdeploy-plugin-appimage export UPD_INFO="gh-releases-zsync|linuxdeploy|linuxdeploy|continuous|linuxdeploy-$ARCH.AppImage" +export OUTPUT="linuxdeploy-devbuild-$ARCH.AppImage" # build AppImage using plugin AppDir/usr/bin/linuxdeploy-plugin-appimage --appdir AppDir/ # rename AppImage to avoid "Text file busy" issues when using it to create another one -mv ./linuxdeploy-"$ARCH".AppImage test.AppImage +mv "$OUTPUT" test.AppImage # verify that the resulting AppImage works ./test.AppImage "${LINUXDEPLOY_ARGS[@]}" @@ -88,4 +89,4 @@ mv ./linuxdeploy-"$ARCH".AppImage test.AppImage # check whether AppImage plugin is found and works ./test.AppImage "${LINUXDEPLOY_ARGS[@]}" --output appimage -mv linuxdeploy-"$ARCH".AppImage* "$OLD_CWD" +mv "$OUTPUT"* "$OLD_CWD"/ From 058832615c532267f1de05734d7d16e0977c2e0a Mon Sep 17 00:00:00 2001 From: TheAssassin Date: Sat, 28 Sep 2019 04:02:00 +0200 Subject: [PATCH 8/8] Fix binaries upload --- .travis.yml | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9349496..182321d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ matrix: after_success: - if [ "$TRAVIS_BRANCH" != "$TRAVIS_TAG" ] && [ "$TRAVIS_BRANCH" != "master" ]; then export TRAVIS_EVENT_TYPE=pull_request; fi - wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh - - bash upload.sh linuxdeploy-centos6-"$ARCH".AppImage* + - bash upload.sh linuxdeploy-"$ARCH".AppImage* - name: CentOS 6 i386 build env: ARCH=i386 BUILD_TYPE=centos6 @@ -23,7 +23,7 @@ matrix: after_success: - if [ "$TRAVIS_BRANCH" != "$TRAVIS_TAG" ] && [ "$TRAVIS_BRANCH" != "master" ]; then export TRAVIS_EVENT_TYPE=pull_request; fi - wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh - - bash upload.sh linuxdeploy-centos6-"$ARCH".AppImage* + - bash upload.sh linuxdeploy-"$ARCH".AppImage* - name: Ubuntu xenial x86_64 coverage build (no binaries uploaded) env: ARCH=x86_64 BUILD_TYPE=coverage @@ -60,13 +60,6 @@ matrix: script: travis/test-coverage.sh after_success: true # also, we don't intend to upload release binaries -after_success: - - ls -lh - # make sure only pushes to rewrite create a new release, otherwise pretend PR and upload to transfer.sh - - if [ "$TRAVIS_BRANCH" != "$TRAVIS_TAG" ] && [ "$TRAVIS_BRANCH" != "master" ]; then export TRAVIS_EVENT_TYPE=pull_request; fi - - wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh - - bash upload.sh linuxdeploy-"$ARCH".AppImage* - branches: except: - # Do not build tags that we create when we upload to GitHub Releases