From 16b3f4d2921ca702ec12b14a5203412fa2168fab Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Mon, 25 May 2020 22:08:33 -0400 Subject: [PATCH 01/64] Test workflow for OSGeo4W --- .github/workflows/osgeo4w.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/osgeo4w.yml diff --git a/.github/workflows/osgeo4w.yml b/.github/workflows/osgeo4w.yml new file mode 100644 index 00000000000..8bea94b545a --- /dev/null +++ b/.github/workflows/osgeo4w.yml @@ -0,0 +1,22 @@ +name: OSGeo4W + +on: +- push +- pull_request + +jobs: + build: + name: ${{ matrix.os }} build + + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: + - windows-latest + fail-fast: false + + steps: + - uses: actions/checkout@v2 + - name: Get dependencies + run: | + wget From b894b70d40bb9eb01f77622b3d533abdfa0928b1 Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Mon, 25 May 2020 22:11:09 -0400 Subject: [PATCH 02/64] Test workflow for OSGeo4W --- .github/workflows/osgeo4w.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/osgeo4w.yml b/.github/workflows/osgeo4w.yml index 8bea94b545a..15e119ffb03 100644 --- a/.github/workflows/osgeo4w.yml +++ b/.github/workflows/osgeo4w.yml @@ -19,4 +19,4 @@ jobs: - uses: actions/checkout@v2 - name: Get dependencies run: | - wget + dir \ From edcfa53a54aad7e4b6d3a20f5482809f185bec38 Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Thu, 28 May 2020 09:34:13 -0400 Subject: [PATCH 03/64] Try installing OSGeo4W --- .github/workflows/osgeo4w.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/osgeo4w.yml b/.github/workflows/osgeo4w.yml index 15e119ffb03..0f3e8cd3312 100644 --- a/.github/workflows/osgeo4w.yml +++ b/.github/workflows/osgeo4w.yml @@ -19,4 +19,7 @@ jobs: - uses: actions/checkout@v2 - name: Get dependencies run: | - dir \ + choco install wget + wget http://download.osgeo.org/osgeo4w/osgeo4w-setup-x86_64.exe + osgeo4w-setup-x86_64.exe -A -g -k -q -s http://download.osgeo.org/x86_64 -P cairo,fftw,freetype-devel,gdal-ecw,gdal-mrsid,liblas-devel,libxdr,msys,pdcurses,python3-numpy,python3-pywin32,python3-wx,regex-devel,wxpython,zstd-devel + dir c:\OSGeo4W64 From 37bc65203190fc86cfffc1b27e1187092237e9cc Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Thu, 28 May 2020 09:43:16 -0400 Subject: [PATCH 04/64] Try installing OSGeo4W --- .github/workflows/osgeo4w.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/osgeo4w.yml b/.github/workflows/osgeo4w.yml index 0f3e8cd3312..2aaf05cad47 100644 --- a/.github/workflows/osgeo4w.yml +++ b/.github/workflows/osgeo4w.yml @@ -19,7 +19,9 @@ jobs: - uses: actions/checkout@v2 - name: Get dependencies run: | - choco install wget - wget http://download.osgeo.org/osgeo4w/osgeo4w-setup-x86_64.exe + $url = "http://download.osgeo.org/osgeo4w/osgeo4w-setup-x86_64.exe" + $output = "osgeo4w-setup-x86_64.exe" + (New-Object System.Net.WebClient).DownloadFile($url, $output) + dir osgeo4w-setup-x86_64.exe -A -g -k -q -s http://download.osgeo.org/x86_64 -P cairo,fftw,freetype-devel,gdal-ecw,gdal-mrsid,liblas-devel,libxdr,msys,pdcurses,python3-numpy,python3-pywin32,python3-wx,regex-devel,wxpython,zstd-devel dir c:\OSGeo4W64 From 87dd0b9452795026bd9c654ede468cd519b44eeb Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Thu, 28 May 2020 09:45:51 -0400 Subject: [PATCH 05/64] Try installing OSGeo4W --- .github/workflows/osgeo4w.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/osgeo4w.yml b/.github/workflows/osgeo4w.yml index 2aaf05cad47..98432547306 100644 --- a/.github/workflows/osgeo4w.yml +++ b/.github/workflows/osgeo4w.yml @@ -22,6 +22,5 @@ jobs: $url = "http://download.osgeo.org/osgeo4w/osgeo4w-setup-x86_64.exe" $output = "osgeo4w-setup-x86_64.exe" (New-Object System.Net.WebClient).DownloadFile($url, $output) - dir - osgeo4w-setup-x86_64.exe -A -g -k -q -s http://download.osgeo.org/x86_64 -P cairo,fftw,freetype-devel,gdal-ecw,gdal-mrsid,liblas-devel,libxdr,msys,pdcurses,python3-numpy,python3-pywin32,python3-wx,regex-devel,wxpython,zstd-devel + .\osgeo4w-setup-x86_64.exe -A -g -k -q -s http://download.osgeo.org/x86_64 -P cairo,fftw,freetype-devel,gdal-ecw,gdal-mrsid,liblas-devel,libxdr,msys,pdcurses,python3-numpy,python3-pywin32,python3-wx,regex-devel,wxpython,zstd-devel dir c:\OSGeo4W64 From cc90b66e86ece19017a68732a174e6e1b123003f Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Thu, 28 May 2020 09:51:02 -0400 Subject: [PATCH 06/64] Try installing OSGeo4W --- .github/workflows/osgeo4w.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/osgeo4w.yml b/.github/workflows/osgeo4w.yml index 98432547306..7320d42f19a 100644 --- a/.github/workflows/osgeo4w.yml +++ b/.github/workflows/osgeo4w.yml @@ -22,5 +22,5 @@ jobs: $url = "http://download.osgeo.org/osgeo4w/osgeo4w-setup-x86_64.exe" $output = "osgeo4w-setup-x86_64.exe" (New-Object System.Net.WebClient).DownloadFile($url, $output) - .\osgeo4w-setup-x86_64.exe -A -g -k -q -s http://download.osgeo.org/x86_64 -P cairo,fftw,freetype-devel,gdal-ecw,gdal-mrsid,liblas-devel,libxdr,msys,pdcurses,python3-numpy,python3-pywin32,python3-wx,regex-devel,wxpython,zstd-devel + mkdir c:\OSGeo4W dir c:\OSGeo4W64 From 07346df450efe406fa2d093a21099e225c011f43 Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Thu, 28 May 2020 09:59:35 -0400 Subject: [PATCH 07/64] Try installing OSGeo4W --- .github/workflows/osgeo4w.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/osgeo4w.yml b/.github/workflows/osgeo4w.yml index 7320d42f19a..23ff937387f 100644 --- a/.github/workflows/osgeo4w.yml +++ b/.github/workflows/osgeo4w.yml @@ -22,5 +22,5 @@ jobs: $url = "http://download.osgeo.org/osgeo4w/osgeo4w-setup-x86_64.exe" $output = "osgeo4w-setup-x86_64.exe" (New-Object System.Net.WebClient).DownloadFile($url, $output) - mkdir c:\OSGeo4W + mkdir c:\OSGeo4W64 dir c:\OSGeo4W64 From a77b60c63b55b077eabd2cd88d58bc79012b7949 Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Thu, 28 May 2020 10:07:32 -0400 Subject: [PATCH 08/64] Try installing OSGeo4W --- .github/workflows/osgeo4w.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/osgeo4w.yml b/.github/workflows/osgeo4w.yml index 23ff937387f..7d5069e8676 100644 --- a/.github/workflows/osgeo4w.yml +++ b/.github/workflows/osgeo4w.yml @@ -22,5 +22,4 @@ jobs: $url = "http://download.osgeo.org/osgeo4w/osgeo4w-setup-x86_64.exe" $output = "osgeo4w-setup-x86_64.exe" (New-Object System.Net.WebClient).DownloadFile($url, $output) - mkdir c:\OSGeo4W64 - dir c:\OSGeo4W64 + .\osgeo4w-setup-x86_64.exe -A -g -k -q -s http://download.osgeo.org/x86_64 -P cairo,fftw,freetype-devel,gdal-ecw,gdal-mrsid,liblas-devel,libxdr,msys,pdcurses,python3-numpy,python3-pywin32,python3-wx,regex-devel,wxpython,zstd-devel From 545cd39701c62b0e0ab8b93a543e12e733d0390f Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Thu, 4 Jun 2020 12:40:14 -0400 Subject: [PATCH 09/64] Let's try configure --- .github/workflows/osgeo4w.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/osgeo4w.yml b/.github/workflows/osgeo4w.yml index 7d5069e8676..2d2ecfef287 100644 --- a/.github/workflows/osgeo4w.yml +++ b/.github/workflows/osgeo4w.yml @@ -17,9 +17,14 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Get dependencies + - name: Install OSGeo4W run: | - $url = "http://download.osgeo.org/osgeo4w/osgeo4w-setup-x86_64.exe" - $output = "osgeo4w-setup-x86_64.exe" - (New-Object System.Net.WebClient).DownloadFile($url, $output) - .\osgeo4w-setup-x86_64.exe -A -g -k -q -s http://download.osgeo.org/x86_64 -P cairo,fftw,freetype-devel,gdal-ecw,gdal-mrsid,liblas-devel,libxdr,msys,pdcurses,python3-numpy,python3-pywin32,python3-wx,regex-devel,wxpython,zstd-devel + $exe = 'osgeo4w-setup-x86_64.exe' + $url = 'http://download.osgeo.org/osgeo4w/' + $exe + (New-Object System.Net.WebClient).DownloadFile($url, $exe) + &$exe -A -g -k -q -s http://download.osgeo.org/x86_64 -P cairo,fftw,freetype-devel,gdal-ecw,gdal-mrsid,liblas-devel,libxdr,msys,pdcurses,python3-numpy,python3-pywin32,python3-wx,regex-devel,wxpython,zstd-devel + - name: Configure GRASS GIS + run: | + echo $MINGW_CHOST + ./configure --host=$MINGW_CHOST --with-include=/c/OSGeo4W64/include --with-libs="/c/OSGeo4W64/lib /c/OSGeo4W64/bin" --with-nls --with-freetype-include=/c/OSGeo4W64/include/freetype2 --with-bzlib --with-geos=mswindows/osgeo4w/geos-config --with-netcdf=/c/OSGeo4W64/bin/nc-config --with-gdal=mswindows/osgeo4w/gdal-config --with-liblas=mswindows/osgeo4w/liblas-config --with-opengl=windows + shell: bash From 77be2baede1715f0e1636c291d5cb03afda804f1 Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Thu, 4 Jun 2020 12:46:11 -0400 Subject: [PATCH 10/64] Fix run --- .github/workflows/osgeo4w.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/osgeo4w.yml b/.github/workflows/osgeo4w.yml index 2d2ecfef287..6e6f47da994 100644 --- a/.github/workflows/osgeo4w.yml +++ b/.github/workflows/osgeo4w.yml @@ -22,7 +22,7 @@ jobs: $exe = 'osgeo4w-setup-x86_64.exe' $url = 'http://download.osgeo.org/osgeo4w/' + $exe (New-Object System.Net.WebClient).DownloadFile($url, $exe) - &$exe -A -g -k -q -s http://download.osgeo.org/x86_64 -P cairo,fftw,freetype-devel,gdal-ecw,gdal-mrsid,liblas-devel,libxdr,msys,pdcurses,python3-numpy,python3-pywin32,python3-wx,regex-devel,wxpython,zstd-devel + &('.\'+$exe) -A -g -k -q -s http://download.osgeo.org/x86_64 -P cairo,fftw,freetype-devel,gdal-ecw,gdal-mrsid,liblas-devel,libxdr,msys,pdcurses,python3-numpy,python3-pywin32,python3-wx,regex-devel,wxpython,zstd-devel - name: Configure GRASS GIS run: | echo $MINGW_CHOST From 08034b3d680756d8b73056f4df9c35073ea44793 Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Thu, 4 Jun 2020 13:02:15 -0400 Subject: [PATCH 11/64] OK.. Let me use bash in MSYS2 --- .github/workflows/osgeo4w.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/osgeo4w.yml b/.github/workflows/osgeo4w.yml index 6e6f47da994..7b05070435e 100644 --- a/.github/workflows/osgeo4w.yml +++ b/.github/workflows/osgeo4w.yml @@ -23,8 +23,4 @@ jobs: $url = 'http://download.osgeo.org/osgeo4w/' + $exe (New-Object System.Net.WebClient).DownloadFile($url, $exe) &('.\'+$exe) -A -g -k -q -s http://download.osgeo.org/x86_64 -P cairo,fftw,freetype-devel,gdal-ecw,gdal-mrsid,liblas-devel,libxdr,msys,pdcurses,python3-numpy,python3-pywin32,python3-wx,regex-devel,wxpython,zstd-devel - - name: Configure GRASS GIS - run: | - echo $MINGW_CHOST - ./configure --host=$MINGW_CHOST --with-include=/c/OSGeo4W64/include --with-libs="/c/OSGeo4W64/lib /c/OSGeo4W64/bin" --with-nls --with-freetype-include=/c/OSGeo4W64/include/freetype2 --with-bzlib --with-geos=mswindows/osgeo4w/geos-config --with-netcdf=/c/OSGeo4W64/bin/nc-config --with-gdal=mswindows/osgeo4w/gdal-config --with-liblas=mswindows/osgeo4w/liblas-config --with-opengl=windows - shell: bash + C:\msys64\usr\bin\bash.exe -l osgeo4w.sh From 0faa797895c7b2718d911df21f3f521e6b085ec5 Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Thu, 4 Jun 2020 13:02:51 -0400 Subject: [PATCH 12/64] Fix path to osgeo4w.sh --- .github/workflows/osgeo4w.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/osgeo4w.yml b/.github/workflows/osgeo4w.yml index 7b05070435e..942618f8afd 100644 --- a/.github/workflows/osgeo4w.yml +++ b/.github/workflows/osgeo4w.yml @@ -23,4 +23,4 @@ jobs: $url = 'http://download.osgeo.org/osgeo4w/' + $exe (New-Object System.Net.WebClient).DownloadFile($url, $exe) &('.\'+$exe) -A -g -k -q -s http://download.osgeo.org/x86_64 -P cairo,fftw,freetype-devel,gdal-ecw,gdal-mrsid,liblas-devel,libxdr,msys,pdcurses,python3-numpy,python3-pywin32,python3-wx,regex-devel,wxpython,zstd-devel - C:\msys64\usr\bin\bash.exe -l osgeo4w.sh + C:\msys64\usr\bin\bash.exe -l .github/workflows/osgeo4w.sh From d5e5ba3d3376d57dd9dde2a13cc100e09342b25d Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Thu, 4 Jun 2020 13:07:43 -0400 Subject: [PATCH 13/64] Add osgeo4w.sh --- .github/workflows/osgeo4w.sh | 2 ++ .github/workflows/osgeo4w.yml | 12 +++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) create mode 100755 .github/workflows/osgeo4w.sh diff --git a/.github/workflows/osgeo4w.sh b/.github/workflows/osgeo4w.sh new file mode 100755 index 00000000000..7114cf0f7f6 --- /dev/null +++ b/.github/workflows/osgeo4w.sh @@ -0,0 +1,2 @@ +#!/bin/sh +echo "Hello!" diff --git a/.github/workflows/osgeo4w.yml b/.github/workflows/osgeo4w.yml index 942618f8afd..94b29a4be06 100644 --- a/.github/workflows/osgeo4w.yml +++ b/.github/workflows/osgeo4w.yml @@ -19,8 +19,10 @@ jobs: - uses: actions/checkout@v2 - name: Install OSGeo4W run: | - $exe = 'osgeo4w-setup-x86_64.exe' - $url = 'http://download.osgeo.org/osgeo4w/' + $exe - (New-Object System.Net.WebClient).DownloadFile($url, $exe) - &('.\'+$exe) -A -g -k -q -s http://download.osgeo.org/x86_64 -P cairo,fftw,freetype-devel,gdal-ecw,gdal-mrsid,liblas-devel,libxdr,msys,pdcurses,python3-numpy,python3-pywin32,python3-wx,regex-devel,wxpython,zstd-devel - C:\msys64\usr\bin\bash.exe -l .github/workflows/osgeo4w.sh + $exe = 'osgeo4w-setup-x86_64.exe' + $url = 'http://download.osgeo.org/osgeo4w/' + $exe + (New-Object System.Net.WebClient).DownloadFile($url, $exe) + &('.\'+$exe) -A -g -k -q -s http://download.osgeo.org/x86_64 -P cairo,fftw,freetype-devel,gdal-ecw,gdal-mrsid,liblas-devel,libxdr,msys,pdcurses,python3-numpy,python3-pywin32,python3-wx,regex-devel,wxpython,zstd-devel + - name: Compile GRASS GIS + run: | + C:\msys64\usr\bin\bash.exe -l .github/workflows/osgeo4w.sh From 2cbc03edf196227920091e6edde4e03284c471a9 Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Thu, 4 Jun 2020 13:09:56 -0400 Subject: [PATCH 14/64] Where am I? --- .github/workflows/osgeo4w.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/osgeo4w.yml b/.github/workflows/osgeo4w.yml index 94b29a4be06..686d6d8ef90 100644 --- a/.github/workflows/osgeo4w.yml +++ b/.github/workflows/osgeo4w.yml @@ -25,4 +25,6 @@ jobs: &('.\'+$exe) -A -g -k -q -s http://download.osgeo.org/x86_64 -P cairo,fftw,freetype-devel,gdal-ecw,gdal-mrsid,liblas-devel,libxdr,msys,pdcurses,python3-numpy,python3-pywin32,python3-wx,regex-devel,wxpython,zstd-devel - name: Compile GRASS GIS run: | + dir + pwd C:\msys64\usr\bin\bash.exe -l .github/workflows/osgeo4w.sh From fa7d4dc98e3ab39140a0ded6fc0f9b933ffba763 Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Thu, 4 Jun 2020 13:18:31 -0400 Subject: [PATCH 15/64] Pass absolute path to bash.exe --- .github/workflows/osgeo4w.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/osgeo4w.yml b/.github/workflows/osgeo4w.yml index 686d6d8ef90..83c0ceebcc5 100644 --- a/.github/workflows/osgeo4w.yml +++ b/.github/workflows/osgeo4w.yml @@ -24,7 +24,4 @@ jobs: (New-Object System.Net.WebClient).DownloadFile($url, $exe) &('.\'+$exe) -A -g -k -q -s http://download.osgeo.org/x86_64 -P cairo,fftw,freetype-devel,gdal-ecw,gdal-mrsid,liblas-devel,libxdr,msys,pdcurses,python3-numpy,python3-pywin32,python3-wx,regex-devel,wxpython,zstd-devel - name: Compile GRASS GIS - run: | - dir - pwd - C:\msys64\usr\bin\bash.exe -l .github/workflows/osgeo4w.sh + run: C:\msys64\usr\bin\bash.exe -l (''+(Get-Location)+'\.github\workflows\osgeo4w.sh') From 46c6b07dfbef54d8914318a251b3a5857f1f2cbf Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Thu, 4 Jun 2020 13:32:50 -0400 Subject: [PATCH 16/64] Try to compile --- .github/workflows/osgeo4w.sh | 93 +++++++++++++++++++++++++++++++++++- 1 file changed, 92 insertions(+), 1 deletion(-) diff --git a/.github/workflows/osgeo4w.sh b/.github/workflows/osgeo4w.sh index 7114cf0f7f6..c0405bb4406 100755 --- a/.github/workflows/osgeo4w.sh +++ b/.github/workflows/osgeo4w.sh @@ -1,2 +1,93 @@ #!/bin/sh -echo "Hello!" +# +# Standalone script for building a portable package of GRASS GIS for OSGeo4W +# +# Written by Huidae Cho + +# stop on errors +set -e + +export PATH=/mingw64/bin:/c/OSGeo4W64/bin:/usr/bin + +osgeo4w_root_msys=/c/OSGeo4W64 +arch=x86_64-w64-mingw32 +bit=64 + +# start +echo "Started compilation: `date`" +echo + +# compile + +grass_src=`pwd` +tmp=`dirname $0`; grass_build_scripts=`realpath $tmp` + +export MINGW_CHOST=$arch +export PATH="/mingw$bit/bin:$PATH" + +OSGEO4W_ROOT_MSYS=$osgeo4w_root_msys \ +./configure \ +--host=$MINGW_CHOST \ +--with-includes=$osgeo4w_root_msys/include \ +--with-libs="$osgeo4w_root_msys/lib $osgeo4w_root_msys/bin" \ +--with-nls \ +--with-freetype-includes=$osgeo4w_root_msys/include/freetype2 \ +--with-bzlib \ +--with-geos=$grass_src/mswindows/osgeo4w/geos-config \ +--with-netcdf=$osgeo4w_root_msys/bin/nc-config \ +--with-gdal=$grass_src/mswindows/osgeo4w/gdal-config \ +--with-liblas=$grass_src/mswindows/osgeo4w/liblas-config \ +--with-opengl=windows + +make clean default + +# package + +opt_path=$osgeo4w_root_msys/opt +grass_path=$opt_path/grass +version=`sed -n '/^INST_DIR[ \t]*=/{s/^.*grass//; p}' include/Make/Platform.make` +date=`date +%Y%m%d` +grass_zip=$grass_src/grass$version-$arch-osgeo4w$bit-$date.zip + +test -d $grass_path && rm -rf $grass_path +test -d $opt_path || mkdir -p $opt_path +cp -a dist.$arch $grass_path +rm -f $grass_path/grass$version.tmp $grass_path/etc/fontcap +cp -a bin.$arch/grass$version.py $grass_path/etc +cp -a `ldd dist.$arch/lib/*.dll | awk '/mingw'$bit'/{print $3}' | + sort -u | grep -v 'lib\(crypto\|ssl\)'` $grass_path/lib + +( +sed -e 's/^\(set GISBASE=\).*/\1%OSGEO4W_ROOT%\\opt\\grass/' \ + mswindows/osgeo4w/env.bat.tmpl +cat< $grass_path/etc/env.bat +unix2dos $grass_path/etc/env.bat + +( +sed -e 's/^\(call "%~dp0\)\(.*\)$/\1\\..\\..\\bin\2/' \ + -e 's/^\(call "%OSGEO4W_ROOT%\\\).*\(\\etc\\env\.bat"\)$/\1opt\\grass\2/' \ + -e 's/@POSTFIX@/'$version'/g' \ + mswindows/osgeo4w/grass.bat.tmpl +) > $grass_path/grass$version.bat +unix2dos $grass_path/grass$version.bat + +cd $osgeo4w_root_msys/.. +osgeo4w_basename=`basename $osgeo4w_root_msys` +zip -r $grass_zip $osgeo4w_basename -x "$osgeo4w_basename/var/*" "*/__pycache__/*" +ls -al + +echo +echo "Completed compilation: `date`" From d39a443ef7d9050153307249cc46ee8c8fa76b99 Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Thu, 4 Jun 2020 13:35:53 -0400 Subject: [PATCH 17/64] Where am I again? --- .github/workflows/osgeo4w.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/osgeo4w.sh b/.github/workflows/osgeo4w.sh index c0405bb4406..1e559da39fc 100755 --- a/.github/workflows/osgeo4w.sh +++ b/.github/workflows/osgeo4w.sh @@ -6,6 +6,11 @@ # stop on errors set -e +echo output... +echo OUTPUT > l +pwd +pwd >> l +exit 0 export PATH=/mingw64/bin:/c/OSGeo4W64/bin:/usr/bin From efd0ba150efd7e540557fac5c21521eee72144c9 Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Thu, 4 Jun 2020 13:38:42 -0400 Subject: [PATCH 18/64] Happy? --- .github/workflows/osgeo4w.sh | 3 +-- .github/workflows/osgeo4w.yml | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/osgeo4w.sh b/.github/workflows/osgeo4w.sh index 1e559da39fc..500d8304360 100755 --- a/.github/workflows/osgeo4w.sh +++ b/.github/workflows/osgeo4w.sh @@ -7,9 +7,8 @@ # stop on errors set -e echo output... -echo OUTPUT > l pwd -pwd >> l +ls -al exit 0 export PATH=/mingw64/bin:/c/OSGeo4W64/bin:/usr/bin diff --git a/.github/workflows/osgeo4w.yml b/.github/workflows/osgeo4w.yml index 83c0ceebcc5..916c2861db3 100644 --- a/.github/workflows/osgeo4w.yml +++ b/.github/workflows/osgeo4w.yml @@ -24,4 +24,4 @@ jobs: (New-Object System.Net.WebClient).DownloadFile($url, $exe) &('.\'+$exe) -A -g -k -q -s http://download.osgeo.org/x86_64 -P cairo,fftw,freetype-devel,gdal-ecw,gdal-mrsid,liblas-devel,libxdr,msys,pdcurses,python3-numpy,python3-pywin32,python3-wx,regex-devel,wxpython,zstd-devel - name: Compile GRASS GIS - run: C:\msys64\usr\bin\bash.exe -l (''+(Get-Location)+'\.github\workflows\osgeo4w.sh') + run: C:\msys64\usr\bin\bash.exe -l (''+(Get-Location)+'\.github\workflows\osgeo4w.sh') (Get-Location) From f8ae60d7031f2ac444b0c9057c2e6b328d0a5a66 Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Thu, 4 Jun 2020 13:41:34 -0400 Subject: [PATCH 19/64] CD first..? --- .github/workflows/osgeo4w.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/osgeo4w.sh b/.github/workflows/osgeo4w.sh index 500d8304360..0236fba75cf 100755 --- a/.github/workflows/osgeo4w.sh +++ b/.github/workflows/osgeo4w.sh @@ -3,10 +3,11 @@ # Standalone script for building a portable package of GRASS GIS for OSGeo4W # # Written by Huidae Cho +# # stop on errors set -e -echo output... +cd "$1" pwd ls -al exit 0 From 92cc739d20d66ed26e31ae67fe96745719c6dfa0 Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Thu, 4 Jun 2020 13:44:00 -0400 Subject: [PATCH 20/64] nc-config may not work --- .github/workflows/osgeo4w.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/osgeo4w.sh b/.github/workflows/osgeo4w.sh index 0236fba75cf..a3a88ee006c 100755 --- a/.github/workflows/osgeo4w.sh +++ b/.github/workflows/osgeo4w.sh @@ -7,10 +7,8 @@ # stop on errors set -e + cd "$1" -pwd -ls -al -exit 0 export PATH=/mingw64/bin:/c/OSGeo4W64/bin:/usr/bin @@ -18,6 +16,8 @@ osgeo4w_root_msys=/c/OSGeo4W64 arch=x86_64-w64-mingw32 bit=64 +head $osgeo4w_root_msys/bin/nc-config + # start echo "Started compilation: `date`" echo From 6805a5d1389f1af337eace943a0236d88579f9cc Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Thu, 4 Jun 2020 13:49:07 -0400 Subject: [PATCH 21/64] What? --- .github/workflows/osgeo4w.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/osgeo4w.sh b/.github/workflows/osgeo4w.sh index a3a88ee006c..b6ab07200a5 100755 --- a/.github/workflows/osgeo4w.sh +++ b/.github/workflows/osgeo4w.sh @@ -16,6 +16,8 @@ osgeo4w_root_msys=/c/OSGeo4W64 arch=x86_64-w64-mingw32 bit=64 +ls -al /c/ +ls -al $osgeo4w_root_msys/bin head $osgeo4w_root_msys/bin/nc-config # start From 048f8e3296ea3e7e8bd0b1895c99811eabfd7932 Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Thu, 4 Jun 2020 13:51:42 -0400 Subject: [PATCH 22/64] Let me check C:\OSGeo4W64 --- .github/workflows/osgeo4w.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/osgeo4w.sh b/.github/workflows/osgeo4w.sh index b6ab07200a5..79e2be6aeac 100755 --- a/.github/workflows/osgeo4w.sh +++ b/.github/workflows/osgeo4w.sh @@ -17,7 +17,8 @@ arch=x86_64-w64-mingw32 bit=64 ls -al /c/ -ls -al $osgeo4w_root_msys/bin +ls -al /c/OSGeo4W64 +ls -al $osgeo4w_root_msys head $osgeo4w_root_msys/bin/nc-config # start From 6980310ae6f0cdccc485442b3e770e95bd745bb9 Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Thu, 4 Jun 2020 14:11:45 -0400 Subject: [PATCH 23/64] Wait for OSGeo4W to be fully installed --- .github/workflows/osgeo4w.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/osgeo4w.yml b/.github/workflows/osgeo4w.yml index 916c2861db3..ff735062355 100644 --- a/.github/workflows/osgeo4w.yml +++ b/.github/workflows/osgeo4w.yml @@ -22,6 +22,6 @@ jobs: $exe = 'osgeo4w-setup-x86_64.exe' $url = 'http://download.osgeo.org/osgeo4w/' + $exe (New-Object System.Net.WebClient).DownloadFile($url, $exe) - &('.\'+$exe) -A -g -k -q -s http://download.osgeo.org/x86_64 -P cairo,fftw,freetype-devel,gdal-ecw,gdal-mrsid,liblas-devel,libxdr,msys,pdcurses,python3-numpy,python3-pywin32,python3-wx,regex-devel,wxpython,zstd-devel + Start-Process ('.\'+$exe) -ArgumentList '-A -g -k -q -s http://download.osgeo.org/x86_64 -P cairo,fftw,freetype-devel,gdal-ecw,gdal-mrsid,liblas-devel,libxdr,msys,pdcurses,python3-numpy,python3-pywin32,python3-wx,regex-devel,wxpython,zstd-devel' -Wait - name: Compile GRASS GIS run: C:\msys64\usr\bin\bash.exe -l (''+(Get-Location)+'\.github\workflows\osgeo4w.sh') (Get-Location) From db4d9303c8a14963e6cfd85e15f58cab37b836dc Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Thu, 4 Jun 2020 14:23:13 -0400 Subject: [PATCH 24/64] Need to install MSYS2 packages? --- .github/workflows/osgeo4w.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/osgeo4w.yml b/.github/workflows/osgeo4w.yml index ff735062355..ecfffcae54b 100644 --- a/.github/workflows/osgeo4w.yml +++ b/.github/workflows/osgeo4w.yml @@ -23,5 +23,7 @@ jobs: $url = 'http://download.osgeo.org/osgeo4w/' + $exe (New-Object System.Net.WebClient).DownloadFile($url, $exe) Start-Process ('.\'+$exe) -ArgumentList '-A -g -k -q -s http://download.osgeo.org/x86_64 -P cairo,fftw,freetype-devel,gdal-ecw,gdal-mrsid,liblas-devel,libxdr,msys,pdcurses,python3-numpy,python3-pywin32,python3-wx,regex-devel,wxpython,zstd-devel' -Wait + - name: Install MSYS2 packages + run: C:\msys64\usr\bin\bash.exe -l pacman -S tar libintl make bison diffutils git dos2unix zip mingw-w64-x86_64-toolchain mingw-w64-x86_64-cairo mingw-w64-x86_64-python3-six - name: Compile GRASS GIS run: C:\msys64\usr\bin\bash.exe -l (''+(Get-Location)+'\.github\workflows\osgeo4w.sh') (Get-Location) From d7af4c71801356dfe7968fb83ead4785f33d7712 Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Thu, 4 Jun 2020 14:34:47 -0400 Subject: [PATCH 25/64] Why pacman does not run --- .github/workflows/osgeo4w.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/osgeo4w.yml b/.github/workflows/osgeo4w.yml index ecfffcae54b..b56e9111a31 100644 --- a/.github/workflows/osgeo4w.yml +++ b/.github/workflows/osgeo4w.yml @@ -23,6 +23,7 @@ jobs: $url = 'http://download.osgeo.org/osgeo4w/' + $exe (New-Object System.Net.WebClient).DownloadFile($url, $exe) Start-Process ('.\'+$exe) -ArgumentList '-A -g -k -q -s http://download.osgeo.org/x86_64 -P cairo,fftw,freetype-devel,gdal-ecw,gdal-mrsid,liblas-devel,libxdr,msys,pdcurses,python3-numpy,python3-pywin32,python3-wx,regex-devel,wxpython,zstd-devel' -Wait + dir c:\msys64\usr\bin\pacman.exe - name: Install MSYS2 packages run: C:\msys64\usr\bin\bash.exe -l pacman -S tar libintl make bison diffutils git dos2unix zip mingw-w64-x86_64-toolchain mingw-w64-x86_64-cairo mingw-w64-x86_64-python3-six - name: Compile GRASS GIS From 63193de0d02089c4f929a5d19bddde7a8b0f9a1f Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Thu, 4 Jun 2020 14:38:58 -0400 Subject: [PATCH 26/64] Execute pacman directly --- .github/workflows/osgeo4w.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/osgeo4w.yml b/.github/workflows/osgeo4w.yml index b56e9111a31..2954d7d62cb 100644 --- a/.github/workflows/osgeo4w.yml +++ b/.github/workflows/osgeo4w.yml @@ -23,8 +23,7 @@ jobs: $url = 'http://download.osgeo.org/osgeo4w/' + $exe (New-Object System.Net.WebClient).DownloadFile($url, $exe) Start-Process ('.\'+$exe) -ArgumentList '-A -g -k -q -s http://download.osgeo.org/x86_64 -P cairo,fftw,freetype-devel,gdal-ecw,gdal-mrsid,liblas-devel,libxdr,msys,pdcurses,python3-numpy,python3-pywin32,python3-wx,regex-devel,wxpython,zstd-devel' -Wait - dir c:\msys64\usr\bin\pacman.exe - name: Install MSYS2 packages - run: C:\msys64\usr\bin\bash.exe -l pacman -S tar libintl make bison diffutils git dos2unix zip mingw-w64-x86_64-toolchain mingw-w64-x86_64-cairo mingw-w64-x86_64-python3-six + run: C:\msys64\usr\bin\pacman.exe -S tar libintl make bison diffutils git dos2unix zip mingw-w64-x86_64-toolchain mingw-w64-x86_64-cairo mingw-w64-x86_64-python3-six - name: Compile GRASS GIS run: C:\msys64\usr\bin\bash.exe -l (''+(Get-Location)+'\.github\workflows\osgeo4w.sh') (Get-Location) From 4a44dd262731818a8b707c59fc9292121b3dc9b2 Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Thu, 4 Jun 2020 14:58:54 -0400 Subject: [PATCH 27/64] Execute pacman directly without confirmation --- .github/workflows/osgeo4w.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/osgeo4w.yml b/.github/workflows/osgeo4w.yml index 2954d7d62cb..205ffc2eb77 100644 --- a/.github/workflows/osgeo4w.yml +++ b/.github/workflows/osgeo4w.yml @@ -24,6 +24,6 @@ jobs: (New-Object System.Net.WebClient).DownloadFile($url, $exe) Start-Process ('.\'+$exe) -ArgumentList '-A -g -k -q -s http://download.osgeo.org/x86_64 -P cairo,fftw,freetype-devel,gdal-ecw,gdal-mrsid,liblas-devel,libxdr,msys,pdcurses,python3-numpy,python3-pywin32,python3-wx,regex-devel,wxpython,zstd-devel' -Wait - name: Install MSYS2 packages - run: C:\msys64\usr\bin\pacman.exe -S tar libintl make bison diffutils git dos2unix zip mingw-w64-x86_64-toolchain mingw-w64-x86_64-cairo mingw-w64-x86_64-python3-six + run: C:\msys64\usr\bin\pacman.exe --noconfirm -S tar libintl make bison diffutils git dos2unix zip mingw-w64-x86_64-toolchain mingw-w64-x86_64-cairo mingw-w64-x86_64-python3-six - name: Compile GRASS GIS run: C:\msys64\usr\bin\bash.exe -l (''+(Get-Location)+'\.github\workflows\osgeo4w.sh') (Get-Location) From e4771e5b38a507cc6bf7ccb60d626e86226996a3 Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Thu, 4 Jun 2020 15:17:59 -0400 Subject: [PATCH 28/64] nc-config just works? --- .github/workflows/osgeo4w.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/osgeo4w.sh b/.github/workflows/osgeo4w.sh index 79e2be6aeac..60ef400eb0c 100755 --- a/.github/workflows/osgeo4w.sh +++ b/.github/workflows/osgeo4w.sh @@ -16,10 +16,7 @@ osgeo4w_root_msys=/c/OSGeo4W64 arch=x86_64-w64-mingw32 bit=64 -ls -al /c/ -ls -al /c/OSGeo4W64 -ls -al $osgeo4w_root_msys -head $osgeo4w_root_msys/bin/nc-config +cat $osgeo4w_root_msys/bin/nc-config # start echo "Started compilation: `date`" From 2b20fd9da9ca6dcd763dbf1d59e87c3ecb138210 Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Thu, 4 Jun 2020 16:00:37 -0400 Subject: [PATCH 29/64] Define PROJ_LIB --- .github/workflows/osgeo4w.sh | 40 +++++++++++++++--------------------- 1 file changed, 16 insertions(+), 24 deletions(-) diff --git a/.github/workflows/osgeo4w.sh b/.github/workflows/osgeo4w.sh index 60ef400eb0c..8a634c67769 100755 --- a/.github/workflows/osgeo4w.sh +++ b/.github/workflows/osgeo4w.sh @@ -8,15 +8,7 @@ # stop on errors set -e -cd "$1" - -export PATH=/mingw64/bin:/c/OSGeo4W64/bin:/usr/bin - -osgeo4w_root_msys=/c/OSGeo4W64 -arch=x86_64-w64-mingw32 -bit=64 - -cat $osgeo4w_root_msys/bin/nc-config +test -d "$1" && cd "$1" # start echo "Started compilation: `date`" @@ -24,22 +16,23 @@ echo # compile +osgeo4w_path=/c/OSGeo4W64 +arch=x86_64-w64-mingw32 grass_src=`pwd` -tmp=`dirname $0`; grass_build_scripts=`realpath $tmp` -export MINGW_CHOST=$arch -export PATH="/mingw$bit/bin:$PATH" +export PATH=/mingw64/bin:/c/OSGeo4W64/bin:/usr/bin +export PROJ_LIB=/$osgeo4w_path/share/proj -OSGEO4W_ROOT_MSYS=$osgeo4w_root_msys \ +OSGEO4W_ROOT_MSYS=$osgeo4w_path \ ./configure \ ---host=$MINGW_CHOST \ ---with-includes=$osgeo4w_root_msys/include \ ---with-libs="$osgeo4w_root_msys/lib $osgeo4w_root_msys/bin" \ +--host=$arch \ +--with-includes=$osgeo4w_path/include \ +--with-libs="$osgeo4w_path/lib $osgeo4w_path/bin" \ --with-nls \ ---with-freetype-includes=$osgeo4w_root_msys/include/freetype2 \ +--with-freetype-includes=$osgeo4w_path/include/freetype2 \ --with-bzlib \ --with-geos=$grass_src/mswindows/osgeo4w/geos-config \ ---with-netcdf=$osgeo4w_root_msys/bin/nc-config \ +--with-netcdf=$osgeo4w_path/bin/nc-config \ --with-gdal=$grass_src/mswindows/osgeo4w/gdal-config \ --with-liblas=$grass_src/mswindows/osgeo4w/liblas-config \ --with-opengl=windows @@ -48,18 +41,18 @@ make clean default # package -opt_path=$osgeo4w_root_msys/opt +opt_path=$osgeo4w_path/opt grass_path=$opt_path/grass version=`sed -n '/^INST_DIR[ \t]*=/{s/^.*grass//; p}' include/Make/Platform.make` date=`date +%Y%m%d` -grass_zip=$grass_src/grass$version-$arch-osgeo4w$bit-$date.zip +grass_zip=$grass_src/grass$version-$arch-osgeo4w64-$date.zip test -d $grass_path && rm -rf $grass_path test -d $opt_path || mkdir -p $opt_path cp -a dist.$arch $grass_path rm -f $grass_path/grass$version.tmp $grass_path/etc/fontcap cp -a bin.$arch/grass$version.py $grass_path/etc -cp -a `ldd dist.$arch/lib/*.dll | awk '/mingw'$bit'/{print $3}' | +cp -a `ldd dist.$arch/lib/*.dll | awk '/mingw64/{print $3}' | sort -u | grep -v 'lib\(crypto\|ssl\)'` $grass_path/lib ( @@ -89,10 +82,9 @@ sed -e 's/^\(call "%~dp0\)\(.*\)$/\1\\..\\..\\bin\2/' \ ) > $grass_path/grass$version.bat unix2dos $grass_path/grass$version.bat -cd $osgeo4w_root_msys/.. -osgeo4w_basename=`basename $osgeo4w_root_msys` +cd $osgeo4w_path/.. +osgeo4w_basename=`basename $osgeo4w_path` zip -r $grass_zip $osgeo4w_basename -x "$osgeo4w_basename/var/*" "*/__pycache__/*" -ls -al echo echo "Completed compilation: `date`" From 458cbaa718e1f22414f9a60e330e3f8d44d744a5 Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Thu, 4 Jun 2020 16:39:41 -0400 Subject: [PATCH 30/64] Add test batch files --- .../{osgeo4w.sh => build_osgeo4w.sh} | 38 ++++--------------- .github/workflows/osgeo4w.yml | 6 ++- .github/workflows/test_simple.bat | 3 ++ .github/workflows/test_thorough.bat | 6 +++ 4 files changed, 22 insertions(+), 31 deletions(-) rename .github/workflows/{osgeo4w.sh => build_osgeo4w.sh} (60%) create mode 100644 .github/workflows/test_simple.bat create mode 100644 .github/workflows/test_thorough.bat diff --git a/.github/workflows/osgeo4w.sh b/.github/workflows/build_osgeo4w.sh similarity index 60% rename from .github/workflows/osgeo4w.sh rename to .github/workflows/build_osgeo4w.sh index 8a634c67769..bc0dc96f77d 100755 --- a/.github/workflows/osgeo4w.sh +++ b/.github/workflows/build_osgeo4w.sh @@ -1,9 +1,4 @@ #!/bin/sh -# -# Standalone script for building a portable package of GRASS GIS for OSGeo4W -# -# Written by Huidae Cho -# # stop on errors set -e @@ -37,23 +32,15 @@ OSGEO4W_ROOT_MSYS=$osgeo4w_path \ --with-liblas=$grass_src/mswindows/osgeo4w/liblas-config \ --with-opengl=windows -make clean default +make -# package +echo +echo "Completed compilation: `date`" -opt_path=$osgeo4w_path/opt -grass_path=$opt_path/grass -version=`sed -n '/^INST_DIR[ \t]*=/{s/^.*grass//; p}' include/Make/Platform.make` -date=`date +%Y%m%d` -grass_zip=$grass_src/grass$version-$arch-osgeo4w64-$date.zip +# install -test -d $grass_path && rm -rf $grass_path -test -d $opt_path || mkdir -p $opt_path -cp -a dist.$arch $grass_path -rm -f $grass_path/grass$version.tmp $grass_path/etc/fontcap -cp -a bin.$arch/grass$version.py $grass_path/etc -cp -a `ldd dist.$arch/lib/*.dll | awk '/mingw64/{print $3}' | - sort -u | grep -v 'lib\(crypto\|ssl\)'` $grass_path/lib +grass_bin=bin.$arch +version=`sed -n '/^INST_DIR[ \t]*=/{s/^.*grass//; p}' include/Make/Platform.make` ( sed -e 's/^\(set GISBASE=\).*/\1%OSGEO4W_ROOT%\\opt\\grass/' \ @@ -71,20 +58,11 @@ if not exist %GISBASE%\etc\fontcap ( popd ) EOT -) > $grass_path/etc/env.bat -unix2dos $grass_path/etc/env.bat +) > $grass_bin/env.bat ( sed -e 's/^\(call "%~dp0\)\(.*\)$/\1\\..\\..\\bin\2/' \ -e 's/^\(call "%OSGEO4W_ROOT%\\\).*\(\\etc\\env\.bat"\)$/\1opt\\grass\2/' \ -e 's/@POSTFIX@/'$version'/g' \ mswindows/osgeo4w/grass.bat.tmpl -) > $grass_path/grass$version.bat -unix2dos $grass_path/grass$version.bat - -cd $osgeo4w_path/.. -osgeo4w_basename=`basename $osgeo4w_path` -zip -r $grass_zip $osgeo4w_basename -x "$osgeo4w_basename/var/*" "*/__pycache__/*" - -echo -echo "Completed compilation: `date`" +) > $grass_bin/grass$version.bat diff --git a/.github/workflows/osgeo4w.yml b/.github/workflows/osgeo4w.yml index 205ffc2eb77..49dcd0b83ae 100644 --- a/.github/workflows/osgeo4w.yml +++ b/.github/workflows/osgeo4w.yml @@ -26,4 +26,8 @@ jobs: - name: Install MSYS2 packages run: C:\msys64\usr\bin\pacman.exe --noconfirm -S tar libintl make bison diffutils git dos2unix zip mingw-w64-x86_64-toolchain mingw-w64-x86_64-cairo mingw-w64-x86_64-python3-six - name: Compile GRASS GIS - run: C:\msys64\usr\bin\bash.exe -l (''+(Get-Location)+'\.github\workflows\osgeo4w.sh') (Get-Location) + run: C:\msys64\usr\bin\bash.exe -l (''+(Get-Location)+'\.github\workflows\build_osgeo4w.sh') (Get-Location) + - name: Test executing of the grass command + run: .github/workflows/test_simple.bat + - name: Run tests + run: .github/workflows/test_thorough.bat diff --git a/.github/workflows/test_simple.bat b/.github/workflows/test_simple.bat new file mode 100644 index 00000000000..47d57c0f0f4 --- /dev/null +++ b/.github/workflows/test_simple.bat @@ -0,0 +1,3 @@ +set PATH=bin.x86_64-w64-mingw32;%PATH% + +grass79 --tmp-location EPSG:4326 --exec g.region res=0.1 -p diff --git a/.github/workflows/test_thorough.bat b/.github/workflows/test_thorough.bat new file mode 100644 index 00000000000..37f02ab4198 --- /dev/null +++ b/.github/workflows/test_thorough.bat @@ -0,0 +1,6 @@ +set PATH=bin.x86_64-w64-mingw32;%PATH% + +grass79 --tmp-location XY --exec g.extension g.download.location +grass79 --tmp-location XY --exec g.download.location url=http://fatra.cnr.ncsu.edu/data/nc_spm_full_v2alpha2.tar.gz dbase=%USERPROFILE% + +grass79 --tmp-location XY --exec python3 -m grass.gunittest.main --grassdata %USERPROFILE% --location nc_spm_full_v2alpha2 --location-type nc --min-success 80 From 2798394aace48d076dea49da93aa0559392c52d9 Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Thu, 4 Jun 2020 17:15:40 -0400 Subject: [PATCH 31/64] Fix PROJ_LIB --- .github/workflows/build_osgeo4w.sh | 36 +++++++++++++++++++----------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build_osgeo4w.sh b/.github/workflows/build_osgeo4w.sh index bc0dc96f77d..4fb0bdcdfd7 100755 --- a/.github/workflows/build_osgeo4w.sh +++ b/.github/workflows/build_osgeo4w.sh @@ -5,18 +5,18 @@ set -e test -d "$1" && cd "$1" +osgeo4w_path=/c/OSGeo4W64 +arch=x86_64-w64-mingw32 +src=`pwd` + # start echo "Started compilation: `date`" echo # compile -osgeo4w_path=/c/OSGeo4W64 -arch=x86_64-w64-mingw32 -grass_src=`pwd` - export PATH=/mingw64/bin:/c/OSGeo4W64/bin:/usr/bin -export PROJ_LIB=/$osgeo4w_path/share/proj +export PROJ_LIB=$osgeo4w_path/share/proj OSGEO4W_ROOT_MSYS=$osgeo4w_path \ ./configure \ @@ -26,10 +26,10 @@ OSGEO4W_ROOT_MSYS=$osgeo4w_path \ --with-nls \ --with-freetype-includes=$osgeo4w_path/include/freetype2 \ --with-bzlib \ ---with-geos=$grass_src/mswindows/osgeo4w/geos-config \ +--with-geos=$src/mswindows/osgeo4w/geos-config \ --with-netcdf=$osgeo4w_path/bin/nc-config \ ---with-gdal=$grass_src/mswindows/osgeo4w/gdal-config \ ---with-liblas=$grass_src/mswindows/osgeo4w/liblas-config \ +--with-gdal=$src/mswindows/osgeo4w/gdal-config \ +--with-liblas=$src/mswindows/osgeo4w/liblas-config \ --with-opengl=windows make @@ -39,11 +39,15 @@ echo "Completed compilation: `date`" # install -grass_bin=bin.$arch +bin=bin.$arch +dist=dist.$arch version=`sed -n '/^INST_DIR[ \t]*=/{s/^.*grass//; p}' include/Make/Platform.make` +src_win_esc=`echo $src | sed 's#^/\([a-z]\)#\1:#; s#/#\\\\\\\\#g'` +bin_win_esc="$src_win_esc\\$bin" +dist_win_esc="$src_win_esc\\$dist" ( -sed -e 's/^\(set GISBASE=\).*/\1%OSGEO4W_ROOT%\\opt\\grass/' \ +sed 's/^\(set GISBASE=\).*/\1'$dist_win_esc'/' \ mswindows/osgeo4w/env.bat.tmpl cat< $grass_bin/env.bat +) > $dist/etc/env.bat ( sed -e 's/^\(call "%~dp0\)\(.*\)$/\1\\..\\..\\bin\2/' \ - -e 's/^\(call "%OSGEO4W_ROOT%\\\).*\(\\etc\\env\.bat"\)$/\1opt\\grass\2/' \ + -e 's/^\(call "\).*\(\\etc\\env\.bat"\)$/\1'$dist_win_esc'\2/' \ -e 's/@POSTFIX@/'$version'/g' \ mswindows/osgeo4w/grass.bat.tmpl -) > $grass_bin/grass$version.bat +) > $bin/grass$version.bat + +echo env.bat +cat $dist/etc/env.bat + +echo grass.bat +cat $bin/grass$version.bat From a4e88477a18b8b4c37b52fa2a04aa66ce38c9951 Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Thu, 4 Jun 2020 21:21:08 -0400 Subject: [PATCH 32/64] No autocrlf --- .github/workflows/osgeo4w.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/osgeo4w.yml b/.github/workflows/osgeo4w.yml index 49dcd0b83ae..ac278ed4cdf 100644 --- a/.github/workflows/osgeo4w.yml +++ b/.github/workflows/osgeo4w.yml @@ -16,6 +16,10 @@ jobs: fail-fast: false steps: + - name: Set git to use LF + run: | + git config --global core.autocrlf false + git config --global core.eol lf - uses: actions/checkout@v2 - name: Install OSGeo4W run: | From 6cb23d2c98a55cc6c84005430d55b1e9b3fce212 Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Thu, 4 Jun 2020 21:55:17 -0400 Subject: [PATCH 33/64] Add packaging code --- .github/workflows/build_osgeo4w.sh | 96 +++++++++++++++++++++--------- 1 file changed, 69 insertions(+), 27 deletions(-) diff --git a/.github/workflows/build_osgeo4w.sh b/.github/workflows/build_osgeo4w.sh index 4fb0bdcdfd7..87ffe63dc27 100755 --- a/.github/workflows/build_osgeo4w.sh +++ b/.github/workflows/build_osgeo4w.sh @@ -1,4 +1,5 @@ #!/bin/sh +package=0 # stop on errors set -e @@ -9,10 +10,6 @@ osgeo4w_path=/c/OSGeo4W64 arch=x86_64-w64-mingw32 src=`pwd` -# start -echo "Started compilation: `date`" -echo - # compile export PATH=/mingw64/bin:/c/OSGeo4W64/bin:/usr/bin @@ -34,22 +31,32 @@ OSGEO4W_ROOT_MSYS=$osgeo4w_path \ make -echo -echo "Completed compilation: `date`" - # install bin=bin.$arch dist=dist.$arch -version=`sed -n '/^INST_DIR[ \t]*=/{s/^.*grass//; p}' include/Make/Platform.make` -src_win_esc=`echo $src | sed 's#^/\([a-z]\)#\1:#; s#/#\\\\\\\\#g'` -bin_win_esc="$src_win_esc\\$bin" -dist_win_esc="$src_win_esc\\$dist" +ver=`sed -n '/^INST_DIR[ \t]*=/{s/^.*grass//; p}' include/Make/Platform.make` + +rm -f $dist/grass$ver.tmp $dist/etc/fontcap + +if [ $package -eq 1 ]; then + # package + + opt_path=$osgeo4w_path/opt + grass_path=$opt_path/grass + date=`date +%Y%m%d` + zip=$src/grass$ver-$arch-osgeo4w64-$date.zip -( -sed 's/^\(set GISBASE=\).*/\1'$dist_win_esc'/' \ - mswindows/osgeo4w/env.bat.tmpl -cat< $dist/etc/env.bat - -( -sed -e 's/^\(call "%~dp0\)\(.*\)$/\1\\..\\..\\bin\2/' \ - -e 's/^\(call "\).*\(\\etc\\env\.bat"\)$/\1'$dist_win_esc'\2/' \ - -e 's/@POSTFIX@/'$version'/g' \ - mswindows/osgeo4w/grass.bat.tmpl -) > $bin/grass$version.bat + ) > $grass_path/etc/env.bat + unix2dos $grass_path/etc/env.bat + + ( + sed -e 's/^\(call "%~dp0\)\(.*\)$/\1\\..\\..\\bin\2/' \ + -e 's/^\(call "%OSGEO4W_ROOT%\\\).*\(\\etc\\env\.bat"\)$/\1opt\\grass\2/' \ + -e 's/@POSTFIX@/'$ver'/g' \ + mswindows/osgeo4w/grass.bat.tmpl + ) > $grass_path/grass$ver.bat + unix2dos $grass_path/grass$ver.bat + + cd $osgeo4w_path/.. + osgeo4w_basename=`basename $osgeo4w_path` + zip -r $zip $osgeo4w_basename \ + -x "$osgeo4w_basename/var/*" "*/__pycache__/*" +else + # create batch files + + src_win_esc=`echo $src | sed 's#^/\([a-z]\)#\1:#; s#/#\\\\\\\\#g'` + bin_win_esc="$src_win_esc\\$bin" + dist_win_esc="$src_win_esc\\$dist" + + ( + sed 's/^\(set GISBASE=\).*/\1'$dist_win_esc'/' \ + mswindows/osgeo4w/env.bat.tmpl + cat< $dist/etc/env.bat + unix2dos $dist/etc/env.bat + + ( + sed -e 's/^\(call "%~dp0\)\(.*\)$/\1\\..\\..\\bin\2/' \ + -e 's/^\(call "\).*\(\\etc\\env\.bat"\)$/\1'$dist_win_esc'\2/' \ + -e 's/@POSTFIX@/'$ver'/g' \ + mswindows/osgeo4w/grass.bat.tmpl + ) > $bin/grass$ver.bat + unix2dos $bin/grass$ver.bat +fi From 9b2c5acfd09d2e9407acc30766f41d4c3692a8c6 Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Thu, 4 Jun 2020 22:27:22 -0400 Subject: [PATCH 34/64] Test packaging --- .github/workflows/build_osgeo4w.sh | 24 +++++++++++++++++++++++- .github/workflows/osgeo4w.yml | 4 +++- .github/workflows/test_simple.bat | 2 -- .github/workflows/test_thorough.bat | 2 -- 4 files changed, 26 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build_osgeo4w.sh b/.github/workflows/build_osgeo4w.sh index 87ffe63dc27..90eae74f5b6 100755 --- a/.github/workflows/build_osgeo4w.sh +++ b/.github/workflows/build_osgeo4w.sh @@ -1,9 +1,28 @@ #!/bin/sh -package=0 +# +# Usage: build_osgeo4w.sh [-p] [path] +# +# By default, the script will look for the source code in the current directory +# and create bin.x86_64-w64-mingw32\grass$ver.bat (run this batch file to start +# GRASS GIS) and dist.x86_64-w64-mingw32\etc\env.bat. +# +# -p optionally install GRASS GIS to C:\OSGeo4W64\opt\grass (run +# C:\OSGeo4W64\opt\grass\grass$ver.bat) and create an unzippable package +# grass$ver-x86_64-w64-mingw32-osgeo4w64-$date.zip +# +# path optionally specify a path to the source code +# # stop on errors set -e +if [ "$1" = "-p" ]; then + package=1 + shift +else + package=0 +fi + test -d "$1" && cd "$1" osgeo4w_path=/c/OSGeo4W64 @@ -40,6 +59,7 @@ ver=`sed -n '/^INST_DIR[ \t]*=/{s/^.*grass//; p}' include/Make/Platform.make` rm -f $dist/grass$ver.tmp $dist/etc/fontcap if [ $package -eq 1 ]; then + ######################################################################## # package opt_path=$osgeo4w_path/opt @@ -84,7 +104,9 @@ EOT osgeo4w_basename=`basename $osgeo4w_path` zip -r $zip $osgeo4w_basename \ -x "$osgeo4w_basename/var/*" "*/__pycache__/*" + ls -al $zip else + ######################################################################## # create batch files src_win_esc=`echo $src | sed 's#^/\([a-z]\)#\1:#; s#/#\\\\\\\\#g'` diff --git a/.github/workflows/osgeo4w.yml b/.github/workflows/osgeo4w.yml index ac278ed4cdf..8a49501df65 100644 --- a/.github/workflows/osgeo4w.yml +++ b/.github/workflows/osgeo4w.yml @@ -30,7 +30,9 @@ jobs: - name: Install MSYS2 packages run: C:\msys64\usr\bin\pacman.exe --noconfirm -S tar libintl make bison diffutils git dos2unix zip mingw-w64-x86_64-toolchain mingw-w64-x86_64-cairo mingw-w64-x86_64-python3-six - name: Compile GRASS GIS - run: C:\msys64\usr\bin\bash.exe -l (''+(Get-Location)+'\.github\workflows\build_osgeo4w.sh') (Get-Location) + run: C:\msys64\usr\bin\bash.exe -l (''+(Get-Location)+'\.github\workflows\build_osgeo4w.sh') -p (Get-Location) + - name: Set PATH + run: $env:PATH += 'C:\OSGeo4W64\opt\grass;' - name: Test executing of the grass command run: .github/workflows/test_simple.bat - name: Run tests diff --git a/.github/workflows/test_simple.bat b/.github/workflows/test_simple.bat index 47d57c0f0f4..ab45a564f7a 100644 --- a/.github/workflows/test_simple.bat +++ b/.github/workflows/test_simple.bat @@ -1,3 +1 @@ -set PATH=bin.x86_64-w64-mingw32;%PATH% - grass79 --tmp-location EPSG:4326 --exec g.region res=0.1 -p diff --git a/.github/workflows/test_thorough.bat b/.github/workflows/test_thorough.bat index 37f02ab4198..c908552b128 100644 --- a/.github/workflows/test_thorough.bat +++ b/.github/workflows/test_thorough.bat @@ -1,5 +1,3 @@ -set PATH=bin.x86_64-w64-mingw32;%PATH% - grass79 --tmp-location XY --exec g.extension g.download.location grass79 --tmp-location XY --exec g.download.location url=http://fatra.cnr.ncsu.edu/data/nc_spm_full_v2alpha2.tar.gz dbase=%USERPROFILE% From 459b394e106b376e69d81255d45071c327802f7e Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Thu, 4 Jun 2020 22:45:05 -0400 Subject: [PATCH 35/64] Test both uninstalled and packaged binaries --- .github/workflows/build_osgeo4w.sh | 109 ++++++++++++++--------------- .github/workflows/osgeo4w.yml | 12 +++- 2 files changed, 64 insertions(+), 57 deletions(-) diff --git a/.github/workflows/build_osgeo4w.sh b/.github/workflows/build_osgeo4w.sh index 90eae74f5b6..db0c0759d70 100755 --- a/.github/workflows/build_osgeo4w.sh +++ b/.github/workflows/build_osgeo4w.sh @@ -10,7 +10,7 @@ # C:\OSGeo4W64\opt\grass\grass$ver.bat) and create an unzippable package # grass$ver-x86_64-w64-mingw32-osgeo4w64-$date.zip # -# path optionally specify a path to the source code +# path specify a path to the source code # # stop on errors @@ -58,25 +58,16 @@ ver=`sed -n '/^INST_DIR[ \t]*=/{s/^.*grass//; p}' include/Make/Platform.make` rm -f $dist/grass$ver.tmp $dist/etc/fontcap -if [ $package -eq 1 ]; then - ######################################################################## - # package +# create batch files - opt_path=$osgeo4w_path/opt - grass_path=$opt_path/grass - date=`date +%Y%m%d` - zip=$src/grass$ver-$arch-osgeo4w64-$date.zip +src_win_esc=`echo $src | sed 's#^/\([a-z]\)#\1:#; s#/#\\\\\\\\#g'` +bin_win_esc="$src_win_esc\\$bin" +dist_win_esc="$src_win_esc\\$dist" - mkdir -p $opt_path - cp -a $dist $grass_path - cp -a $bin/grass$ver.py $grass_path/etc - cp -a `ldd $dist/lib/*.dll | awk '/mingw64/{print $3}' | - sort -u | grep -v 'lib\(crypto\|ssl\)'` $grass_path/lib - - ( - sed -e 's/^\(set GISBASE=\).*/\1%OSGEO4W_ROOT%\\opt\\grass/' \ - mswindows/osgeo4w/env.bat.tmpl - cat< $grass_path/etc/env.bat - unix2dos $grass_path/etc/env.bat - - ( - sed -e 's/^\(call "%~dp0\)\(.*\)$/\1\\..\\..\\bin\2/' \ - -e 's/^\(call "%OSGEO4W_ROOT%\\\).*\(\\etc\\env\.bat"\)$/\1opt\\grass\2/' \ - -e 's/@POSTFIX@/'$ver'/g' \ - mswindows/osgeo4w/grass.bat.tmpl - ) > $grass_path/grass$ver.bat - unix2dos $grass_path/grass$ver.bat - - cd $osgeo4w_path/.. - osgeo4w_basename=`basename $osgeo4w_path` - zip -r $zip $osgeo4w_basename \ - -x "$osgeo4w_basename/var/*" "*/__pycache__/*" - ls -al $zip -else - ######################################################################## - # create batch files +) > $dist/etc/env.bat +unix2dos $dist/etc/env.bat + +( +sed -e 's/^\(call "%~dp0\)\(.*\)$/\1\\..\\..\\bin\2/' \ + -e 's/^\(call "\).*\(\\etc\\env\.bat"\)$/\1'$dist_win_esc'\2/' \ + -e 's/@POSTFIX@/'$ver'/g' \ + mswindows/osgeo4w/grass.bat.tmpl +) > $bin/grass$ver.bat +unix2dos $bin/grass$ver.bat + +test $package -eq 0 && exit 0 - src_win_esc=`echo $src | sed 's#^/\([a-z]\)#\1:#; s#/#\\\\\\\\#g'` - bin_win_esc="$src_win_esc\\$bin" - dist_win_esc="$src_win_esc\\$dist" +# package - ( - sed 's/^\(set GISBASE=\).*/\1'$dist_win_esc'/' \ - mswindows/osgeo4w/env.bat.tmpl - cat< $dist/etc/env.bat - unix2dos $dist/etc/env.bat - - ( - sed -e 's/^\(call "%~dp0\)\(.*\)$/\1\\..\\..\\bin\2/' \ - -e 's/^\(call "\).*\(\\etc\\env\.bat"\)$/\1'$dist_win_esc'\2/' \ - -e 's/@POSTFIX@/'$ver'/g' \ - mswindows/osgeo4w/grass.bat.tmpl - ) > $bin/grass$ver.bat - unix2dos $bin/grass$ver.bat -fi +) > $grass_path/etc/env.bat +unix2dos $grass_path/etc/env.bat + +( +sed -e 's/^\(call "%~dp0\)\(.*\)$/\1\\..\\..\\bin\2/' \ + -e 's/^\(call "%OSGEO4W_ROOT%\\\).*\(\\etc\\env\.bat"\)$/\1opt\\grass\2/' \ + -e 's/@POSTFIX@/'$ver'/g' \ + mswindows/osgeo4w/grass.bat.tmpl +) > $grass_path/grass$ver.bat +unix2dos $grass_path/grass$ver.bat + +cd $osgeo4w_path/.. +osgeo4w_basename=`basename $osgeo4w_path` +zip -r $zip $osgeo4w_basename \ + -x "$osgeo4w_basename/var/*" "*/__pycache__/*" + +ls -al $zip diff --git a/.github/workflows/osgeo4w.yml b/.github/workflows/osgeo4w.yml index 8a49501df65..db6f1113e67 100644 --- a/.github/workflows/osgeo4w.yml +++ b/.github/workflows/osgeo4w.yml @@ -31,9 +31,17 @@ jobs: run: C:\msys64\usr\bin\pacman.exe --noconfirm -S tar libintl make bison diffutils git dos2unix zip mingw-w64-x86_64-toolchain mingw-w64-x86_64-cairo mingw-w64-x86_64-python3-six - name: Compile GRASS GIS run: C:\msys64\usr\bin\bash.exe -l (''+(Get-Location)+'\.github\workflows\build_osgeo4w.sh') -p (Get-Location) - - name: Set PATH - run: $env:PATH += 'C:\OSGeo4W64\opt\grass;' + - name: Backup PATH + run: $path = $env:PATH + - name: Set PATH to bin.x86_64-w64-mingw32 + run: $env:PATH = $path + 'bin.x86_64-w64-mingw32;' - name: Test executing of the grass command run: .github/workflows/test_simple.bat - name: Run tests run: .github/workflows/test_thorough.bat + - name: Set PATH to C:\OSGeo4W64\opt\grass + run: $env:PATH = $path + 'C:\OSGeo4W64\opt\grass;' + - name: Test executing of the grass command using the package + run: .github/workflows/test_simple.bat + - name: Run tests using the package + run: .github/workflows/test_thorough.bat From c480c8cd25ae22f7525498fd14d0006074907992 Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Thu, 4 Jun 2020 23:26:16 -0400 Subject: [PATCH 36/64] PATH not recognized? --- .github/workflows/build_osgeo4w.sh | 16 +++++++++------- .github/workflows/test_simple.bat | 2 ++ .github/workflows/test_thorough.bat | 3 +++ 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build_osgeo4w.sh b/.github/workflows/build_osgeo4w.sh index db0c0759d70..cd9f3f70f25 100755 --- a/.github/workflows/build_osgeo4w.sh +++ b/.github/workflows/build_osgeo4w.sh @@ -91,14 +91,12 @@ sed -e 's/^\(call "%~dp0\)\(.*\)$/\1\\..\\..\\bin\2/' \ ) > $bin/grass$ver.bat unix2dos $bin/grass$ver.bat -test $package -eq 0 && exit 0 +test $package -eq 0 && exit # package opt_path=$osgeo4w_path/opt grass_path=$opt_path/grass -date=`date +%Y%m%d` -zip=$src/grass$ver-$arch-osgeo4w64-$date.zip mkdir -p $opt_path cp -a $dist $grass_path @@ -133,9 +131,13 @@ sed -e 's/^\(call "%~dp0\)\(.*\)$/\1\\..\\..\\bin\2/' \ ) > $grass_path/grass$ver.bat unix2dos $grass_path/grass$ver.bat -cd $osgeo4w_path/.. +exit + +# don't package for GitHub workflow; unnecessary + osgeo4w_basename=`basename $osgeo4w_path` -zip -r $zip $osgeo4w_basename \ - -x "$osgeo4w_basename/var/*" "*/__pycache__/*" +date=`date +%Y%m%d` +zip=$src/grass$ver-$arch-osgeo4w64-$date.zip -ls -al $zip +cd $osgeo4w_path/.. +zip -r $zip $osgeo4w_basename -x "$osgeo4w_basename/var/*" "*/__pycache__/*" diff --git a/.github/workflows/test_simple.bat b/.github/workflows/test_simple.bat index ab45a564f7a..528af5cffde 100644 --- a/.github/workflows/test_simple.bat +++ b/.github/workflows/test_simple.bat @@ -1 +1,3 @@ +echo %PATH% +dir bin.x86_64-w64-mingw32 grass79 --tmp-location EPSG:4326 --exec g.region res=0.1 -p diff --git a/.github/workflows/test_thorough.bat b/.github/workflows/test_thorough.bat index c908552b128..818e0ad8ae0 100644 --- a/.github/workflows/test_thorough.bat +++ b/.github/workflows/test_thorough.bat @@ -1,3 +1,6 @@ +echo %PATH% +dir c:\osgeo4w64\opt\grass + grass79 --tmp-location XY --exec g.extension g.download.location grass79 --tmp-location XY --exec g.download.location url=http://fatra.cnr.ncsu.edu/data/nc_spm_full_v2alpha2.tar.gz dbase=%USERPROFILE% From 2dd4065c843e082c085c3177ab286ba0aa8d9482 Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Fri, 5 Jun 2020 00:21:23 -0400 Subject: [PATCH 37/64] Test PATH --- .github/workflows/osgeo4w.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.github/workflows/osgeo4w.yml b/.github/workflows/osgeo4w.yml index db6f1113e67..e328f3eb4d9 100644 --- a/.github/workflows/osgeo4w.yml +++ b/.github/workflows/osgeo4w.yml @@ -21,16 +21,6 @@ jobs: git config --global core.autocrlf false git config --global core.eol lf - uses: actions/checkout@v2 - - name: Install OSGeo4W - run: | - $exe = 'osgeo4w-setup-x86_64.exe' - $url = 'http://download.osgeo.org/osgeo4w/' + $exe - (New-Object System.Net.WebClient).DownloadFile($url, $exe) - Start-Process ('.\'+$exe) -ArgumentList '-A -g -k -q -s http://download.osgeo.org/x86_64 -P cairo,fftw,freetype-devel,gdal-ecw,gdal-mrsid,liblas-devel,libxdr,msys,pdcurses,python3-numpy,python3-pywin32,python3-wx,regex-devel,wxpython,zstd-devel' -Wait - - name: Install MSYS2 packages - run: C:\msys64\usr\bin\pacman.exe --noconfirm -S tar libintl make bison diffutils git dos2unix zip mingw-w64-x86_64-toolchain mingw-w64-x86_64-cairo mingw-w64-x86_64-python3-six - - name: Compile GRASS GIS - run: C:\msys64\usr\bin\bash.exe -l (''+(Get-Location)+'\.github\workflows\build_osgeo4w.sh') -p (Get-Location) - name: Backup PATH run: $path = $env:PATH - name: Set PATH to bin.x86_64-w64-mingw32 From 472e9b6857a0c95f8a126dd6c9637d021bb4f457 Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Fri, 5 Jun 2020 00:25:15 -0400 Subject: [PATCH 38/64] Test PATH --- .github/workflows/osgeo4w.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/osgeo4w.yml b/.github/workflows/osgeo4w.yml index e328f3eb4d9..ee716132756 100644 --- a/.github/workflows/osgeo4w.yml +++ b/.github/workflows/osgeo4w.yml @@ -24,7 +24,9 @@ jobs: - name: Backup PATH run: $path = $env:PATH - name: Set PATH to bin.x86_64-w64-mingw32 - run: $env:PATH = $path + 'bin.x86_64-w64-mingw32;' + run: | + $env:PATH = $path + 'bin.x86_64-w64-mingw32;' + echo $env:PATH - name: Test executing of the grass command run: .github/workflows/test_simple.bat - name: Run tests From bbc454946667d963605c2770843a5b48dbf5aa82 Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Fri, 5 Jun 2020 00:29:08 -0400 Subject: [PATCH 39/64] Test PATH --- .github/workflows/osgeo4w.yml | 24 ++++++++++++------------ .github/workflows/test_simple.bat | 3 +-- .github/workflows/test_thorough.bat | 7 +++---- 3 files changed, 16 insertions(+), 18 deletions(-) diff --git a/.github/workflows/osgeo4w.yml b/.github/workflows/osgeo4w.yml index ee716132756..50eb366cf7a 100644 --- a/.github/workflows/osgeo4w.yml +++ b/.github/workflows/osgeo4w.yml @@ -21,19 +21,19 @@ jobs: git config --global core.autocrlf false git config --global core.eol lf - uses: actions/checkout@v2 - - name: Backup PATH - run: $path = $env:PATH - - name: Set PATH to bin.x86_64-w64-mingw32 - run: | - $env:PATH = $path + 'bin.x86_64-w64-mingw32;' - echo $env:PATH - name: Test executing of the grass command - run: .github/workflows/test_simple.bat + run: | + $env:PATH += 'bin.x86_64-w64-mingw32;' + .github/workflows/test_simple.bat - name: Run tests - run: .github/workflows/test_thorough.bat - - name: Set PATH to C:\OSGeo4W64\opt\grass - run: $env:PATH = $path + 'C:\OSGeo4W64\opt\grass;' + run: | + $env:PATH += 'bin.x86_64-w64-mingw32;' + .github/workflows/test_thorough.bat - name: Test executing of the grass command using the package - run: .github/workflows/test_simple.bat + run: | + $env:PATH += 'C:\OSGeo4W64\opt\grass;' + .github/workflows/test_simple.bat - name: Run tests using the package - run: .github/workflows/test_thorough.bat + run: | + $env:PATH += 'C:\OSGeo4W64\opt\grass;' + .github/workflows/test_thorough.bat diff --git a/.github/workflows/test_simple.bat b/.github/workflows/test_simple.bat index 528af5cffde..3a2e63aa356 100644 --- a/.github/workflows/test_simple.bat +++ b/.github/workflows/test_simple.bat @@ -1,3 +1,2 @@ echo %PATH% -dir bin.x86_64-w64-mingw32 -grass79 --tmp-location EPSG:4326 --exec g.region res=0.1 -p +rem grass79 --tmp-location EPSG:4326 --exec g.region res=0.1 -p diff --git a/.github/workflows/test_thorough.bat b/.github/workflows/test_thorough.bat index 818e0ad8ae0..1f2c5625a0a 100644 --- a/.github/workflows/test_thorough.bat +++ b/.github/workflows/test_thorough.bat @@ -1,7 +1,6 @@ echo %PATH% -dir c:\osgeo4w64\opt\grass -grass79 --tmp-location XY --exec g.extension g.download.location -grass79 --tmp-location XY --exec g.download.location url=http://fatra.cnr.ncsu.edu/data/nc_spm_full_v2alpha2.tar.gz dbase=%USERPROFILE% +rem grass79 --tmp-location XY --exec g.extension g.download.location +rem grass79 --tmp-location XY --exec g.download.location url=http://fatra.cnr.ncsu.edu/data/nc_spm_full_v2alpha2.tar.gz dbase=%USERPROFILE% -grass79 --tmp-location XY --exec python3 -m grass.gunittest.main --grassdata %USERPROFILE% --location nc_spm_full_v2alpha2 --location-type nc --min-success 80 +rem grass79 --tmp-location XY --exec python3 -m grass.gunittest.main --grassdata %USERPROFILE% --location nc_spm_full_v2alpha2 --location-type nc --min-success 80 From 9e50a0c66e28ce679f0f0a9afd2210163e43f884 Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Fri, 5 Jun 2020 00:35:15 -0400 Subject: [PATCH 40/64] OK, runs are separate sessions --- .github/workflows/osgeo4w.yml | 10 ++++++++++ .github/workflows/test_simple.bat | 3 +-- .github/workflows/test_thorough.bat | 8 +++----- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/workflows/osgeo4w.yml b/.github/workflows/osgeo4w.yml index 50eb366cf7a..f0723b09bff 100644 --- a/.github/workflows/osgeo4w.yml +++ b/.github/workflows/osgeo4w.yml @@ -21,6 +21,16 @@ jobs: git config --global core.autocrlf false git config --global core.eol lf - uses: actions/checkout@v2 + - name: Install OSGeo4W + run: | + $exe = 'osgeo4w-setup-x86_64.exe' + $url = 'http://download.osgeo.org/osgeo4w/' + $exe + (New-Object System.Net.WebClient).DownloadFile($url, $exe) + Start-Process ('.\'+$exe) -ArgumentList '-A -g -k -q -s http://download.osgeo.org/x86_64 -P cairo,fftw,freetype-devel,gdal-ecw,gdal-mrsid,liblas-devel,libxdr,msys,pdcurses,python3-numpy,python3-pywin32,python3-wx,regex-devel,wxpython,zstd-devel' -Wait + - name: Install MSYS2 packages + run: C:\msys64\usr\bin\pacman.exe --noconfirm -S tar libintl make bison diffutils git dos2unix zip mingw-w64-x86_64-toolchain mingw-w64-x86_64-cairo mingw-w64-x86_64-python3-six + - name: Compile GRASS GIS + run: C:\msys64\usr\bin\bash.exe -l (''+(Get-Location)+'\.github\workflows\build_osgeo4w.sh') -p (Get-Location) - name: Test executing of the grass command run: | $env:PATH += 'bin.x86_64-w64-mingw32;' diff --git a/.github/workflows/test_simple.bat b/.github/workflows/test_simple.bat index 3a2e63aa356..ab45a564f7a 100644 --- a/.github/workflows/test_simple.bat +++ b/.github/workflows/test_simple.bat @@ -1,2 +1 @@ -echo %PATH% -rem grass79 --tmp-location EPSG:4326 --exec g.region res=0.1 -p +grass79 --tmp-location EPSG:4326 --exec g.region res=0.1 -p diff --git a/.github/workflows/test_thorough.bat b/.github/workflows/test_thorough.bat index 1f2c5625a0a..c908552b128 100644 --- a/.github/workflows/test_thorough.bat +++ b/.github/workflows/test_thorough.bat @@ -1,6 +1,4 @@ -echo %PATH% +grass79 --tmp-location XY --exec g.extension g.download.location +grass79 --tmp-location XY --exec g.download.location url=http://fatra.cnr.ncsu.edu/data/nc_spm_full_v2alpha2.tar.gz dbase=%USERPROFILE% -rem grass79 --tmp-location XY --exec g.extension g.download.location -rem grass79 --tmp-location XY --exec g.download.location url=http://fatra.cnr.ncsu.edu/data/nc_spm_full_v2alpha2.tar.gz dbase=%USERPROFILE% - -rem grass79 --tmp-location XY --exec python3 -m grass.gunittest.main --grassdata %USERPROFILE% --location nc_spm_full_v2alpha2 --location-type nc --min-success 80 +grass79 --tmp-location XY --exec python3 -m grass.gunittest.main --grassdata %USERPROFILE% --location nc_spm_full_v2alpha2 --location-type nc --min-success 80 From 9d604afad327ee25511a60ec080fc21005015aea Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Fri, 5 Jun 2020 02:06:29 -0400 Subject: [PATCH 41/64] OK.. batch files do not recognize $env:PATH? --- .github/workflows/osgeo4w.yml | 16 ++++------------ .github/workflows/test_simple.bat | 2 ++ .github/workflows/test_thorough.bat | 2 ++ 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/.github/workflows/osgeo4w.yml b/.github/workflows/osgeo4w.yml index f0723b09bff..fe809d0b715 100644 --- a/.github/workflows/osgeo4w.yml +++ b/.github/workflows/osgeo4w.yml @@ -32,18 +32,10 @@ jobs: - name: Compile GRASS GIS run: C:\msys64\usr\bin\bash.exe -l (''+(Get-Location)+'\.github\workflows\build_osgeo4w.sh') -p (Get-Location) - name: Test executing of the grass command - run: | - $env:PATH += 'bin.x86_64-w64-mingw32;' - .github/workflows/test_simple.bat + run: .github/workflows/test_simple.bat 'bin.x86_64-w64-mingw32;' - name: Run tests - run: | - $env:PATH += 'bin.x86_64-w64-mingw32;' - .github/workflows/test_thorough.bat + run: .github/workflows/test_thorough.bat 'bin.x86_64-w64-mingw32;' - name: Test executing of the grass command using the package - run: | - $env:PATH += 'C:\OSGeo4W64\opt\grass;' - .github/workflows/test_simple.bat + run: .github/workflows/test_simple.bat 'C:\OSGeo4W64\opt\grass;' - name: Run tests using the package - run: | - $env:PATH += 'C:\OSGeo4W64\opt\grass;' - .github/workflows/test_thorough.bat + run: .github/workflows/test_thorough.bat 'C:\OSGeo4W64\opt\grass;' diff --git a/.github/workflows/test_simple.bat b/.github/workflows/test_simple.bat index ab45a564f7a..b550be1f110 100644 --- a/.github/workflows/test_simple.bat +++ b/.github/workflows/test_simple.bat @@ -1 +1,3 @@ +set PATH=%PATH%;%1 + grass79 --tmp-location EPSG:4326 --exec g.region res=0.1 -p diff --git a/.github/workflows/test_thorough.bat b/.github/workflows/test_thorough.bat index c908552b128..22e9a367330 100644 --- a/.github/workflows/test_thorough.bat +++ b/.github/workflows/test_thorough.bat @@ -1,3 +1,5 @@ +set PATH=%PATH%;%1 + grass79 --tmp-location XY --exec g.extension g.download.location grass79 --tmp-location XY --exec g.download.location url=http://fatra.cnr.ncsu.edu/data/nc_spm_full_v2alpha2.tar.gz dbase=%USERPROFILE% From a75580006b546515cec7708a5ca4e9a21f639fd9 Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Fri, 5 Jun 2020 09:47:54 -0400 Subject: [PATCH 42/64] Remove trailing semi-colons --- .github/workflows/osgeo4w.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/osgeo4w.yml b/.github/workflows/osgeo4w.yml index fe809d0b715..f75e5bff9f3 100644 --- a/.github/workflows/osgeo4w.yml +++ b/.github/workflows/osgeo4w.yml @@ -32,10 +32,10 @@ jobs: - name: Compile GRASS GIS run: C:\msys64\usr\bin\bash.exe -l (''+(Get-Location)+'\.github\workflows\build_osgeo4w.sh') -p (Get-Location) - name: Test executing of the grass command - run: .github/workflows/test_simple.bat 'bin.x86_64-w64-mingw32;' + run: .github/workflows/test_simple.bat 'bin.x86_64-w64-mingw32' - name: Run tests - run: .github/workflows/test_thorough.bat 'bin.x86_64-w64-mingw32;' + run: .github/workflows/test_thorough.bat 'bin.x86_64-w64-mingw32' - name: Test executing of the grass command using the package - run: .github/workflows/test_simple.bat 'C:\OSGeo4W64\opt\grass;' + run: .github/workflows/test_simple.bat 'C:\OSGeo4W64\opt\grass' - name: Run tests using the package - run: .github/workflows/test_thorough.bat 'C:\OSGeo4W64\opt\grass;' + run: .github/workflows/test_thorough.bat 'C:\OSGeo4W64\opt\grass' From 9093e58802901a01cb64dde50e26023f004ac9ad Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Fri, 5 Jun 2020 15:13:44 -0400 Subject: [PATCH 43/64] unix2dos batch files --- .github/workflows/test_simple.bat | 7 ++++--- .github/workflows/test_thorough.bat | 15 +++++++++------ 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test_simple.bat b/.github/workflows/test_simple.bat index b550be1f110..7f057116f95 100644 --- a/.github/workflows/test_simple.bat +++ b/.github/workflows/test_simple.bat @@ -1,3 +1,4 @@ -set PATH=%PATH%;%1 - -grass79 --tmp-location EPSG:4326 --exec g.region res=0.1 -p +@echo off +set PATH=%PATH%;%1 + +grass79 --tmp-location EPSG:4326 --exec g.region res=0.1 -p diff --git a/.github/workflows/test_thorough.bat b/.github/workflows/test_thorough.bat index 22e9a367330..e1c74638962 100644 --- a/.github/workflows/test_thorough.bat +++ b/.github/workflows/test_thorough.bat @@ -1,6 +1,9 @@ -set PATH=%PATH%;%1 - -grass79 --tmp-location XY --exec g.extension g.download.location -grass79 --tmp-location XY --exec g.download.location url=http://fatra.cnr.ncsu.edu/data/nc_spm_full_v2alpha2.tar.gz dbase=%USERPROFILE% - -grass79 --tmp-location XY --exec python3 -m grass.gunittest.main --grassdata %USERPROFILE% --location nc_spm_full_v2alpha2 --location-type nc --min-success 80 +@echo off +set PATH=%PATH%;%1 + +echo %USERPROFILE% + +grass79 --tmp-location XY --exec g.extension g.download.location +grass79 --tmp-location XY --exec g.download.location url=http://fatra.cnr.ncsu.edu/data/nc_spm_full_v2alpha2.tar.gz dbase=%USERPROFILE% + +grass79 --tmp-location XY --exec python3 -m grass.gunittest.main --grassdata %USERPROFILE% --location nc_spm_full_v2alpha2 --location-type nc --min-success 80 From acf8bc9a895e26e41fe9887070cdb30291a32380 Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Fri, 5 Jun 2020 16:31:23 -0400 Subject: [PATCH 44/64] Back to LF; use cmd /c --- .github/workflows/test_simple.bat | 8 ++++---- .github/workflows/test_thorough.bat | 16 +++++++--------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test_simple.bat b/.github/workflows/test_simple.bat index 7f057116f95..4df4eeeb3d5 100644 --- a/.github/workflows/test_simple.bat +++ b/.github/workflows/test_simple.bat @@ -1,4 +1,4 @@ -@echo off -set PATH=%PATH%;%1 - -grass79 --tmp-location EPSG:4326 --exec g.region res=0.1 -p +@echo off +set PATH=%PATH%;%1 + +cmd /c grass79 --tmp-location EPSG:4326 --exec g.region res=0.1 -p diff --git a/.github/workflows/test_thorough.bat b/.github/workflows/test_thorough.bat index e1c74638962..62dd7b052bf 100644 --- a/.github/workflows/test_thorough.bat +++ b/.github/workflows/test_thorough.bat @@ -1,9 +1,7 @@ -@echo off -set PATH=%PATH%;%1 - -echo %USERPROFILE% - -grass79 --tmp-location XY --exec g.extension g.download.location -grass79 --tmp-location XY --exec g.download.location url=http://fatra.cnr.ncsu.edu/data/nc_spm_full_v2alpha2.tar.gz dbase=%USERPROFILE% - -grass79 --tmp-location XY --exec python3 -m grass.gunittest.main --grassdata %USERPROFILE% --location nc_spm_full_v2alpha2 --location-type nc --min-success 80 +@echo off +set PATH=%PATH%;%1 + +cmd /c grass79 --tmp-location XY --exec g.extension g.download.location +cmd /c grass79 --tmp-location XY --exec g.download.location url=http://fatra.cnr.ncsu.edu/data/nc_spm_full_v2alpha2.tar.gz dbase=%USERPROFILE% + +cmd /c grass79 --tmp-location XY --exec python3 -m grass.gunittest.main --grassdata %USERPROFILE% --location nc_spm_full_v2alpha2 --location-type nc --min-success 80 From 5bc58adbbff7b198f2b4d2b841c37dc2939346aa Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Fri, 5 Jun 2020 16:39:50 -0400 Subject: [PATCH 45/64] Use call instead of cmd /c --- .github/workflows/test_simple.bat | 2 +- .github/workflows/test_thorough.bat | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test_simple.bat b/.github/workflows/test_simple.bat index 4df4eeeb3d5..70680a33619 100644 --- a/.github/workflows/test_simple.bat +++ b/.github/workflows/test_simple.bat @@ -1,4 +1,4 @@ @echo off set PATH=%PATH%;%1 -cmd /c grass79 --tmp-location EPSG:4326 --exec g.region res=0.1 -p +call grass79 --tmp-location EPSG:4326 --exec g.region res=0.1 -p diff --git a/.github/workflows/test_thorough.bat b/.github/workflows/test_thorough.bat index 62dd7b052bf..b93709e5a0c 100644 --- a/.github/workflows/test_thorough.bat +++ b/.github/workflows/test_thorough.bat @@ -1,7 +1,7 @@ @echo off set PATH=%PATH%;%1 -cmd /c grass79 --tmp-location XY --exec g.extension g.download.location -cmd /c grass79 --tmp-location XY --exec g.download.location url=http://fatra.cnr.ncsu.edu/data/nc_spm_full_v2alpha2.tar.gz dbase=%USERPROFILE% +call grass79 --tmp-location XY --exec g.extension g.download.location +call grass79 --tmp-location XY --exec g.download.location url=http://fatra.cnr.ncsu.edu/data/nc_spm_full_v2alpha2.tar.gz dbase=%USERPROFILE% -cmd /c grass79 --tmp-location XY --exec python3 -m grass.gunittest.main --grassdata %USERPROFILE% --location nc_spm_full_v2alpha2 --location-type nc --min-success 80 +call grass79 --tmp-location XY --exec python3 -m grass.gunittest.main --grassdata %USERPROFILE% --location nc_spm_full_v2alpha2 --location-type nc --min-success 80 From c65727bc1d4f29d5368fd92aa45b3522a315b053 Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Fri, 5 Jun 2020 17:23:28 -0400 Subject: [PATCH 46/64] cmd /c works; call does not --- .github/workflows/test_simple.bat | 2 +- .github/workflows/test_thorough.bat | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test_simple.bat b/.github/workflows/test_simple.bat index 70680a33619..4df4eeeb3d5 100644 --- a/.github/workflows/test_simple.bat +++ b/.github/workflows/test_simple.bat @@ -1,4 +1,4 @@ @echo off set PATH=%PATH%;%1 -call grass79 --tmp-location EPSG:4326 --exec g.region res=0.1 -p +cmd /c grass79 --tmp-location EPSG:4326 --exec g.region res=0.1 -p diff --git a/.github/workflows/test_thorough.bat b/.github/workflows/test_thorough.bat index b93709e5a0c..62dd7b052bf 100644 --- a/.github/workflows/test_thorough.bat +++ b/.github/workflows/test_thorough.bat @@ -1,7 +1,7 @@ @echo off set PATH=%PATH%;%1 -call grass79 --tmp-location XY --exec g.extension g.download.location -call grass79 --tmp-location XY --exec g.download.location url=http://fatra.cnr.ncsu.edu/data/nc_spm_full_v2alpha2.tar.gz dbase=%USERPROFILE% +cmd /c grass79 --tmp-location XY --exec g.extension g.download.location +cmd /c grass79 --tmp-location XY --exec g.download.location url=http://fatra.cnr.ncsu.edu/data/nc_spm_full_v2alpha2.tar.gz dbase=%USERPROFILE% -call grass79 --tmp-location XY --exec python3 -m grass.gunittest.main --grassdata %USERPROFILE% --location nc_spm_full_v2alpha2 --location-type nc --min-success 80 +cmd /c grass79 --tmp-location XY --exec python3 -m grass.gunittest.main --grassdata %USERPROFILE% --location nc_spm_full_v2alpha2 --location-type nc --min-success 80 From 32dd6421300dbaa13e554ef5590777cf274be2a1 Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Fri, 5 Jun 2020 17:55:14 -0400 Subject: [PATCH 47/64] Fix gunittest for Windows --- lib/python/gunittest/reporters.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/python/gunittest/reporters.py b/lib/python/gunittest/reporters.py index 9daa476c115..a1e305b8df8 100644 --- a/lib/python/gunittest/reporters.py +++ b/lib/python/gunittest/reporters.py @@ -97,10 +97,11 @@ def anonymize(self, filenames): # to remove user home directory and GISDBASE # we suppuse that we run in standard grass session # TODO: provide more effective implementation + path_end = r'[\\/]?' for path in self._paths_to_remove: for filename in filenames: - path_end = r'[\\/]?' - replace_in_file(filename, path + path_end, '') + replace_in_file(filename, + path.replace('\\', r'\\') + path_end, '') def get_source_url(path, revision, line=None): From de48e5cc818e0fec4837522419d851c163f3a22e Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Fri, 5 Jun 2020 19:33:06 -0400 Subject: [PATCH 48/64] Relative paths not working? --- .github/workflows/osgeo4w.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/osgeo4w.yml b/.github/workflows/osgeo4w.yml index f75e5bff9f3..2b0ca20688d 100644 --- a/.github/workflows/osgeo4w.yml +++ b/.github/workflows/osgeo4w.yml @@ -32,9 +32,9 @@ jobs: - name: Compile GRASS GIS run: C:\msys64\usr\bin\bash.exe -l (''+(Get-Location)+'\.github\workflows\build_osgeo4w.sh') -p (Get-Location) - name: Test executing of the grass command - run: .github/workflows/test_simple.bat 'bin.x86_64-w64-mingw32' + run: .github/workflows/test_simple.bat (''+(Get-Location)+'\bin.x86_64-w64-mingw32') - name: Run tests - run: .github/workflows/test_thorough.bat 'bin.x86_64-w64-mingw32' + run: .github/workflows/test_thorough.bat (''+(Get-Location)+'\bin.x86_64-w64-mingw32') - name: Test executing of the grass command using the package run: .github/workflows/test_simple.bat 'C:\OSGeo4W64\opt\grass' - name: Run tests using the package From 757020bea2e2ec7b2ddfc9aabe89e4d49cf8f5ec Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Fri, 5 Jun 2020 19:38:37 -0400 Subject: [PATCH 49/64] Workflow name to build and tests --- .github/workflows/osgeo4w.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/osgeo4w.yml b/.github/workflows/osgeo4w.yml index 2b0ca20688d..f10a03869da 100644 --- a/.github/workflows/osgeo4w.yml +++ b/.github/workflows/osgeo4w.yml @@ -6,7 +6,7 @@ on: jobs: build: - name: ${{ matrix.os }} build + name: ${{ matrix.os }} build and tests runs-on: ${{ matrix.os }} strategy: From 26f2a45020f968d5cf3f0f919dae23fb9f2d3df6 Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Fri, 5 Jun 2020 20:47:35 -0400 Subject: [PATCH 50/64] Fix paths --- .github/workflows/build_osgeo4w.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_osgeo4w.sh b/.github/workflows/build_osgeo4w.sh index cd9f3f70f25..485369c88a9 100755 --- a/.github/workflows/build_osgeo4w.sh +++ b/.github/workflows/build_osgeo4w.sh @@ -61,8 +61,7 @@ rm -f $dist/grass$ver.tmp $dist/etc/fontcap # create batch files src_win_esc=`echo $src | sed 's#^/\([a-z]\)#\1:#; s#/#\\\\\\\\#g'` -bin_win_esc="$src_win_esc\\$bin" -dist_win_esc="$src_win_esc\\$dist" +dist_win_esc="$src_win_esc\\\\$dist" ( sed 's/^\(set GISBASE=\).*/\1'$dist_win_esc'/' \ @@ -84,8 +83,9 @@ EOT unix2dos $dist/etc/env.bat ( -sed -e 's/^\(call "%~dp0\)\(.*\)$/\1\\..\\..\\bin\2/' \ +sed -e 's/^\(call "\)%~dp0\(.*\)$/\1C:\\OSGeo4W64\\bin\2/' \ -e 's/^\(call "\).*\(\\etc\\env\.bat"\)$/\1'$dist_win_esc'\2/' \ + -e 's/^\(.* "\)%GISBASE%\\etc\(\\grass.*\)$/\1%GISBASE%\\..\\bin.'$arch'\2/' \ -e 's/@POSTFIX@/'$ver'/g' \ mswindows/osgeo4w/grass.bat.tmpl ) > $bin/grass$ver.bat From fae13e761df6a931b5e21c5ab49e226d80f9e21e Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Fri, 5 Jun 2020 21:06:20 -0400 Subject: [PATCH 51/64] Add mingw64 path --- .github/workflows/build_osgeo4w.sh | 2 +- .github/workflows/test_simple.bat | 5 +++-- .github/workflows/test_thorough.bat | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build_osgeo4w.sh b/.github/workflows/build_osgeo4w.sh index 485369c88a9..4ad35154819 100755 --- a/.github/workflows/build_osgeo4w.sh +++ b/.github/workflows/build_osgeo4w.sh @@ -68,7 +68,7 @@ sed 's/^\(set GISBASE=\).*/\1'$dist_win_esc'/' \ mswindows/osgeo4w/env.bat.tmpl cat< Date: Fri, 5 Jun 2020 21:07:47 -0400 Subject: [PATCH 52/64] Back to relative paths --- .github/workflows/osgeo4w.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/osgeo4w.yml b/.github/workflows/osgeo4w.yml index f10a03869da..d35aeb9bdbb 100644 --- a/.github/workflows/osgeo4w.yml +++ b/.github/workflows/osgeo4w.yml @@ -32,9 +32,9 @@ jobs: - name: Compile GRASS GIS run: C:\msys64\usr\bin\bash.exe -l (''+(Get-Location)+'\.github\workflows\build_osgeo4w.sh') -p (Get-Location) - name: Test executing of the grass command - run: .github/workflows/test_simple.bat (''+(Get-Location)+'\bin.x86_64-w64-mingw32') + run: .github/workflows/test_simple.bat 'bin.x86_64-w64-mingw32' - name: Run tests - run: .github/workflows/test_thorough.bat (''+(Get-Location)+'\bin.x86_64-w64-mingw32') + run: .github/workflows/test_thorough.bat 'bin.x86_64-w64-mingw32' - name: Test executing of the grass command using the package run: .github/workflows/test_simple.bat 'C:\OSGeo4W64\opt\grass' - name: Run tests using the package From 1b1001d739a14b29513fba4976484d09ca4a3342 Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Fri, 5 Jun 2020 21:10:05 -0400 Subject: [PATCH 53/64] Use $bin instead of bin.$arch --- .github/workflows/build_osgeo4w.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_osgeo4w.sh b/.github/workflows/build_osgeo4w.sh index 4ad35154819..9f11dd25832 100755 --- a/.github/workflows/build_osgeo4w.sh +++ b/.github/workflows/build_osgeo4w.sh @@ -85,7 +85,7 @@ unix2dos $dist/etc/env.bat ( sed -e 's/^\(call "\)%~dp0\(.*\)$/\1C:\\OSGeo4W64\\bin\2/' \ -e 's/^\(call "\).*\(\\etc\\env\.bat"\)$/\1'$dist_win_esc'\2/' \ - -e 's/^\(.* "\)%GISBASE%\\etc\(\\grass.*\)$/\1%GISBASE%\\..\\bin.'$arch'\2/' \ + -e 's/^\(.* "\)%GISBASE%\\etc\(\\grass.*\)$/\1%GISBASE%\\..\\'$bin'\2/' \ -e 's/@POSTFIX@/'$ver'/g' \ mswindows/osgeo4w/grass.bat.tmpl ) > $bin/grass$ver.bat From 141d117f9094b74b981199e04932e7d827b2f928 Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Fri, 5 Jun 2020 21:47:54 -0400 Subject: [PATCH 54/64] Just directly call grass.bat; PATH changes after each grass.bat call --- .github/workflows/test_simple.bat | 6 +----- .github/workflows/test_thorough.bat | 10 +++------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test_simple.bat b/.github/workflows/test_simple.bat index 468bae7879d..f0ccb43ec8f 100644 --- a/.github/workflows/test_simple.bat +++ b/.github/workflows/test_simple.bat @@ -1,5 +1 @@ -@echo off -set PATH=%PATH%;%* -echo %PATH% - -call grass79 --tmp-location EPSG:4326 --exec g.region res=0.1 -p +call %1\grass79 --tmp-location EPSG:4326 --exec g.region res=0.1 -p diff --git a/.github/workflows/test_thorough.bat b/.github/workflows/test_thorough.bat index b93709e5a0c..fc45e924aae 100644 --- a/.github/workflows/test_thorough.bat +++ b/.github/workflows/test_thorough.bat @@ -1,7 +1,3 @@ -@echo off -set PATH=%PATH%;%1 - -call grass79 --tmp-location XY --exec g.extension g.download.location -call grass79 --tmp-location XY --exec g.download.location url=http://fatra.cnr.ncsu.edu/data/nc_spm_full_v2alpha2.tar.gz dbase=%USERPROFILE% - -call grass79 --tmp-location XY --exec python3 -m grass.gunittest.main --grassdata %USERPROFILE% --location nc_spm_full_v2alpha2 --location-type nc --min-success 80 +call %1\grass79 --tmp-location XY --exec g.extension g.download.location +call %1\grass79 --tmp-location XY --exec g.download.location url=http://fatra.cnr.ncsu.edu/data/nc_spm_full_v2alpha2.tar.gz dbase=%USERPROFILE% +call %1\grass79 --tmp-location XY --exec python3 -m grass.gunittest.main --grassdata %USERPROFILE% --location nc_spm_full_v2alpha2 --location-type nc --min-success 80 From 1d59764d6959627e78ab899b83b1efb390cf6eaf Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Fri, 5 Jun 2020 23:16:44 -0400 Subject: [PATCH 55/64] Python encodings module test --- .github/workflows/osgeo4w.yml | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/.github/workflows/osgeo4w.yml b/.github/workflows/osgeo4w.yml index d35aeb9bdbb..02c45e9b5b9 100644 --- a/.github/workflows/osgeo4w.yml +++ b/.github/workflows/osgeo4w.yml @@ -27,15 +27,5 @@ jobs: $url = 'http://download.osgeo.org/osgeo4w/' + $exe (New-Object System.Net.WebClient).DownloadFile($url, $exe) Start-Process ('.\'+$exe) -ArgumentList '-A -g -k -q -s http://download.osgeo.org/x86_64 -P cairo,fftw,freetype-devel,gdal-ecw,gdal-mrsid,liblas-devel,libxdr,msys,pdcurses,python3-numpy,python3-pywin32,python3-wx,regex-devel,wxpython,zstd-devel' -Wait - - name: Install MSYS2 packages - run: C:\msys64\usr\bin\pacman.exe --noconfirm -S tar libintl make bison diffutils git dos2unix zip mingw-w64-x86_64-toolchain mingw-w64-x86_64-cairo mingw-w64-x86_64-python3-six - - name: Compile GRASS GIS - run: C:\msys64\usr\bin\bash.exe -l (''+(Get-Location)+'\.github\workflows\build_osgeo4w.sh') -p (Get-Location) - - name: Test executing of the grass command - run: .github/workflows/test_simple.bat 'bin.x86_64-w64-mingw32' - - name: Run tests - run: .github/workflows/test_thorough.bat 'bin.x86_64-w64-mingw32' - - name: Test executing of the grass command using the package - run: .github/workflows/test_simple.bat 'C:\OSGeo4W64\opt\grass' - - name: Run tests using the package - run: .github/workflows/test_thorough.bat 'C:\OSGeo4W64\opt\grass' + - name: Test encodings module + run: C:\OSGeo4W64\apps\Python37\python.exe -m encodings From 2a1bbfd2ab814be0ef0466cde698aa75d91ef480 Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Fri, 5 Jun 2020 23:47:39 -0400 Subject: [PATCH 56/64] Avoid python3 from mingw64 --- .github/workflows/osgeo4w.yml | 14 ++++++++++++-- .github/workflows/test_simple.bat | 4 +++- .github/workflows/test_thorough.bat | 9 ++++++--- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/.github/workflows/osgeo4w.yml b/.github/workflows/osgeo4w.yml index 02c45e9b5b9..d35aeb9bdbb 100644 --- a/.github/workflows/osgeo4w.yml +++ b/.github/workflows/osgeo4w.yml @@ -27,5 +27,15 @@ jobs: $url = 'http://download.osgeo.org/osgeo4w/' + $exe (New-Object System.Net.WebClient).DownloadFile($url, $exe) Start-Process ('.\'+$exe) -ArgumentList '-A -g -k -q -s http://download.osgeo.org/x86_64 -P cairo,fftw,freetype-devel,gdal-ecw,gdal-mrsid,liblas-devel,libxdr,msys,pdcurses,python3-numpy,python3-pywin32,python3-wx,regex-devel,wxpython,zstd-devel' -Wait - - name: Test encodings module - run: C:\OSGeo4W64\apps\Python37\python.exe -m encodings + - name: Install MSYS2 packages + run: C:\msys64\usr\bin\pacman.exe --noconfirm -S tar libintl make bison diffutils git dos2unix zip mingw-w64-x86_64-toolchain mingw-w64-x86_64-cairo mingw-w64-x86_64-python3-six + - name: Compile GRASS GIS + run: C:\msys64\usr\bin\bash.exe -l (''+(Get-Location)+'\.github\workflows\build_osgeo4w.sh') -p (Get-Location) + - name: Test executing of the grass command + run: .github/workflows/test_simple.bat 'bin.x86_64-w64-mingw32' + - name: Run tests + run: .github/workflows/test_thorough.bat 'bin.x86_64-w64-mingw32' + - name: Test executing of the grass command using the package + run: .github/workflows/test_simple.bat 'C:\OSGeo4W64\opt\grass' + - name: Run tests using the package + run: .github/workflows/test_thorough.bat 'C:\OSGeo4W64\opt\grass' diff --git a/.github/workflows/test_simple.bat b/.github/workflows/test_simple.bat index f0ccb43ec8f..911ccc70915 100644 --- a/.github/workflows/test_simple.bat +++ b/.github/workflows/test_simple.bat @@ -1 +1,3 @@ -call %1\grass79 --tmp-location EPSG:4326 --exec g.region res=0.1 -p +set grass=%1\grass79 + +call %grass% --tmp-location EPSG:4326 --exec g.region res=0.1 -p diff --git a/.github/workflows/test_thorough.bat b/.github/workflows/test_thorough.bat index fc45e924aae..5fe0567db1a 100644 --- a/.github/workflows/test_thorough.bat +++ b/.github/workflows/test_thorough.bat @@ -1,3 +1,6 @@ -call %1\grass79 --tmp-location XY --exec g.extension g.download.location -call %1\grass79 --tmp-location XY --exec g.download.location url=http://fatra.cnr.ncsu.edu/data/nc_spm_full_v2alpha2.tar.gz dbase=%USERPROFILE% -call %1\grass79 --tmp-location XY --exec python3 -m grass.gunittest.main --grassdata %USERPROFILE% --location nc_spm_full_v2alpha2 --location-type nc --min-success 80 +set grass=%1\grass79 +set python=C:\OSGeo4W64\bin\python3 + +call %grass% --tmp-location XY --exec g.extension g.download.location +call %grass% --tmp-location XY --exec g.download.location url=http://fatra.cnr.ncsu.edu/data/nc_spm_full_v2alpha2.tar.gz dbase=%USERPROFILE% +call %grass% --tmp-location XY --exec %python% -m grass.gunittest.main --grassdata %USERPROFILE% --location nc_spm_full_v2alpha2 --location-type nc --min-success 80 From b13a7e858bb9291da9a90b7960725e8e169d1dfe Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Sat, 6 Jun 2020 10:02:24 -0400 Subject: [PATCH 57/64] MSYS2 path first for DLL dependencies --- .github/workflows/build_osgeo4w.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_osgeo4w.sh b/.github/workflows/build_osgeo4w.sh index 9f11dd25832..7f4ecc04048 100755 --- a/.github/workflows/build_osgeo4w.sh +++ b/.github/workflows/build_osgeo4w.sh @@ -68,7 +68,7 @@ sed 's/^\(set GISBASE=\).*/\1'$dist_win_esc'/' \ mswindows/osgeo4w/env.bat.tmpl cat< Date: Sat, 6 Jun 2020 10:03:58 -0400 Subject: [PATCH 58/64] 50% success rate --- .github/workflows/test_thorough.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_thorough.bat b/.github/workflows/test_thorough.bat index 5fe0567db1a..9d13a1a81f1 100644 --- a/.github/workflows/test_thorough.bat +++ b/.github/workflows/test_thorough.bat @@ -3,4 +3,4 @@ set python=C:\OSGeo4W64\bin\python3 call %grass% --tmp-location XY --exec g.extension g.download.location call %grass% --tmp-location XY --exec g.download.location url=http://fatra.cnr.ncsu.edu/data/nc_spm_full_v2alpha2.tar.gz dbase=%USERPROFILE% -call %grass% --tmp-location XY --exec %python% -m grass.gunittest.main --grassdata %USERPROFILE% --location nc_spm_full_v2alpha2 --location-type nc --min-success 80 +call %grass% --tmp-location XY --exec %python% -m grass.gunittest.main --grassdata %USERPROFILE% --location nc_spm_full_v2alpha2 --location-type nc --min-success 50 From d8dd14a2e661073786b34a2c0a64f538243f475c Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Sat, 6 Jun 2020 12:51:41 -0400 Subject: [PATCH 59/64] Unit test encoding should be independent of the system encoding --- lib/python/gunittest/case.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/python/gunittest/case.py b/lib/python/gunittest/case.py index 97521af78bd..832f634bdd2 100644 --- a/lib/python/gunittest/case.py +++ b/lib/python/gunittest/case.py @@ -19,7 +19,7 @@ from grass.pygrass.modules import Module from grass.exceptions import CalledModuleError -from grass.script import shutil_which, text_to_string, encode +from grass.script import shutil_which, text_to_string, encode, decode from .gmodules import call_module, SimpleModule from .checkers import (check_text_ellipsis, @@ -184,6 +184,9 @@ def assertLooksLike(self, actual, reference, msg=None): See :func:`check_text_ellipsis` for details of behavior. """ + # actual is in the system codec while the passed reference is in utf-8; + # re-decode reference into the system codec for proper comparison + reference = decode(encode(reference, 'utf-8')) self.assertTrue(isinstance(actual, (str, unicode)), ( 'actual argument is not a string')) self.assertTrue(isinstance(reference, (str, unicode)), ( From 48e82a67712d035e01b51a06fe34cb255ae649d6 Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Sun, 7 Jun 2020 09:27:09 -0400 Subject: [PATCH 60/64] Just test packaged binaries only --- .github/workflows/osgeo4w.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/osgeo4w.yml b/.github/workflows/osgeo4w.yml index d35aeb9bdbb..5a144f6b973 100644 --- a/.github/workflows/osgeo4w.yml +++ b/.github/workflows/osgeo4w.yml @@ -32,10 +32,6 @@ jobs: - name: Compile GRASS GIS run: C:\msys64\usr\bin\bash.exe -l (''+(Get-Location)+'\.github\workflows\build_osgeo4w.sh') -p (Get-Location) - name: Test executing of the grass command - run: .github/workflows/test_simple.bat 'bin.x86_64-w64-mingw32' - - name: Run tests - run: .github/workflows/test_thorough.bat 'bin.x86_64-w64-mingw32' - - name: Test executing of the grass command using the package run: .github/workflows/test_simple.bat 'C:\OSGeo4W64\opt\grass' - - name: Run tests using the package + - name: Run tests run: .github/workflows/test_thorough.bat 'C:\OSGeo4W64\opt\grass' From 517c8089ded7daba604628dfe1764ffd11dd0a8f Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Sun, 7 Jun 2020 17:37:22 -0400 Subject: [PATCH 61/64] Use a non-interactive monitor for unit testing --- scripts/r.blend/testsuite/test_r_blend.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/r.blend/testsuite/test_r_blend.py b/scripts/r.blend/testsuite/test_r_blend.py index d531a5c66cc..d3ef8154ada 100644 --- a/scripts/r.blend/testsuite/test_r_blend.py +++ b/scripts/r.blend/testsuite/test_r_blend.py @@ -24,7 +24,7 @@ def setUpClass(cls): """Create maps in a small region.""" cls.use_temp_region() cls.runModule('g.region', raster=cls.map1, flags='p') - run_command('d.mon', start='wx0') + run_command('d.mon', start='png') @classmethod def tearDownClass(cls): @@ -32,7 +32,7 @@ def tearDownClass(cls): cls.runModule('g.remove', flags='f', type='raster', name=(cls.temp1, cls.temp2, cls.temp3)) cls.del_temp_region() - run_command('d.mon', stop='wx0') + run_command('d.mon', stop='png') def test_blend(self): """blends color test""" From 6af11b38c4c1493d1272bcf75356943ad300f8a1 Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Sun, 7 Jun 2020 23:26:46 -0400 Subject: [PATCH 62/64] Success rate for test_thorough.bat 60% --- .github/workflows/test_thorough.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_thorough.bat b/.github/workflows/test_thorough.bat index 9d13a1a81f1..3399960ebf5 100644 --- a/.github/workflows/test_thorough.bat +++ b/.github/workflows/test_thorough.bat @@ -3,4 +3,4 @@ set python=C:\OSGeo4W64\bin\python3 call %grass% --tmp-location XY --exec g.extension g.download.location call %grass% --tmp-location XY --exec g.download.location url=http://fatra.cnr.ncsu.edu/data/nc_spm_full_v2alpha2.tar.gz dbase=%USERPROFILE% -call %grass% --tmp-location XY --exec %python% -m grass.gunittest.main --grassdata %USERPROFILE% --location nc_spm_full_v2alpha2 --location-type nc --min-success 50 +call %grass% --tmp-location XY --exec %python% -m grass.gunittest.main --grassdata %USERPROFILE% --location nc_spm_full_v2alpha2 --location-type nc --min-success 60 From 3a9983c1786db392882fa56b7daa4ced3eb545a1 Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Tue, 9 Jun 2020 09:12:53 -0400 Subject: [PATCH 63/64] Address review comments --- .github/workflows/osgeo4w.yml | 6 +++--- .github/workflows/test_simple.bat | 2 +- .github/workflows/test_thorough.bat | 2 +- lib/python/gunittest/reporters.py | 10 +++++++--- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/osgeo4w.yml b/.github/workflows/osgeo4w.yml index 5a144f6b973..bdfc5f3cd4b 100644 --- a/.github/workflows/osgeo4w.yml +++ b/.github/workflows/osgeo4w.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: os: - - windows-latest + - windows-2019 fail-fast: false steps: @@ -32,6 +32,6 @@ jobs: - name: Compile GRASS GIS run: C:\msys64\usr\bin\bash.exe -l (''+(Get-Location)+'\.github\workflows\build_osgeo4w.sh') -p (Get-Location) - name: Test executing of the grass command - run: .github/workflows/test_simple.bat 'C:\OSGeo4W64\opt\grass' + run: .github/workflows/test_simple.bat 'C:\OSGeo4W64\opt\grass\grass79.bat' - name: Run tests - run: .github/workflows/test_thorough.bat 'C:\OSGeo4W64\opt\grass' + run: .github/workflows/test_thorough.bat 'C:\OSGeo4W64\opt\grass\grass79.bat' diff --git a/.github/workflows/test_simple.bat b/.github/workflows/test_simple.bat index 911ccc70915..952c91f60bf 100644 --- a/.github/workflows/test_simple.bat +++ b/.github/workflows/test_simple.bat @@ -1,3 +1,3 @@ -set grass=%1\grass79 +set grass=%1 call %grass% --tmp-location EPSG:4326 --exec g.region res=0.1 -p diff --git a/.github/workflows/test_thorough.bat b/.github/workflows/test_thorough.bat index 3399960ebf5..afd6dd3a035 100644 --- a/.github/workflows/test_thorough.bat +++ b/.github/workflows/test_thorough.bat @@ -1,4 +1,4 @@ -set grass=%1\grass79 +set grass=%1 set python=C:\OSGeo4W64\bin\python3 call %grass% --tmp-location XY --exec g.extension g.download.location diff --git a/lib/python/gunittest/reporters.py b/lib/python/gunittest/reporters.py index a1e305b8df8..9dba209d220 100644 --- a/lib/python/gunittest/reporters.py +++ b/lib/python/gunittest/reporters.py @@ -95,13 +95,17 @@ def anonymize(self, filenames): # besides GISBASE and test recursion start directory (which is # supposed to be source root directory or similar) we can also try # to remove user home directory and GISDBASE - # we suppuse that we run in standard grass session + # we suppose that we run in standard grass session # TODO: provide more effective implementation + + # regex for a trailing separator path_end = r'[\\/]?' for path in self._paths_to_remove: for filename in filenames: - replace_in_file(filename, - path.replace('\\', r'\\') + path_end, '') + # literal special characters (e.g., ^\()[]{}.*+-$) in path need + # to be escaped in a regex (2nd argument); otherwise, they will + # be interpreted as special characters + replace_in_file(filename, re.escape(path) + path_end, '') def get_source_url(path, revision, line=None): From 16450be1b973cb9724f3565fcbea611cf2f489b9 Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Sun, 21 Jun 2020 18:32:06 -0400 Subject: [PATCH 64/64] Rename (src|dist)_win_esc to (src|dist)_esc --- .github/workflows/build_osgeo4w.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_osgeo4w.sh b/.github/workflows/build_osgeo4w.sh index 7f4ecc04048..74e4c6a3009 100755 --- a/.github/workflows/build_osgeo4w.sh +++ b/.github/workflows/build_osgeo4w.sh @@ -60,11 +60,11 @@ rm -f $dist/grass$ver.tmp $dist/etc/fontcap # create batch files -src_win_esc=`echo $src | sed 's#^/\([a-z]\)#\1:#; s#/#\\\\\\\\#g'` -dist_win_esc="$src_win_esc\\\\$dist" +src_esc=`echo $src | sed 's#^/\([a-z]\)#\1:#; s#/#\\\\\\\\#g'` +dist_esc="$src_esc\\\\$dist" ( -sed 's/^\(set GISBASE=\).*/\1'$dist_win_esc'/' \ +sed 's/^\(set GISBASE=\).*/\1'$dist_esc'/' \ mswindows/osgeo4w/env.bat.tmpl cat<