2017.06.07 22:30 "[Tiff] [PATCH] Windows CI support for GitHub and AppVeyor", by Roger Leigh

2017.06.09 22:00 "Re: [Tiff] [PATCH] Unix/Linux CI support for GitHub and Travis", by Roger Leigh

On 09/06/17 22:23, Even Rouault wrote:

> On vendredi 9 juin 2017 22:10:49 CEST Roger Leigh wrote:
>
> > On 09/06/17 14:18, Bob Friesenhahn wrote:
>
> > > On Fri, 9 Jun 2017, rleigh@codelibre.net wrote:
>
> > >> Thank you. One problem I noticed is that the build/travis-ci script
>
> > >> does not have executable permissions, which is needed to build. I
>
> > >> think with CVS that requires a chmod +x of the ,v file in the
>
> > >> repository if was not set when initially added.
>
> > >
>
> > > This seems to be a shell script which wants to be run with /bin/sh. As
>
> > > such, it could be executed like '/bin/sh build/travis-ci' (or whatever
>
> > > is needed for the context in which it is used) without any execute bits
>
> > > set. This would also help for operating systems or filesystems which
>
> > > have no notion of an execute bit.
>
> >
>
> > If it's not possible to tweak the executable bit, I can certainly switch
>
> > to invoking the script by hand. Since it's only ever going to be run on
>
> > Unix platforms via the .travis.yml, we don't need to worry about
>
> > filesystems with no execute bit.
>

> Yes please do so. The adminstrator has just informed me that they have > issues to SSH connect to the server currently.

That doesn't sound good, hope they regain access soon. Related to that, is there any plan to move fully over to git? The existing mirror works pretty well; all my recent patches are generated directly with it. Could we create a libtiff organisation on GitHub or GitLab? Unfortunately, "libtiff" is taken on github, as is "tiff". But libtiff is available on GitLab.

I've attached the patches to invoke the script directly (0002) plus the original fixes (0001).

Regards,
Roger

From 83528f1c8a3b24c4a7c513e1c76e0ed89d27d52d Mon Sep 17 00:00:00 2001

From: Roger Leigh <rleigh@dundee.ac.uk>

Date: Fri, 9 Jun 2017 10:55:12 +0100 Subject: [PATCH 1/2] ci: Travis script improvements

---

 .appveyor.yml   |  8 +++++++-
 .travis.yml     | 11 +++++++----
 build/travis-ci | 38 ++++++++++++++++++++++++++++----------

 3 files changed, 42 insertions(+), 15 deletions(-)

diff --git a/.appveyor.yml b/.appveyor.yml

index fb534236..e5af6c98 100644
--- a/.appveyor.yml

+++ b/.appveyor.yml

@@ -7,24 +7,31 @@ environment:

  matrix:

     - compiler: cygwin-cmake
+ configuration: Release

      generator: Unix Makefiles

      shared: ON

     - compiler: cygwin-cmake

+ configuration: Debug

      generator: Unix Makefiles

      shared: OFF

     - compiler: mingw64-cmake
+ configuration: Release

      generator: Unix Makefiles

      shared: ON

     - compiler: mingw64-cmake

+ configuration: Debug

      generator: Unix Makefiles

      shared: OFF

     - compiler: vc14-cmake
+ configuration: Release

      generator: Visual Studio 14 2015 Win64

      shared: ON

     - compiler: vc14-cmake

+ configuration: Debug

      generator: Visual Studio 14 2015 Win64

      shared: OFF

     - compiler: vc14-nmake
+ configuration: Release

 cache:

  - 'c:\projects\download -> appveyor.yml'

@@ -37,7 +44,6 @@ clone_folder: 'c:\projects\libtiff'
 clone_depth: 5

 platform: x64

-configuration: Release

 init:

  - git config --global core.autocrlf input

diff --git a/.travis.yml b/.travis.yml
index 9b371162..e438945c 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -14,18 +14,21 @@ addons:

    - compiler:

+os:
+  - linux
+  - osx

 env:
   matrix:
     - BUILD=autoconf

+ - BUILD=cmake TOOL="Ninja" TYPE=Debug

 matrix:
   fast_finish: true
+ exclude:

+    - os: linux
+      env: BUILD=cmake TOOL="Ninja" TYPE=Debug NETACCESSOR=cfurl TRANSCODER=macosunicodeconverter

 script:
   - ./build/travis-ci "$BUILD" "$TOOL" "$TYPE"
diff --git a/build/travis-ci b/build/travis-ci
index c34791a1..18ef90a5 100644
--- a/build/travis-ci
+++ b/build/travis-ci
@@ -8,9 +8,12 @@ set -x
 # Test autoconf build
 autoconf_build()
 {
+ autoreconf -ivf
+
     mkdir autoconf-build
     cd autoconf-build

-    ../configure --prefix=$(readlink -f ../autoconf-install)
+    echo "Running ../configure --prefix=$(pwd)/../autoconf-install) ${opts}"
+    ../configure --prefix=$(pwd)/../autoconf-install ${opts}

     make
     make install
     make check
@@ -22,19 +25,29 @@ cmake_deps()
     mkdir -p download
     mkdir -p tools

-    cmake_file="cmake-3.8.2-Linux-x86_64.tar.gz"
+    if [ "$(uname -s)" = "Linux" ]; then
+        cmake_file="cmake-3.8.2-Linux-x86_64.tar.gz"

+        cmake_hash="574673d3f37b0be6a0813b894a8bce9c4af08c13f1ec25c030a69f42e0e4b349e0192385ef20c8a9271055b7c3b24c5b20fb5009762131a3fba3d17576e641f1"
+    elif [ "$(uname -s)" = "Darwin" ]; then
+        cmake_file="cmake-3.8.2-Darwin-x86_64.tar.gz"
+        cmake_hash="fd1c09dd73fe2b23fdc9ac915a90343d2e27409182dd1f2bf509ddf54ca926f97e1906fc18f119e8ea52797c05d4b919772f43500bffbcf2c3cdc86828d9067e"
+    fi
     cmake_url="https://cmake.org/files/v3.8/${cmake_file}"
-    cmake_hash="574673d3f37b0be6a0813b894a8bce9c4af08c13f1ec25c030a69f42e0e4b349e0192385ef20c8a9271055b7c3b24c5b20fb5009762131a3fba3d17576e641f1"

-    ninja_file="ninja-linux.zip"
+    if [ "$(uname -s)" = "Linux" ]; then
+        ninja_file="ninja-linux.zip"
+        ninja_hash="2dddc52750c5e6f841acd0d978b894c9a6562f12ddb4ba9e5118a213f54265f065682ffe1bc7bc2ac6146760145d17800a4b7373791cd1fbbaf0836faf050e19"
+    elif [ "$(uname -s)" = "Darwin" ]; then
+        ninja_file="ninja-mac.zip"
+        ninja_hash="e008c9814447bbf356be7f2daf6d212657fb22b67e7de3885bd2f27766cd7c8a2ad61a4aace170674464ccf55813cbe2bf311485bc2058e89867f17b692642b9"
+    fi
     ninja_url="https://github.com/ninja-build/ninja/releases/download/v1.7.2/${ninja_file}"
-    ninja_hash="2dddc52750c5e6f841acd0d978b894c9a6562f12ddb4ba9e5118a213f54265f065682ffe1bc7bc2ac6146760145d17800a4b7373791cd1fbbaf0836faf050e19"

     (
         cd download

-        if [ ! -f "$cmake_file" ] || [ "$(sha512sum "$cmake_file")" != "$cmake_hash  $cmake_file" ]; then
+        if [ ! -f "$cmake_file" ] || [ "$(shasum -a 512 "$cmake_file")" != "$cmake_hash  $cmake_file" ]; then

             wget "$cmake_url"
-            if [ "$(sha512sum "$cmake_file")" != "$cmake_hash  $cmake_file" ]; then
+            if [ "$(shasum -a 512 "$cmake_file")" != "$cmake_hash  $cmake_file" ]; then

                 echo "Error: cmake download hash mismatch" >&2
                 exit 1
             fi
@@ -43,14 +56,15 @@ cmake_deps()
         cp -a ${cmake_file%.tar.gz}/* ../tools

         if [ "$1" = "Ninja" ]; then

-            if [ ! -f "$ninja_file" ] || [ "$(sha512sum "$ninja_file")" != "$ninja_hash  $ninja_file" ]; then
+            if [ ! -f "$ninja_file" ] || [ "$(shasum -a 512 "$ninja_file")" != "$ninja_hash  $ninja_file" ]; then

                 wget "$ninja_url"
-                if [ "$(sha512sum "$ninja_file")" != "$ninja_hash  $ninja_file" ]; then
+                if [ "$(shasum -a 512 "$ninja_file")" != "$ninja_hash  $ninja_file" ]; then

                     echo "Error: ninja download hash mismatch" >&2
                     exit 1
                 fi
             fi
             unzip "$ninja_file"
+ mkdir -p ../tools/bin
             mv ninja ../tools/bin
         fi
     )
@@ -60,9 +74,13 @@ cmake_deps()
 cmake_build()
 {
     PATH="$(pwd)/tools/bin:$PATH"

+    if [ "$(uname -s)" = "Darwin" ]; then
+        PATH="$(pwd)/tools/CMake.app/Contents/bin:$PATH"
+    fi
     mkdir cmake-build
     cd cmake-build
-    cmake -G "$1" -DCMAKE_BUILD_TYPE="$2" -DCMAKE_INSTALL_PREFIX=../autoconf-install ..
+    echo "Running cmake -G "$1" -DCMAKE_BUILD_TYPE="$2" -DCMAKE_INSTALL_PREFIX=../autoconf-install ${opts} .."
+    cmake -G "$1" -DCMAKE_BUILD_TYPE="$2" -DCMAKE_INSTALL_PREFIX=../autoconf-install ${opts} ..

     cmake --build.
     cmake --build. --target install
     ctest -V
--
2.13.0

Subject: [PATCH 2/2] ci: Invoke helper script via shell

---
 .travis.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.travis.yml b/.travis.yml

index e438945c..b18ea5c5 100644

--- a/.travis.yml
+++ b/.travis.yml

@@ -31,4 +31,4 @@ matrix:

      env: BUILD=cmake TOOL="Ninja" TYPE=Debug NETACCESSOR=cfurl TRANSCODER=macosunicodeconverter

 script:
   -

--
2.13.0