From 7401e795a6a0eee82b86f4d78026f4635790c43f Mon Sep 17 00:00:00 2001 From: "Juergen E. Fischer" Date: Sun, 17 May 2020 13:16:31 +0200 Subject: [PATCH] Windows CI: * build with VS2019 * add support for github actions * also produce packages as artifacts * move test blacklist to .ci/windows-blacklist.txt (added qgis_layoutmanualtabletest and PyQgsVirtualLayerDefinition) * separate step to output dash link * include action badge * drop unused caching (and clcache) * update INSTALL --- .ci/azure-pipelines/azure-pipelines.yml | 131 +++++------------ .ci/windows-blacklist.txt | 143 +++++++++++++++++++ .github/workflows/msvc.yml | 179 ++++++++++++++++++++++++ INSTALL | 17 +-- README.md | 1 + doc/INSTALL.html | 23 ++- doc/msvc.t2t | 11 +- ms-windows/osgeo4w/configonly.bat | 6 +- ms-windows/osgeo4w/msvc-env.bat | 43 +++--- ms-windows/osgeo4w/package-nightly.cmd | 13 +- ms-windows/osgeo4w/package.cmd | 15 +- 11 files changed, 421 insertions(+), 161 deletions(-) create mode 100644 .ci/windows-blacklist.txt create mode 100644 .github/workflows/msvc.yml diff --git a/.ci/azure-pipelines/azure-pipelines.yml b/.ci/azure-pipelines/azure-pipelines.yml index 6aff8209cbed..9bf3c6f78152 100644 --- a/.ci/azure-pipelines/azure-pipelines.yml +++ b/.ci/azure-pipelines/azure-pipelines.yml @@ -1,7 +1,6 @@ variables: LR: release-3_12 LTR: release-3_10 - CTEST_CUSTOM_TESTS_IGNORE: "ProcessingGdalAlgorithmsRasterTest;ProcessingGdalAlgorithmsVectorTest;ProcessingGrass7AlgorithmsImageryTest;ProcessingGrass7AlgorithmsRasterTest;ProcessingGrass7AlgorithmsVectorTest;ProcessingGuiTest;ProcessingOtbAlgorithmsTest;ProcessingQgisAlgorithmsTestPt1;ProcessingQgisAlgorithmsTestPt2;ProcessingQgisAlgorithmsTestPt3;ProcessingQgisAlgorithmsTestPt4;ProcessingScriptUtilsTest;PyQgsAnnotation;PyQgsAppStartup;PyQgsAuthManagerOAuth2OWSTest;PyQgsAuthManagerPasswordOWSTest;PyQgsAuthManagerPKIOWSTest;PyQgsAuthManagerProxy;PyQgsAuthSettingsWidget;PyQgsAuxiliaryStorage;PyQgsBlockingNetworkRequest;PyQgsExifTools;PyQgsFileDownloader;PyQgsFileUtils;PyQgsGeometryTest;PyQgsImageCache;PyQgsImportIntoPostGIS;PyQgsLayoutAtlas;PyQgsLayoutLegend;PyQgsLayoutMap;PyQgsLayoutMapGrid;PyQgsMapLayer;PyQgsOfflineEditingWFS;PyQgsOGRProvider;PyQgsOGRProviderGpkg;PyQgsOGRProviderSqlite;PyQgsPalLabelingCanvas;PyQgsPalLabelingLayout;PyQgsPalLabelingPlacement;PyQgsPointDisplacementRenderer;PyQgsProject;PyQgsProviderConnectionGpkg;PyQgsProviderConnectionPostgres;PyQgsPythonProvider;PyQgsRasterFileWriter;PyQgsRasterLayer;PyQgsSelectiveMasking;PyQgsServerAccessControlWMSGetlegendgraphic;PyQgsServerApi;PyQgsServerCacheManager;PyQgsServerLocaleOverride;PyQgsServerSecurity;PyQgsServerSettings;PyQgsServerWMS;PyQgsServerWMSDimension;PyQgsServerWMSGetFeatureInfo;PyQgsServerWMSGetLegendGraphic;PyQgsServerWMSGetMap;PyQgsServerWMSGetPrint;PyQgsServerWMTS;PyQgsSettings;PyQgsShapefileProvider;PyQgsSpatialiteProvider;PyQgsSvgCache;PyQgsSymbolLayer;PyQgsTaskManager;PyQgsTextRenderer;PyQgsVectorFileWriter;PyQgsVectorLayer;PyQgsVectorLayerUtils;PyQgsVirtualLayerProvider;PyQgsWFSProviderGUI;PyQgsZipUtils;qgis_3drenderingtest;qgis_alignrastertest;qgis_arcgisrestutilstest;qgis_banned_keywords;qgis_browsermodeltest;qgis_callouttest;qgis_compositionconvertertest;qgis_coordinatereferencesystemtest;qgis_datadefinedsizelegendtest;qgis_datumtransformdialog;qgis_diagramtest;qgis_doxygen_order;qgis_dxfexporttest;qgis_expressiontest;qgis_filedownloader;qgis_geometrycheckstest;qgis_geometrytest;qgis_geonodeconnectiontest;qgis_grassprovidertest7;qgis_imagecachetest;qgis_invertedpolygonrenderertest;qgis_labelingenginetest;qgis_layerdefinitiontest;qgis_layout3dmaptest;qgis_layouthtmltest;qgis_layoutlabeltest;qgis_layoutmapgridtest;qgis_layoutmaptest;qgis_layoutpicturetest;qgis_layoutscalebartest;qgis_layouttabletest;qgis_legendrenderertest;qgis_licenses;qgis_defwindowtitle;qgis_maprendererjobtest;qgis_maprotationtest;qgis_mapsettingsutilstest;qgis_maptooladdfeatureline;qgis_mimedatautilstest;qgis_networkaccessmanagertest;qgis_openclutilstest;qgis_painteffecttest;qgis_pallabelingtest;qgis_processingtest;qgis_projecttest;qgis_qgisappclipboard;qgis_rasterlayersaveasdialog;qgis_shellcheck;qgis_sipify;qgis_sip_include;qgis_sip_uptodate;qgis_spelling;qgis_styletest;qgis_svgcachetest;qgis_taskmanagertest;qgis_transformdialog;qgis_vectorfilewritertest;qgis_wcsprovidertest;qgis_ziplayertest;qgis_meshcalculator;qgis_pointlocatortest;PyQgsExpressionBuilderWidget;PyQgsDatumTransform;qgis_vertextool;PyQgsCoordinateOperationWidget;PyQgsProviderConnectionSpatialite;qgis_maptoolsplitpartstest;qgis_vectortilelayertest" Agent.Source.Git.ShallowFetchDepth: 120 trigger: @@ -20,26 +19,19 @@ pr: jobs: - job: OSGeo4W pool: - vmImage: vs2017-win2016 + vmImage: windows-latest timeoutInMinutes: 360 + strategy: maxParallel: 4 matrix: x86: - OSGEO4W_ROOT: C:\OSGeo4W OSGEO4W_ARCH: x86 - CLCACHE_DIR: c:\clcache-x86 - PLATFORM: x86 - CC: C:\OSGeo4W\bin\clcache.bat - CXX: C:\OSGeo4W\bin\clcache.bat + OSGEO4W_ROOT: C:\OSGeo4W x86_64: - OSGEO4W_ROOT: C:\OSGeo4W64 OSGEO4W_ARCH: x86_64 - CLCACHE_DIR: c:\clcache-x86_64 - PLATFORM: x64 - CC: C:\OSGeo4W64\bin\clcache.bat - CXX: C:\OSGeo4W64\bin\clcache.bat + OSGEO4W_ROOT: C:\OSGeo4W64 steps: - bash: | @@ -51,7 +43,7 @@ jobs: fi echo "BRANCH: ${branch}" - echo "PR: ${pr}" + [ -n "$pr" ] && echo "PR: ${pr}" echo "LR: ${LR}" echo "LTR: ${LTR}" @@ -74,16 +66,21 @@ jobs: major=$(sed -ne 's/^SET(CPACK_PACKAGE_VERSION_MAJOR "\([0-9]*\)")\s*$/\1/p' CMakeLists.txt) minor=$(sed -ne 's/^SET(CPACK_PACKAGE_VERSION_MINOR "\([0-9]*\)")\s*$/\1/p' CMakeLists.txt) patch=$(sed -ne 's/^SET(CPACK_PACKAGE_VERSION_PATCH "\([0-9]*\)")\s*$/\1/p' CMakeLists.txt) - binary=$(curl --location-trusted http://ftp.osuosl.org/pub/osgeo/download/osgeo4w/$OSGEO4W_ARCH/release/qgis/$OSGEO4W_PKG/LATEST.sha | sed -e "s/:.*$//") - (( binary++ )) || true - version=$major.$minor.$patch sha="${BUILD_SOURCEVERSION:0:10}" - if [ "$BUILD_REASON" = "PullRequest" ]; then - buildname="PR $pr / $branch ($BUILD_BUILDID) ($sha) ($OSGEO4W_PKG $target $OSGEO4W_ARCH)" # no colons allowed here + if [ -z "$pr" ]; then + binary=$(curl --location-trusted http://download.osgeo.org/osgeo4w/$OSGEO4W_ARCH/release/qgis/$OSGEO4W_PKG/LATEST.sha | sed -e "s/:.*$//") + (( binary++ )) || true + buildname="$OSGEO4W_PKG-$version-$sha-$target-VC16-$OSGEO4W_ARCH" else - buildname="$OSGEO4W_PKG-$version-$sha-$target-VC14-$OSGEO4W_ARCH" + OSGEO4W_PKG="${OSGEO4W_PKG}-${pr}" + buildname="PR $pr / $branch ($BUILD_BUILDID) ($sha) ($OSGEO4W_PKG $target $OSGEO4W_ARCH)" # no colons allowed here + binary=${BUILD_BUILDID} + fi + + if [ "${BUILD_REPOSITORY_URI#https://github.com/}" != "qgis/QGIS" ]; then + buildname="${BUILD_REPOSITORY_URI#https://github.com/}: $buildname" fi url=$buildname @@ -91,6 +88,7 @@ jobs: url=${url//)/%29} url=${url// /+} url="https://cdash.orfeo-toolbox.org/index.php?project=QGIS&filtercombine=and&filtercombine=and&filtercombine=and&filtercombine=and&filtercombine=and&filtercombine=and&filtercombine=and&filtercombine=and&filtercombine=and&filtercombine=and&filtercombine=and&filtercombine=and&filtercombine=and&filtercombine=and&filtercombine=and&filtercombine=and&filtercount=4&showfilters=0&filtercombine=and&field1=buildname&compare1=61&value1=$url&field2=site&compare2=65&value2=azure-pipelines&field3=buildstarttime&compare3=83&value3=$(date +%Y-%m-%d --date=yesterday)&field4=buildstarttime&compare4=84&value4=$(date +%Y-%m-%d --date=tomorrow)" + url=$(curl --data-urlencode "url=$url" -s http://tinyurl.com/api-create.php) echo "##vso[task.setvariable variable=TARGET]$target" echo "##vso[task.setvariable variable=OSGEO4W_PKG]$OSGEO4W_PKG" @@ -101,7 +99,8 @@ jobs: echo "##vso[task.setvariable variable=BINARY]$binary" echo "##vso[task.setvariable variable=VERSION]$version" echo "##vso[task.setvariable variable=BUILDNAME]$buildname" - echo "##vso[task.setvariable variable=DASHURL]${url//&/^&}" + echo "##vso[task.setvariable variable=DASHURL]$url" + echo "##vso[task.setvariable variable=CTEST_CUSTOM_TESTS_IGNORE]$(sed -r '/^(#.*?)?$/d' .ci/windows-blacklist.txt | paste -sd ';' -)" displayName: 'Setup build variables' @@ -111,95 +110,41 @@ jobs: - script: curl --output c:\osgeo4w-setup.exe http://ftp.osuosl.org/pub/osgeo/download/osgeo4w/osgeo4w-setup-%OSGEO4W_ARCH%.exe displayName: 'Download OSGeo4W Installer' - - script: curl --location-trusted --output c:\ninja.zip https://github.com/ninja-build/ninja/releases/download/v1.9.0/ninja-win.zip + - script: curl --location-trusted --output c:\ninja.zip https://github.com/ninja-build/ninja/releases/download/v1.10.0/ninja-win.zip displayName: 'Download Ninja' -# - script: curl --location-trusted --output c:\depends.zip http://www.dependencywalker.com/depends22_%PLATFORM%.zip -# displayName: 'Download Dependency walker' - -# Too large… -# - task: Cache@2 -# inputs: -# key: 'cygwin | $(Date:yyyyMMdd)' -# path: 'c:\cygwin' -# restoreKeys: | -# cygwin | $(Date:yyyyMM) -# cygwin | $(Date:yyyy) -# cygwin -# displayName: Cache cygwin - - powershell: ms-windows/osgeo4w/runasadmin.ps1 c:\setup-x86.exe -qnNdO -R C:/cygwin -s http://cygwin.mirror.constant.com -l C:/temp/cygwin -P "bison,flex,git,poppler,doxygen,unzip" displayName: 'Installing cygwin' -# Too large… -# - task: Cache@2 -# inputs: -# key: 'osgeo4w | $(OSGEO4W_ARCH) | $(Date:yyyyMMdd)' -# path: '$(OSGEO4W_ROOT)' -# restoreKeys: | -# osgeo4w | $(OSGEO4W_ARCH) | $(Date:yyyyMMdd) -# osgeo4w | $(OSGEO4W_ARCH) | $(Date:yyyyMM) -# osgeo4w | $(OSGEO4W_ARCH) | $(Date:yyyy) -# osgeo4w | $(OSGEO4W_ARCH) -# displayName: Cache OSGeo4W - - - powershell: ms-windows/osgeo4w/runasadmin.ps1 c:\osgeo4w-setup.exe --autoaccept --advanced --arch $env:OSGEO4W_ARCH --quiet-mode --upgrade-also --root $env:OSGEO4W_ROOT --only-site -s http://ftp.osuosl.org/pub/osgeo/download/osgeo4w -l c:\temp\osgeo4w -P $env:OSGEO4W_DEPS -P python3-clcache + - powershell: ms-windows/osgeo4w/runasadmin.ps1 c:\osgeo4w-setup.exe --autoaccept --advanced --arch $env:OSGEO4W_ARCH --quiet-mode --upgrade-also --root $env:OSGEO4W_ROOT --only-site -s http://ftp.osuosl.org/pub/osgeo/download/osgeo4w -l c:\temp\osgeo4w -P $env:OSGEO4W_DEPS displayName: 'Installing OSGeo4W' + - script: c:\cygwin\bin\unzip -o c:\ninja.zip -d %OSGEO4W_ROOT%\bin + displayName: 'Extracting Ninja' + - script: | rmdir /s /q c:\temp\cygwin rmdir /s /q c:\temp\osgeo4w displayName: 'Clear package caches' - - script: c:\cygwin\bin\unzip -o c:\ninja.zip -d %OSGEO4W_ROOT%\bin - displayName: 'Extracting Ninja' - -# - script: c:\cygwin\bin\unzip -o c:\depends.zip -d %OSGEO4W_ROOT%\bin -# displayName: 'Extracting Dependency Walker' - - - script: | - PATH %OSGEO4W_ROOT%\bin;%ProgramFiles%\CMake\bin;%PATH% - cmake --version - ctest --version - ninja --version - displayName: 'Display tool versions' - -# Too large… -# - task: Cache@2 -# inputs: -# key: 'clcache | $(OSGEO4W_ARCH) | $(OSGEO4W_PKG) | $(Date:yyyyMMdd) | $(Hours)' -# path: '$(CLCACHE_DIR)' -# restoreKeys: | -# clcache | $(OSGEO4W_ARCH) | $(OSGEO4W_PKG) | $(Date:yyyyMMdd) | $(Hours) -# clcache | $(OSGEO4W_ARCH) | $(OSGEO4W_PKG) | $(Date:yyyyMMdd) -# clcache | $(OSGEO4W_ARCH) | $(OSGEO4W_PKG) | $(Date:yyyyMM) -# clcache | $(OSGEO4W_ARCH) | $(OSGEO4W_PKG) | $(Date:yyyy) -# clcache | $(OSGEO4W_ARCH) | $(OSGEO4W_PKG) -# displayName: Cache clcache + - bash: | + echo "##[section]$BUILDNAME results available at $DASHURL" + displayName: 'Link to test results' - script: | echo on PATH c:\cygwin\bin;%OSGEO4W_ROOT%\bin;%PATH% cd ms-windows\osgeo4w - touch skippackage set OSGEO4W_CXXFLAGS=/MD /MP /Od /D NDEBUG - @echo ##[section]%OSGEO4W_ARCH% results available at %DASHURL% package-nightly.cmd %VERSION% %BINARY% %OSGEO4W_PKG% %OSGEO4W_ARCH% %BUILD_SOURCEVERSION:~0,10% azure-pipelines + if not errorlevel 1 if exist testfailure exit /b 1 displayName: 'Building QGIS' -# - script: | -# echo on -# PATH %OSGEO4W_ROOT%\bin;%PATH% -# cd ms-windows\osgeo4w\build-%OSGEO4W_PKG%-%OSGEO4W_ARCH% -# set /P tag=/dev/null) + ;; + esac + + echo "BRANCH: ${branch}" + [ -n "$pr" ] && echo "PR: ${pr}" + echo "LR: ${LR}" + echo "LTR: ${LTR}" + + case "${branch}" in + "${LTR}") + OSGEO4W_PKG=qgis-ltr-dev + OSGEO4W_DEPS=qgis-ltr-dev-deps + ;; + "${LR}") + OSGEO4W_PKG=qgis-rel-dev + OSGEO4W_DEPS=qgis-rel-dev-deps + ;; + *) + OSGEO4W_PKG=qgis-dev + OSGEO4W_DEPS=qgis-dev-deps + ;; + esac + + target=Experimental + major=$(sed -ne 's/^SET(CPACK_PACKAGE_VERSION_MAJOR "\([0-9]*\)")\s*$/\1/p' CMakeLists.txt) + minor=$(sed -ne 's/^SET(CPACK_PACKAGE_VERSION_MINOR "\([0-9]*\)")\s*$/\1/p' CMakeLists.txt) + patch=$(sed -ne 's/^SET(CPACK_PACKAGE_VERSION_PATCH "\([0-9]*\)")\s*$/\1/p' CMakeLists.txt) + version=$major.$minor.$patch + sha="${GITHUB_SHA:0:10}" + + if [ -z "$pr" ]; then + binary=$(curl -s --location-trusted http://download.osgeo.org/osgeo4w/$OSGEO4W_ARCH/release/qgis/$OSGEO4W_PKG/LATEST.sha | sed -e "s/:.*$//") + (( binary++ )) || true + buildname="$OSGEO4W_PKG-$version-$sha-$target-VC16-$OSGEO4W_ARCH" + else + OSGEO4W_PKG="${OSGEO4W_PKG}-${pr}" + buildname="PR $pr / $branch ($GITHUB_JOB) ($sha) ($OSGEO4W_PKG $target $OSGEO4W_ARCH)" # no colons allowed here + binary=${GITHUB_RUN_NUMBER} + fi + + if [ "$GITHUB_REPOSITORY" != "qgis/QGIS" ]; then + buildname="${GITHUB_REPOSITORY}: $buildname" + fi + + url=$buildname + url=${url//(/%28} + url=${url//)/%29} + url=${url// /+} + url="https://cdash.orfeo-toolbox.org/index.php?project=QGIS&filtercombine=and&filtercombine=and&filtercombine=and&filtercombine=and&filtercombine=and&filtercombine=and&filtercombine=and&filtercombine=and&filtercombine=and&filtercombine=and&filtercombine=and&filtercombine=and&filtercombine=and&filtercombine=and&filtercombine=and&filtercombine=and&filtercount=4&showfilters=0&filtercombine=and&field1=buildname&compare1=61&value1=$url&field2=site&compare2=65&value2=azure-pipelines&field3=buildstarttime&compare3=83&value3=$(date +%Y-%m-%d --date=yesterday)&field4=buildstarttime&compare4=84&value4=$(date +%Y-%m-%d --date=tomorrow)" + url=$(curl -s --data-urlencode "url=$url" -s http://tinyurl.com/api-create.php) + + echo "::set-env name=TARGET::$target" + echo "::set-env name=OSGEO4W_PKG::$OSGEO4W_PKG" + echo "::set-env name=OSGEO4W_DEPS::$OSGEO4W_DEPS" + echo "::set-env name=MAJOR::$major" + echo "::set-env name=MINOR::$minor" + echo "::set-env name=PATCH::$patch" + echo "::set-env name=BINARY::$binary" + echo "::set-env name=VERSION::$version" + echo "::set-env name=BUILDNAME::$buildname" + echo "::set-env name=DASHURL::$url" + echo "::set-env name=CTEST_CUSTOM_TESTS_IGNORE::$(sed -r '/^(#.*?)?$/d' .ci/windows-blacklist.txt | paste -sd ';' -)" + + # WDF kills MSVC batch's own detection of SDKs… + - name: Clean WDF + shell: cmd + run: | + rmdir /s /q "%ProgramFiles(x86)%\Windows Kits\10\lib\wdf" + rmdir /s /q "%ProgramFiles(x86)%\Windows Kits\10\include\wdf" + rmdir /s /q "%ProgramFiles(x86)%\Windows Kits\10\redist\wdf" + rmdir /s /q "%ProgramFiles(x86)%\Windows Kits\10\Tools" + + - name: 'Download OSGeo4W Installer' + shell: cmd + run: curl --output c:\osgeo4w-setup.exe http://ftp.osuosl.org/pub/osgeo/download/osgeo4w/osgeo4w-setup-%OSGEO4W_ARCH%.exe + + - name: 'Installing OSGeo4W' + shell: cmd + run: | + cd %GITHUB_WORKSPACE% + powershell .\ms-windows\osgeo4w\runasadmin.ps1 c:\osgeo4w-setup.exe --autoaccept --advanced --arch $env:OSGEO4W_ARCH --quiet-mode --upgrade-also --root $env:OSGEO4W_ROOT --only-site -s http://ftp.osuosl.org/pub/osgeo/download/osgeo4w -l c:\temp\osgeo4w -P $env:OSGEO4W_DEPS + + - name: 'Download cygwin Installer' + shell: cmd + run: curl --output c:\setup-x86.exe https://cygwin.com/setup-x86.exe + + - name: 'Installing cygwin' + shell: cmd + run: c:\setup-x86.exe -qnNdO -R C:/cygwin -s http://cygwin.mirror.constant.com -l C:/temp/cygwin -P "bison,flex,poppler,doxygen,git,unzip" + + - name: 'Download Ninja' + shell: cmd + run: curl --location-trusted --output c:\ninja.zip https://github.com/ninja-build/ninja/releases/download/v1.10.0/ninja-win.zip + + - name: 'Extracting Ninja' + shell: cmd + run: c:\cygwin\bin\unzip -o c:\ninja.zip -d %OSGEO4W_ROOT%\bin + + - name: 'Clear package caches' + shell: cmd + run: | + rmdir /s /q c:\temp\cygwin + rmdir /s /q c:\temp\osgeo4w + + - name: 'Link to test results' + shell: bash + run: | + echo "$BUILDNAME results available at $DASHURL" + + - name: 'Building QGIS' + shell: cmd + run: | + echo on + cd %GITHUB_WORKSPACE% + PATH c:\cygwin\bin;%OSGEO4W_ROOT%\bin;%PATH% + cd ms-windows\osgeo4w + set OSGEO4W_CXXFLAGS=/MD /MP /Od /D NDEBUG + call package-nightly.cmd %VERSION% %BINARY% %OSGEO4W_PKG% %OSGEO4W_ARCH% %GITHUB_SHA:~0,10% gh-action-msvc + if not errorlevel 1 if exist testfailure exit /b 1 + + - name: 'Upload package' + uses: actions/upload-artifact@v1 + with: + name: ${{ env.OSGEO4W_ARCH }}-${{ env.OSGEO4W_PKG }}-${{ env.VERSION }}-${{ env.BINARY }} + path: ${{ github.workspace }}/ms-windows/osgeo4w/${{ env.OSGEO4W_ARCH }} + +# vim: set nowrap : diff --git a/INSTALL b/INSTALL index 0e31d730cb45..fca872a7b39a 100644 --- a/INSTALL +++ b/INSTALL @@ -1,6 +1,6 @@ QGIS Building QGIS from source - step by step -2020-05-08 +2020-05-17 ------------------------------------------------------------------------ @@ -46,8 +46,8 @@ Building QGIS from source - step by step ------------------------------------------------------------------------ -Last Updated: 2020-05-08 -Last Change : 2020-05-08 +Last Updated: 2020-05-17 +Last Change : 2020-05-17 1. Introduction @@ -478,17 +478,14 @@ This section describes the setup required to allow Visual Studio to be used to build QGIS. - 4.1.1. Visual Studio 2015 Community Edition + 4.1.1. Visual Studio 2019 Community Edition =========================================== The free (as in free beer) Community installer is available under: - http://download.microsoft.com/download/D/2/3/D23F4D0F-BA2D-4600-8725-6CCECEA05196/vs_community_ENU.exe + https://download.visualstudio.microsoft.com/download/pr/68d6b204-9df0-4fcc-abcc-08ee0eff9cb2/b029547488a9383b0c8d8a9c813e246feb3ec19e0fe55020d4878fde5f0983fe/vs_Community.exe -Select "Custom" install and add the following packages: - -- "Common Tools for Visual C++ 2015" under "Visual C++" -- "Tools (1.4.1) and Windows 10 SDK (10.0.14393)" under "Universal Windows App Development Tools". +Select "Desktop Development with C++" 4.1.2. Other tools and dependencies @@ -500,7 +497,7 @@ Download and install following packages: | CMake | https://cmake.org/files/v3.12/cmake-3.12.3-win64-x64.msi | | GNU flex, GNU bison and GIT | http://cygwin.com/setup-x86.exe (32bit) or http://cygwin.com/setup-x86_64.exe (64bit) | | OSGeo4W | http://download.osgeo.org/osgeo4w/osgeo4w-setup-x86.exe (32bit) or http://download.osgeo.org/osgeo4w/osgeo4w-setup-x86_64.exe (64bit) | - | ninja | https://github.com/ninja-build/ninja/releases/download/v1.7.2/ninja-win.zip | + | ninja | https://github.com/ninja-build/ninja/releases/download/v1.10.0/ninja-win.zip | For the QGIS build you need to install following packages from cygwin: diff --git a/README.md b/README.md index e3055682c972..89032b6a3009 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ [![Build Status](https://travis-ci.org/qgis/QGIS.svg?branch=master)](https://travis-ci.org/qgis/QGIS) [![Docker Status](https://img.shields.io/docker/automated/qgis/qgis.svg)](https://cloud.docker.com/app/qgis/repository/docker/qgis/qgis/general) [![Build Status](https://dev.azure.com/qgis/QGIS/_apis/build/status/qgis.QGIS?branchName=master)](https://dev.azure.com/qgis/QGIS/_build/latest?definitionId=1&branchName=master) +[![Build status](https://github.com/qgis/QGIS/workflows/Windows%20build%20with%20Visual%20C++/badge.svg)[https://github.com/qgis/QGIS/actions?query=workflow%3A%22Windows+build+with+Visual+C%2B%2B%22] QGIS is an Open Source Geographic Information System. The project was born in May of 2002 and was established as a project on SourceForge in June of the same diff --git a/doc/INSTALL.html b/doc/INSTALL.html index ee770ec27a6b..45b8abbb6ddd 100644 --- a/doc/INSTALL.html +++ b/doc/INSTALL.html @@ -1,4 +1,4 @@ - + @@ -27,7 +27,7 @@

QGIS

Building QGIS from source - step by step

-

2020-05-08

+

2020-05-17

@@ -120,8 +120,8 @@

2020-05-08

-Last Updated: 2020-05-08 -Last Change : 2020-05-08 +Last Updated: 2020-05-17 +Last Change : 2020-05-17

@@ -780,25 +780,18 @@

4.1. Building with Microsoft Visual Studio

-

4.1.1. Visual Studio 2015 Community Edition

+

4.1.1. Visual Studio 2019 Community Edition

The free (as in free beer) Community installer is available under:

- http://download.microsoft.com/download/D/2/3/D23F4D0F-BA2D-4600-8725-6CCECEA05196/vs_community_ENU.exe + https://download.visualstudio.microsoft.com/download/pr/68d6b204-9df0-4fcc-abcc-08ee0eff9cb2/b029547488a9383b0c8d8a9c813e246feb3ec19e0fe55020d4878fde5f0983fe/vs_Community.exe

-Select "Custom" install and add the following packages: +Select "Desktop Development with C++"

-
    -
  • "Common Tools for Visual C++ 2015" under "Visual C++" -
  • -
  • "Tools (1.4.1) and Windows 10 SDK (10.0.14393)" under "Universal Windows App Development Tools". -
  • -
-

4.1.2. Other tools and dependencies

@@ -826,7 +819,7 @@

4.1.2. Other tools and dependencies

ninja -https://github.com/ninja-build/ninja/releases/download/v1.7.2/ninja-win.zip +https://github.com/ninja-build/ninja/releases/download/v1.10.0/ninja-win.zip diff --git a/doc/msvc.t2t b/doc/msvc.t2t index 7f831efd6d15..c74dbfa4c85e 100644 --- a/doc/msvc.t2t +++ b/doc/msvc.t2t @@ -7,16 +7,13 @@ This is currently also how the binary QGIS packages are made (earlier versions u This section describes the setup required to allow Visual Studio to be used to build QGIS. -===Visual Studio 2015 Community Edition=== +===Visual Studio 2019 Community Edition=== The free (as in free beer) Community installer is available under: - http://download.microsoft.com/download/D/2/3/D23F4D0F-BA2D-4600-8725-6CCECEA05196/vs_community_ENU.exe + https://download.visualstudio.microsoft.com/download/pr/68d6b204-9df0-4fcc-abcc-08ee0eff9cb2/b029547488a9383b0c8d8a9c813e246feb3ec19e0fe55020d4878fde5f0983fe/vs_Community.exe -Select "Custom" install and add the following packages: -- "Common Tools for Visual C++ 2015" under "Visual C++" -- "Tools (1.4.1) and Windows 10 SDK (10.0.14393)" under "Universal Windows App Development Tools". -- +Select "Desktop Development with C++" ===Other tools and dependencies=== @@ -26,7 +23,7 @@ Download and install following packages: | CMake | https://cmake.org/files/v3.12/cmake-3.12.3-win64-x64.msi | | GNU flex, GNU bison and GIT | http://cygwin.com/setup-x86.exe (32bit) or http://cygwin.com/setup-x86_64.exe (64bit) | | OSGeo4W | http://download.osgeo.org/osgeo4w/osgeo4w-setup-x86.exe (32bit) or http://download.osgeo.org/osgeo4w/osgeo4w-setup-x86_64.exe (64bit) | -| ninja | https://github.com/ninja-build/ninja/releases/download/v1.7.2/ninja-win.zip | +| ninja | https://github.com/ninja-build/ninja/releases/download/v1.10.0/ninja-win.zip | For the QGIS build you need to install following packages from cygwin: - bison diff --git a/ms-windows/osgeo4w/configonly.bat b/ms-windows/osgeo4w/configonly.bat index ee2aa6254187..b39ee570d4fe 100644 --- a/ms-windows/osgeo4w/configonly.bat +++ b/ms-windows/osgeo4w/configonly.bat @@ -15,13 +15,13 @@ REM * * REM *************************************************************************** set ARCH=%1 + if "%ARCH%"=="x86" ( - set CMAKEGEN=Visual Studio 14 2015 + set CMAKEGEN=-G "Visual Studio 16 2019" -A Win32 ) else ( - set CMAKEGEN=Visual Studio 14 2015 Win64 + set CMAKEGEN=-G "Visual Studio 16 2019" -A x64 set ARCH=x86_64 ) - set CONFIGONLY=1 setlocal enabledelayedexpansion diff --git a/ms-windows/osgeo4w/msvc-env.bat b/ms-windows/osgeo4w/msvc-env.bat index 0dae07f8be41..a00f372d56a5 100644 --- a/ms-windows/osgeo4w/msvc-env.bat +++ b/ms-windows/osgeo4w/msvc-env.bat @@ -18,7 +18,7 @@ if not "%PROGRAMFILES(X86)%"=="" set PF86=%PROGRAMFILES(X86)% if "%PF86%"=="" set PF86=%PROGRAMFILES% if "%PF86%"=="" (echo PROGRAMFILES not set & goto error) -if "%VCSDK%"=="" set VCSDK=10.0.14393.0 +if "%VCSDK%"=="" set VCSDK=10.0.18362.0 set ARCH=%1 if "%ARCH%"=="x86" goto x86 @@ -27,28 +27,37 @@ goto usage :x86 set VCARCH=x86 -set CMAKE_COMPILER_PATH=%PF86%\Microsoft Visual Studio 14.0\VC\bin -set DBGHLP_PATH=%PF86%\Microsoft Visual Studio 14.0\Common7\IDE\Remote Debugger\x86 set SETUPAPI_LIBRARY=%PF86%\Windows Kits\10\Lib\%VCSDK%\um\x86\SetupAPI.Lib +set DBGHLP_PATH=%PF86%\Windows Kits\10\Debuggers\x86 goto archset :x86_64 set VCARCH=amd64 -set CMAKE_COMPILER_PATH=%PF86%\Microsoft Visual Studio 14.0\VC\bin\amd64 -set DBGHLP_PATH=%PF86%\Microsoft Visual Studio 14.0\Common7\IDE\Remote Debugger\x64 set SETUPAPI_LIBRARY=%PF86%\Windows Kits\10\Lib\%VCSDK%\um\x64\SetupAPI.Lib +set DBGHLP_PATH=%PF86%\Windows Kits\10\Debuggers\x64 :archset -if not exist "%SETUPAPI_LIBRARY%" (echo SETUPAPI_LIBRARY not found & goto error) +if not exist "%SETUPAPI_LIBRARY%" ( + echo SETUPAPI_LIBRARY not found + dir /s /b "%PF86%\setupapi.lib" + goto error +) + +if not exist "%DBGHLP_PATH%\dbghelp.dll" ( + echo dbghelp.dll not found + dir /s /b "%PF86%\dbghelp.dll" "%PF86%\symsrv.dll" + goto error +) -if "%CC%"=="" set CC=%CMAKE_COMPILER_PATH:\=/%/cl.exe -if "%CXX%"=="" set CXX=%CMAKE_COMPILER_PATH:\=/%/cl.exe -set CLCACHE_CL=%CMAKE_COMPILER_PATH:\=/%/cl.exe +if "%CC%"=="" set CC=cl.exe +if "%CXX%"=="" set CXX=cl.exe -if "%OSGEO4W_ROOT%"=="" if "%ARCH%"=="x86" ( - set OSGEO4W_ROOT=C:\OSGeo4W -) else ( - set OSGEO4W_ROOT=C:\OSGeo4W64 +if "%OSGEO4W_ROOT%"=="" ( + if "%ARCH%"=="x86" ( + set OSGEO4W_ROOT=C:\OSGeo4W + ) else ( + set OSGEO4W_ROOT=C:\OSGeo4W64 + ) ) if not exist "%OSGEO4W_ROOT%\bin\o4w_env.bat" (echo o4w_env.bat not found & goto error) @@ -56,10 +65,12 @@ call "%OSGEO4W_ROOT%\bin\o4w_env.bat" call "%OSGEO4W_ROOT%\bin\py3_env.bat" call "%OSGEO4W_ROOT%\bin\qt5_env.bat" -set VS140COMNTOOLS=%PF86%\Microsoft Visual Studio 14.0\Common7\Tools\ -call "%PF86%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" %VCARCH% +for %%e in (Community Professional Enterprise) do if exist "%PF86%\Microsoft Visual Studio\2019\%%e" set vcdir=%PF86%\Microsoft Visual Studio\2019\%%e +if "%vcdir%"=="" (echo Visual C++ not found & goto error) -path %path%;%PF86%\Microsoft Visual Studio 14.0\VC\bin +set VS160COMNTOOLS=%vcdir%\Common7\Tools +call "%vcdir%\VC\Auxiliary\Build\vcvarsall.bat" %VCARCH% +path %path%;%vcdir%\VC\bin set GRASS7= if exist %OSGEO4W_ROOT%\bin\grass74.bat set GRASS7=%OSGEO4W_ROOT%\bin\grass74.bat diff --git a/ms-windows/osgeo4w/package-nightly.cmd b/ms-windows/osgeo4w/package-nightly.cmd index 6cb87d760201..f3b0eee525ac 100644 --- a/ms-windows/osgeo4w/package-nightly.cmd +++ b/ms-windows/osgeo4w/package-nightly.cmd @@ -29,7 +29,7 @@ if "%ARCH%"=="" goto usage if not "%SHA%"=="" set SHA=-%SHA% if "%SITE%"=="" set SITE=qgis.org if "%TARGET%"=="" set TARGET=Nightly -if "%BUILDNAME%"=="" set BUILDNAME=%PACKAGENAME%-%VERSION%%SHA%-%TARGET%-VC14-%ARCH% +if "%BUILDNAME%"=="" set BUILDNAME=%PACKAGENAME%-%VERSION%%SHA%-%TARGET%-VC16-%ARCH% if "%BUILDDIR%"=="" set BUILDDIR=%CD%\build-%PACKAGENAME%-%ARCH% if not exist "%BUILDDIR%" mkdir %BUILDDIR% @@ -106,15 +106,17 @@ touch %SRCDIR%\CMakeLists.txt echo CMAKE: %DATE% %TIME% -if "%CMAKEGEN%"=="" set CMAKEGEN=Ninja +if "%CMAKEGEN%"=="" set CMAKEGEN=-G Ninja +if "%CC%"=="" set CC=cl.exe +if "%CXX%"=="" set CXX=cl.exe if "%OSGEO4W_CXXFLAGS%"=="" set OSGEO4W_CXXFLAGS=/MD /Z7 /MP /Od /D NDEBUG for %%i in (%PYTHONHOME%) do set PYVER=%%~ni -cmake -G "%CMAKEGEN%" ^ +cmake %CMAKEGEN% ^ -D CMAKE_CXX_COMPILER="%CXX:\=/%" ^ -D CMAKE_C_COMPILER="%CC:\=/%" ^ - -D CMAKE_LINKER="%CMAKE_COMPILER_PATH:\=/%/link.exe" ^ + -D CMAKE_LINKER=link.exe ^ -D CMAKE_CXX_FLAGS_RELWITHDEBINFO="%OSGEO4W_CXXFLAGS%" ^ -D CMAKE_PDB_OUTPUT_DIRECTORY_RELWITHDEBINFO=%BUILDDIR%\apps\%PACKAGENAME%\pdb ^ -D BUILDNAME="%BUILDNAME%" ^ @@ -201,8 +203,9 @@ for %%g IN (%GRASS_VERSIONS%) do ( PATH %path%;%BUILDDIR%\output\plugins set QT_PLUGIN_PATH=%BUILDDIR%\output\plugins;%OSGEO4W_ROOT%\apps\qt5\plugins +if exist ..\testfailure del ..\testfailure cmake --build %BUILDDIR% --target %TARGET%Test --config %BUILDCONF% -if errorlevel 1 echo TESTS WERE NOT SUCCESSFUL. +if errorlevel 1 (echo TESTS WERE NOT SUCCESSFUL. & echo %errorlevel% >..\testfailure) set TEMP=%oldtemp% set TMP=%oldtmp% diff --git a/ms-windows/osgeo4w/package.cmd b/ms-windows/osgeo4w/package.cmd index 382eefa08543..aa9f49722c35 100644 --- a/ms-windows/osgeo4w/package.cmd +++ b/ms-windows/osgeo4w/package.cmd @@ -28,7 +28,7 @@ if "%PACKAGENAME%"=="" goto usage if "%ARCH%"=="" goto usage if not "%SHA%"=="" set SHA=-%SHA% if "%SITE%"=="" set SITE=qgis.org -if "%BUILDNAME%"=="" set BUILDNAME=%PACKAGENAME%-%VERSION%%SHA%-Release-VC14-%ARCH% +if "%BUILDNAME%"=="" set BUILDNAME=%PACKAGENAME%-%VERSION%%SHA%-Release-VC16-%ARCH% set BUILDDIR=%CD%\build-%PACKAGENAME%-%ARCH% if not exist "%BUILDDIR%" mkdir %BUILDDIR% @@ -105,17 +105,17 @@ touch %SRCDIR%\CMakeLists.txt echo CMAKE: %DATE% %TIME% if errorlevel 1 goto error -if "%CMAKEGEN%"=="" set CMAKEGEN=Ninja -if "%CC%"=="" set CC="%CMAKE_COMPILER_PATH:\=/%/cl.exe" -if "%CXX%"=="" set CXX="%CMAKE_COMPILER_PATH:\=/%/cl.exe" +if "%CMAKEGEN%"=="" set CMAKEGEN=-G Ninja +if "%CC%"=="" set CC=cl.exe +if "%CXX%"=="" set CXX=cl.exe if "%OSGEO4W_CXXFLAGS%"=="" set OSGEO4W_CXXFLAGS=/MD /Z7 /MP /O2 /Ob2 /D NDEBUG for %%i in (%PYTHONHOME%) do set PYVER=%%~ni -cmake -G "%CMAKEGEN%" ^ +cmake %CMAKEGEN% ^ -D CMAKE_CXX_COMPILER="%CXX:\=/%" ^ -D CMAKE_C_COMPILER="%CC:\=/%" ^ - -D CMAKE_LINKER="%CMAKE_COMPILER_PATH:\=/%/link.exe" ^ + -D CMAKE_LINKER=link.exe ^ -D CMAKE_CXX_FLAGS_RELEASE="%OSGEO4W_CXXFLAGS%" ^ -D CMAKE_PDB_OUTPUT_DIRECTORY_RELEASE=%BUILDDIR%\apps\%PACKAGENAME%\pdb ^ -D CMAKE_SHARED_LINKER_FLAGS_RELEASE="/INCREMENTAL:NO /DEBUG /OPT:REF /OPT:ICF" ^ @@ -193,8 +193,9 @@ for %%g IN (%GRASS_VERSIONS%) do ( PATH %path%;%BUILDDIR%\output\plugins set QT_PLUGIN_PATH=%BUILDDIR%\output\plugins;%OSGEO4W_ROOT%\apps\qt5\plugins +if exist ..\testfailure del ..\testfailure cmake --build %BUILDDIR% --target Experimental --config %BUILDCONF% -if errorlevel 1 echo TESTS WERE NOT SUCCESSFUL. +if errorlevel 1 (echo TESTS WERE NOT SUCCESSFUL. & touch ..\testfailure) set TEMP=%oldtemp% set TMP=%oldtmp%