From 535ff672c0ce500e5c0b68e41ad257809f1ea54d Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Thu, 16 Feb 2017 15:43:11 +0000 Subject: [PATCH 1/4] Added AppVeyor configuration to test building on Windows --- .appveyor.yml | 245 +++++++++++++++++++++++++++++++++ scripts/appveyor.cache_rebuild | 15 ++ scripts/vcvars64-vs2010.bat | 117 ++++++++++++++++ 3 files changed, 377 insertions(+) create mode 100644 .appveyor.yml create mode 100644 scripts/appveyor.cache_rebuild create mode 100644 scripts/vcvars64-vs2010.bat diff --git a/.appveyor.yml b/.appveyor.yml new file mode 100644 index 00000000..b8a93020 --- /dev/null +++ b/.appveyor.yml @@ -0,0 +1,245 @@ +version : 2.x.{build} + +clone_folder: C:\Project + +environment: + global: + # MSVC Express 2008's setenv.cmd failes if /E:ON and /V:ON are not + # enabled in the batch script interpreter + # + # WITH_COMPILER: "cmd /E:ON /V:ON /C .\\appveyor\\run_with_compiler.cmd" + CMD_IN_ENV: cmd /E:ON /V:ON /C .\appveyor\run_with_env.cmd + + matrix: + # For Python versions available on Appveyor, see + # http://www.appveyor.com/docs/installed-software#python + + - PYTHON: C:\Python27 + PYTHON_ARCH: 32 + # VS 2008 + VS_VER: 9.0 + - PYTHON: C:\Python33 + PYTHON_ARCH: 32 + # VS 2010 + VS_VER: 10.0 + - PYTHON: C:\Python34 + PYTHON_ARCH: 32 + # VS 2010 + VS_VER: 10.0 + - PYTHON: C:\Python35 + PYTHON_ARCH: 32 + # VS 2015 + VS_VER: 14.0 + - PYTHON: C:\Python36 + PYTHON_ARCH: 32 + # VS 2015 + VS_VER: 14.0 + - PYTHON: C:\Python27-x64 + PYTHON_ARCH: 64 + # VS 2008 + VS_VER: 9.0 + - PYTHON: C:\Python33-x64 + DISTUTILS_USE_SDK: '1' + PYTHON_ARCH: 64 + # VS 2010 + VS_VER: 10.0 + - PYTHON: C:\Python34-x64 + DISTUTILS_USE_SDK: '1' + PYTHON_ARCH: 64 + # VS 2010 + VS_VER: 10.0 + - PYTHON: C:\Python35-x64 + PYTHON_ARCH: 64 + # VS 2015 + VS_VER: 14.0 + - PYTHON: C:\Python36-x64 + PYTHON_ARCH: 64 + # VS 2015 + VS_VER: 14.0 + + #Py27 = 9.0 (VS 2008) + #Py 3.3,3.4 = 10.0 (VS 2010) + #Py 3.5,3.6 = 14.0 (VS 2015) + PSYCOPG2_TESTDB: psycopg2_test + PSYCOPG2_TESTDB_USER: postgres + PSYCOPG2_TESTDB_PASSWORD: Password12! + PSYCOPG2_TESTDB_HOST: localhost + PSYCOPG2_TESTDB_PORT: 5432 + + PGUSER: postgres + PGPASSWORD: Password12! + +matrix: + fast_finish: false + +services: + - postgresql95 + +cache: + # Rebuild cache if following file changes + - C:\Others -> scripts\appveyor.cache_rebuild + +# Script called before repo cloning +init: + # Uncomment next line to get RDP access during the build. + #- ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) + # + # Set Python to the path + - SET PATH=%PYTHON%;%PYTHON%\Scripts;%PATH% + + # Verify Python version and architecture + - ECHO ******************************************************************* + - ECHO Python Information + - ECHO ******************************************************************* + - "%PYTHON%\\python --version" + - "%PYTHON%\\python -c \"import sys; print('64bit: ' + str(sys.maxsize > 2**32))\"" + + # Get & Install NASM + #- curl -L -o nasminst.exe http://www.nasm.us/pub/nasm/releasebuilds/2.12.02/win64/nasm-2.12.02-installer-x64.exe && start /wait nasminst.exe /S + #- SET PATH="C:\Program Files (x86)\nasm;%PATH%" + + # Fix problem with VS2008 Express and 64bit builds + - ECHO Fixing VS2008 Express and 64bit builds + - COPY "C:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\bin\\vcvars64.bat" "C:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\bin\\amd64\\vcvarsamd64.bat" + + # Fix problem with VS2010 Express 64bit missing vcvars64.bat + # Note: repository not cloned at this point, so need to fetch + # file another way + - ECHO Fixing VS2010 Express and 64bit builds + - curl -fsSL -o "C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\bin\\amd64\\vcvars64.bat" https://raw.githubusercontent.com/psycopg/psycopg2-wheels/master/scripts/vcvars64-vs2010.bat + + # Setup the compiler based upon version and architecture + - ECHO Configuring Compiler + - IF "%PYTHON_ARCH%"=="32" (CALL "C:\\Program Files (x86)\\Microsoft Visual Studio %VS_VER%\\VC\\vcvarsall.bat" x86) + - IF "%PYTHON_ARCH%"=="64" (CALL "C:\\Program Files (x86)\\Microsoft Visual Studio %VS_VER%\\VC\\vcvarsall.bat" amd64) + + # Change PostgreSQL config before service starts to allow > 1 prepared + # transactions for test cases + - ECHO max_prepared_transactions = 10 >> "C:\\Program Files\\PostgreSQL\\9.5\\data\\postgresql.conf" + + +# Repository gets cloned, Cache is restored +install: + # We start off CD'ed to cloned folder + - SET BASE_DIR=C:\Others\%PYTHON_ARCH%\%VS_VER% + - SET BUILD_DIR=%BASE_DIR%\Builds + - IF NOT EXIST %BUILD_DIR% MKDIR %BUILD_DIR% + + - ECHO ******************************************************************* + - ECHO Initialized variables specific for this build + - ECHO ******************************************************************* + - ECHO %BASE_DIR% + - ECHO %BUILD_DIR% + - ECHO ******************************************************************* + + # Setup directories for building OpenSSL libraries + - ECHO ******************************************************************* + - ECHO Preparing for building OpenSSL + - ECHO ******************************************************************* + - SET OPENSSLTOP=%BASE_DIR%\openssl + - IF NOT EXIST %OPENSSLTOP%\include\openssl MKDIR %OPENSSLTOP%\include\openssl + - IF NOT EXIST %OPENSSLTOP%\lib MKDIR %OPENSSLTOP%\lib + + # Setup OpenSSL Environment Variables based on processor architecture + - ps: >- + If ($env:PYTHON_ARCH -Match "32" ) { + $env:VCVARS_PLATFORM="x86" + $env:TARGET="VC-WIN32" + $env:DO="do_ms" + } Else { + $env:VCVARS_PLATFORM="amd64" + $env:TARGET="VC-WIN64A" + $env:DO="do_win64a" + $env:CPU="AMD64" + } + # Download OpenSSL source + - CD C:\Others + - IF NOT EXIST OpenSSL_1_0_2k.tar.gz ( + appveyor DownloadFile https://github.com/openssl/openssl/archive/OpenSSL_1_0_2k.tar.gz + ) + + # To use OpenSSL >= 1.1.0, both libpq and psycopg build environments have + # to support the new library names. Below are commands to build OpenSSL + # 1.1.0: + # - mkdir _build + # - cd _build + # - perl ..\Configure %TARGET% no-asm no-shared --prefix=%BASE_DIR%\openssl --openssldir=%BASE_DIR%\openssl + # - nmake build_libs install_dev + - IF NOT EXIST %OPENSSLTOP%\lib\ssleay32.lib ( + CD %BUILD_DIR% && + 7z x C:\Others\OpenSSL_1_0_2k.tar.gz -so | 7z x -si -ttar > nul && + ECHO Build Directory Contents && + ECHO ************************************************************* && + DIR && + CD openssl-OpenSSL_1_0_2k && + perl Configure %TARGET% no-asm no-shared no-zlib --prefix=%OPENSSLTOP% --openssldir=%OPENSSLTOP% && + CALL ms\%DO% && + nmake -f ms\nt.mak init headers lib && + COPY inc32\openssl\*.h %OPENSSLTOP%\include\openssl && + COPY out32\*.lib %OPENSSLTOP%\lib && + CD %BASE_DIR% && + RMDIR /S /Q %BUILD_DIR%\openssl-OpenSSL_1_0_2k + ) + + # Setup directories for building PostgreSQL librarires + - ECHO ******************************************************************* + - ECHO Preparing for building PostgreSQL libraries + - ECHO ******************************************************************* + - SET PGTOP=%BASE_DIR%\postgresql + - IF NOT EXIST %PGTOP%\include MKDIR %PGTOP%\include + - IF NOT EXIST %PGTOP%\lib MKDIR %PGTOP%\lib + # Download PostgreSQL source + - CD C:\Others + - IF NOT EXIST postgresql-9.6.2.tar.gz ( + appveyor DownloadFile https://ftp.postgresql.org/pub/source/v9.6.2/postgresql-9.6.2.tar.gz + ) + + # Setup build config file (config.pl) + # Build libpgport first + # Build libpq + # NOTE: Cannot set and use the same variable inside an IF + - SET PGBUILD=%BUILD_DIR%\postgresql-9.6.2 + - IF NOT EXIST %PGTOP%\lib\libpq.lib ( + CD %BUILD_DIR% && + 7z x C:\Others\postgresql-9.6.2.tar.gz -so | 7z x -si -ttar > nul && + ECHO Build Directory Contents && + ECHO ************************************************************* && + DIR && + CD postgresql-9.6.2\src\tools\msvc && + ECHO $config-^>{ldap} = 0; > config.pl && + ECHO $config-^>{openssl} = "%OPENSSLTOP:\=\\%"; >> config.pl && + ECHO.>> config.pl && + ECHO 1;>> config.pl && + build libpgport && + XCOPY /E ..\..\include %PGTOP%\include && + DIR %PGBUILD% && + COPY %PGBUILD%\Release\libpgport\libpgport.lib %PGTOP%\lib && + CD ..\..\interfaces\libpq && + nmake -f win32.mak USE_OPENSSL=1 ENABLE_THREAD_SAFETY=1 SSL_INC=%OPENSSLTOP%\include SSL_LIB_PATH=%OPENSSLTOP%\lib config .\Release\libpq.lib && + COPY *.h %PGTOP%\include && + COPY Release\libpq.lib %PGTOP%\lib && + CD %BASE_DIR% && + RMDIR /S /Q %PGBUILD% + ) + +build: off + +#before_build: + +build_script: + # Add PostgreSQL binaries to the path + - PATH=C:\Program Files\PostgreSQL\9.5\bin\;%PATH% + - CD C:\project + - "%PYTHON%\\python.exe setup.py build_ext --have-ssl -l libpgcommon -L %OPENSSLTOP%\\lib;%PGTOP%\\lib -I %OPENSSLTOP%\\include;%PGTOP%\\include" + - "%PYTHON%\\python.exe setup.py build" + - "%PYTHON%\\python.exe setup.py install" + +#after_build: + +before_test: + # Create and setup PostgreSQL database for the tests + - createdb %PSYCOPG2_TESTDB% + +test_script: + - "%PYTHON%\\python.exe -c \"import psycopg2; print(psycopg2.__version__)\"" + - "%PYTHON%\\python.exe -c \"from psycopg2 import tests; tests.unittest.main(defaultTest='tests.test_suite')\" --verbose" diff --git a/scripts/appveyor.cache_rebuild b/scripts/appveyor.cache_rebuild new file mode 100644 index 00000000..9bc1ce16 --- /dev/null +++ b/scripts/appveyor.cache_rebuild @@ -0,0 +1,15 @@ +This file is a simple placeholder for forcing the appveyor build cache +to invalidate itself since appveyor.yml changes more frequently then +the cache needs updating. Note, the versions list here can be +different than what is indicated in appveyor.yml. + +To invalidate the cache, update this file and check it into git. + + +Currently used modules built in the cache: + +OpenSSL + Version: 1.0.2k + +PostgreSQL + Version: 9.6.2 diff --git a/scripts/vcvars64-vs2010.bat b/scripts/vcvars64-vs2010.bat new file mode 100644 index 00000000..7c8e1c20 --- /dev/null +++ b/scripts/vcvars64-vs2010.bat @@ -0,0 +1,117 @@ +@echo Setting environment for using Microsoft Visual Studio 2010 x64 tools. + +@call :GetVSCommonToolsDir +@if "%VS100COMNTOOLS%"=="" goto error_no_VS100COMNTOOLSDIR + +@call "%VS100COMNTOOLS%VCVarsQueryRegistry.bat" No32bit 64bit + +@if "%VSINSTALLDIR%"=="" goto error_no_VSINSTALLDIR +@if "%VCINSTALLDIR%"=="" goto error_no_VCINSTALLDIR +@if "%FrameworkDir64%"=="" goto error_no_FrameworkDIR64 +@if "%FrameworkVersion64%"=="" goto error_no_FrameworkVer64 +@if "%Framework35Version%"=="" goto error_no_Framework35Version + +@set FrameworkDir=%FrameworkDir64% +@set FrameworkVersion=%FrameworkVersion64% + +@if not "%WindowsSdkDir%" == "" ( + @set "PATH=%WindowsSdkDir%bin\NETFX 4.0 Tools\x64;%WindowsSdkDir%bin\x64;%WindowsSdkDir%bin;%PATH%" + @set "INCLUDE=%WindowsSdkDir%include;%INCLUDE%" + @set "LIB=%WindowsSdkDir%lib\x64;%LIB%" +) + +@rem PATH +@rem ---- +@if exist "%VSINSTALLDIR%Team Tools\Performance Tools\x64" ( + @set "PATH=%VSINSTALLDIR%Team Tools\Performance Tools\x64;%VSINSTALLDIR%Team Tools\Performance Tools;%PATH%" +) +@if exist "%ProgramFiles%\HTML Help Workshop" set PATH=%ProgramFiles%\HTML Help Workshop;%PATH% +@if exist "%ProgramFiles(x86)%\HTML Help Workshop" set PATH=%ProgramFiles(x86)%\HTML Help Workshop;%PATH% +@set PATH=%VSINSTALLDIR%Common7\Tools;%PATH% +@set PATH=%VSINSTALLDIR%Common7\IDE;%PATH% +@set PATH=%VCINSTALLDIR%VCPackages;%PATH% +@set PATH=%FrameworkDir%\%Framework35Version%;%PATH% +@set PATH=%FrameworkDir%\%FrameworkVersion%;%PATH% +@set PATH=%VCINSTALLDIR%BIN\amd64;%PATH% + +@rem INCLUDE +@rem ------- +@if exist "%VCINSTALLDIR%ATLMFC\INCLUDE" set INCLUDE=%VCINSTALLDIR%ATLMFC\INCLUDE;%INCLUDE% +@set INCLUDE=%VCINSTALLDIR%INCLUDE;%INCLUDE% + +@rem LIB +@rem --- +@if exist "%VCINSTALLDIR%ATLMFC\LIB\amd64" set LIB=%VCINSTALLDIR%ATLMFC\LIB\amd64;%LIB% +@set LIB=%VCINSTALLDIR%LIB\amd64;%LIB% +@rem Don't forget to include the libraries in the SDK +@set LIB=C:\Program Files\Microsoft SDKs\Windows\v7.1\Lib\x64;%LIB% + +OSLIbraries + +@rem LIBPATH +@rem ------- +@if exist "%VCINSTALLDIR%ATLMFC\LIB\amd64" set LIBPATH=%VCINSTALLDIR%ATLMFC\LIB\amd64;%LIBPATH% +@set LIBPATH=%VCINSTALLDIR%LIB\amd64;%LIBPATH% +@set LIBPATH=%FrameworkDir%\%Framework35Version%;%LIBPATH% +@set LIBPATH=%FrameworkDir%\%FrameworkVersion%;%LIBPATH% + +@set Platform=X64 +@set CommandPromptType=Native + +@goto end + +@REM ----------------------------------------------------------------------- +:GetVSCommonToolsDir +@set VS100COMNTOOLS= +@call :GetVSCommonToolsDirHelper32 HKLM > nul 2>&1 +@if errorlevel 1 call :GetVSCommonToolsDirHelper32 HKCU > nul 2>&1 +@if errorlevel 1 call :GetVSCommonToolsDirHelper64 HKLM > nul 2>&1 +@if errorlevel 1 call :GetVSCommonToolsDirHelper64 HKCU > nul 2>&1 +@exit /B 0 + +:GetVSCommonToolsDirHelper32 +@for /F "tokens=1,2*" %%i in ('reg query "%1\SOFTWARE\Microsoft\VisualStudio\SxS\VS7" /v "10.0"') DO ( + @if "%%i"=="10.0" ( + @SET "VS100COMNTOOLS=%%k" + ) +) +@if "%VS100COMNTOOLS%"=="" exit /B 1 +@SET "VS100COMNTOOLS=%VS100COMNTOOLS%Common7\Tools\" +@exit /B 0 + +:GetVSCommonToolsDirHelper64 +@for /F "tokens=1,2*" %%i in ('reg query "%1\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7" /v "10.0"') DO ( + @if "%%i"=="10.0" ( + @SET "VS100COMNTOOLS=%%k" + ) +) +@if "%VS100COMNTOOLS%"=="" exit /B 1 +@SET "VS100COMNTOOLS=%VS100COMNTOOLS%Common7\Tools\" +@exit /B 0 + +@REM ----------------------------------------------------------------------- +:error_no_VS100COMNTOOLSDIR +@echo ERROR: Cannot determine the location of the VS Common Tools folder. +@goto end + +:error_no_VSINSTALLDIR +@echo ERROR: Cannot determine the location of the VS installation. +@goto end + +:error_no_VCINSTALLDIR +@echo ERROR: Cannot determine the location of the VC installation. +@goto end + +:error_no_FrameworkDIR64 +@echo ERROR: Cannot determine the location of the .NET Framework 64bit installation. +@goto end + +:error_no_FrameworkVer64 +@echo ERROR: Cannot determine the version of the .NET Framework 64bit installation. +@goto end + +:error_no_Framework35Version +@echo ERROR: Cannot determine the .NET Framework 3.5 version. +@goto end + +:end From 7819d0fc6c0de98b39789b11191bb627ef5fdcf3 Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Thu, 16 Feb 2017 15:59:37 +0000 Subject: [PATCH 2/4] Windows testing tweaks, badge on README --- .appveyor.yml | 84 ++++++++++++++++++++++++--------------------------- README.rst | 11 +++++-- 2 files changed, 48 insertions(+), 47 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index b8a93020..5c418e42 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -14,52 +14,52 @@ environment: # For Python versions available on Appveyor, see # http://www.appveyor.com/docs/installed-software#python - - PYTHON: C:\Python27 - PYTHON_ARCH: 32 - # VS 2008 - VS_VER: 9.0 - - PYTHON: C:\Python33 - PYTHON_ARCH: 32 - # VS 2010 - VS_VER: 10.0 - - PYTHON: C:\Python34 - PYTHON_ARCH: 32 - # VS 2010 - VS_VER: 10.0 - - PYTHON: C:\Python35 - PYTHON_ARCH: 32 - # VS 2015 - VS_VER: 14.0 - - PYTHON: C:\Python36 - PYTHON_ARCH: 32 - # VS 2015 - VS_VER: 14.0 + # Py 2.7 = VS Ver. 9.0 (VS 2008) + # Py 3.3, 3.4 = VS Ver. 10.0 (VS 2010) + # Py 3.5, 3.6 = VS Ver. 14.0 (VS 2015) + - PYTHON: C:\Python27-x64 PYTHON_ARCH: 64 - # VS 2008 VS_VER: 9.0 - - PYTHON: C:\Python33-x64 - DISTUTILS_USE_SDK: '1' + + - PYTHON: C:\Python27 + PYTHON_ARCH: 32 + VS_VER: 9.0 + + - PYTHON: C:\Python36-x64 PYTHON_ARCH: 64 - # VS 2010 - VS_VER: 10.0 + VS_VER: 14.0 + + - PYTHON: C:\Python36 + PYTHON_ARCH: 32 + VS_VER: 14.0 + + - PYTHON: C:\Python35-x64 + PYTHON_ARCH: 64 + VS_VER: 14.0 + + - PYTHON: C:\Python35 + PYTHON_ARCH: 32 + VS_VER: 14.0 + - PYTHON: C:\Python34-x64 DISTUTILS_USE_SDK: '1' PYTHON_ARCH: 64 - # VS 2010 VS_VER: 10.0 - - PYTHON: C:\Python35-x64 - PYTHON_ARCH: 64 - # VS 2015 - VS_VER: 14.0 - - PYTHON: C:\Python36-x64 - PYTHON_ARCH: 64 - # VS 2015 - VS_VER: 14.0 - #Py27 = 9.0 (VS 2008) - #Py 3.3,3.4 = 10.0 (VS 2010) - #Py 3.5,3.6 = 14.0 (VS 2015) + - PYTHON: C:\Python34 + PYTHON_ARCH: 32 + VS_VER: 10.0 + + - PYTHON: C:\Python33-x64 + DISTUTILS_USE_SDK: '1' + PYTHON_ARCH: 64 + VS_VER: 10.0 + + - PYTHON: C:\Python33 + PYTHON_ARCH: 32 + VS_VER: 10.0 + PSYCOPG2_TESTDB: psycopg2_test PSYCOPG2_TESTDB_USER: postgres PSYCOPG2_TESTDB_PASSWORD: Password12! @@ -168,9 +168,6 @@ install: - IF NOT EXIST %OPENSSLTOP%\lib\ssleay32.lib ( CD %BUILD_DIR% && 7z x C:\Others\OpenSSL_1_0_2k.tar.gz -so | 7z x -si -ttar > nul && - ECHO Build Directory Contents && - ECHO ************************************************************* && - DIR && CD openssl-OpenSSL_1_0_2k && perl Configure %TARGET% no-asm no-shared no-zlib --prefix=%OPENSSLTOP% --openssldir=%OPENSSLTOP% && CALL ms\%DO% && @@ -202,9 +199,6 @@ install: - IF NOT EXIST %PGTOP%\lib\libpq.lib ( CD %BUILD_DIR% && 7z x C:\Others\postgresql-9.6.2.tar.gz -so | 7z x -si -ttar > nul && - ECHO Build Directory Contents && - ECHO ************************************************************* && - DIR && CD postgresql-9.6.2\src\tools\msvc && ECHO $config-^>{ldap} = 0; > config.pl && ECHO $config-^>{openssl} = "%OPENSSLTOP:\=\\%"; >> config.pl && @@ -212,7 +206,6 @@ install: ECHO 1;>> config.pl && build libpgport && XCOPY /E ..\..\include %PGTOP%\include && - DIR %PGBUILD% && COPY %PGBUILD%\Release\libpgport\libpgport.lib %PGTOP%\lib && CD ..\..\interfaces\libpq && nmake -f win32.mak USE_OPENSSL=1 ENABLE_THREAD_SAFETY=1 SSL_INC=%OPENSSLTOP%\include SSL_LIB_PATH=%OPENSSLTOP%\lib config .\Release\libpq.lib && @@ -229,7 +222,7 @@ build: off build_script: # Add PostgreSQL binaries to the path - PATH=C:\Program Files\PostgreSQL\9.5\bin\;%PATH% - - CD C:\project + - CD C:\Project - "%PYTHON%\\python.exe setup.py build_ext --have-ssl -l libpgcommon -L %OPENSSLTOP%\\lib;%PGTOP%\\lib -I %OPENSSLTOP%\\include;%PGTOP%\\include" - "%PYTHON%\\python.exe setup.py build" - "%PYTHON%\\python.exe setup.py install" @@ -239,6 +232,7 @@ build_script: before_test: # Create and setup PostgreSQL database for the tests - createdb %PSYCOPG2_TESTDB% + - psql -d %PSYCOPG2_TESTDB% -c "CREATE EXTENSION HSTORE;" test_script: - "%PYTHON%\\python.exe -c \"import psycopg2; print(psycopg2.__version__)\"" diff --git a/README.rst b/README.rst index f18be564..e33836e0 100644 --- a/README.rst +++ b/README.rst @@ -46,6 +46,13 @@ please check the `project homepage`__. .. __: http://initd.org/psycopg/ -.. image:: https://travis-ci.org/psycopg/psycopg2.svg?branch=master +:Linux/OSX: |travis| +:Windows: |appveyor| + +.. |travis| image:: https://travis-ci.org/psycopg/psycopg2.svg?branch=master :target: https://travis-ci.org/psycopg/psycopg2 - :alt: Build Status + :alt: Linux and OSX build status + +.. |appveyor| image:: https://ci.appveyor.com/api/projects/status/github/psycopg/psycopg2?svg=true + :target: https://ci.appveyor.com/project/psycopg/psycopg2 + :alt: Windows build status From 089ceb96a81d56857cb034ebdcf97a7ca19da0f7 Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Thu, 16 Feb 2017 16:32:17 +0000 Subject: [PATCH 3/4] Download postgres from github instead of ftp.postgresql.org There may be some misconfigured mirror, download fails randomly, e.g. https://ci.appveyor.com/project/psycopg/psycopg2/build/job/9j792s03tghrb7sr --- .appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 5c418e42..fe52c556 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -155,7 +155,7 @@ install: # Download OpenSSL source - CD C:\Others - IF NOT EXIST OpenSSL_1_0_2k.tar.gz ( - appveyor DownloadFile https://github.com/openssl/openssl/archive/OpenSSL_1_0_2k.tar.gz + curl -fsSL -o OpenSSL_1_0_2k.tar.gz https://github.com/openssl/openssl/archive/OpenSSL_1_0_2k.tar.gz ) # To use OpenSSL >= 1.1.0, both libpq and psycopg build environments have @@ -188,7 +188,7 @@ install: # Download PostgreSQL source - CD C:\Others - IF NOT EXIST postgresql-9.6.2.tar.gz ( - appveyor DownloadFile https://ftp.postgresql.org/pub/source/v9.6.2/postgresql-9.6.2.tar.gz + curl -fsSL -o postgresql-9.6.2.tar.gz https://github.com/postgres/postgres/archive/REL9_6_2.tar.gz ) # Setup build config file (config.pl) From afcae0a61b0db1389c3d13f72d0ca9b3661aea6a Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Thu, 16 Feb 2017 17:18:19 +0000 Subject: [PATCH 4/4] Download external packages in .zip instead of .tar.gz 7z barfs every now and then with tar files (https://ci.appveyor.com/project/psycopg/psycopg2/build/job/oh1ux3ih7baia0uu) --- .appveyor.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index fe52c556..e4cf1528 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -154,8 +154,8 @@ install: } # Download OpenSSL source - CD C:\Others - - IF NOT EXIST OpenSSL_1_0_2k.tar.gz ( - curl -fsSL -o OpenSSL_1_0_2k.tar.gz https://github.com/openssl/openssl/archive/OpenSSL_1_0_2k.tar.gz + - IF NOT EXIST OpenSSL_1_0_2k.zip ( + curl -fsSL -o OpenSSL_1_0_2k.zip https://github.com/openssl/openssl/archive/OpenSSL_1_0_2k.zip ) # To use OpenSSL >= 1.1.0, both libpq and psycopg build environments have @@ -167,7 +167,7 @@ install: # - nmake build_libs install_dev - IF NOT EXIST %OPENSSLTOP%\lib\ssleay32.lib ( CD %BUILD_DIR% && - 7z x C:\Others\OpenSSL_1_0_2k.tar.gz -so | 7z x -si -ttar > nul && + 7z x C:\Others\OpenSSL_1_0_2k.zip && CD openssl-OpenSSL_1_0_2k && perl Configure %TARGET% no-asm no-shared no-zlib --prefix=%OPENSSLTOP% --openssldir=%OPENSSLTOP% && CALL ms\%DO% && @@ -187,19 +187,19 @@ install: - IF NOT EXIST %PGTOP%\lib MKDIR %PGTOP%\lib # Download PostgreSQL source - CD C:\Others - - IF NOT EXIST postgresql-9.6.2.tar.gz ( - curl -fsSL -o postgresql-9.6.2.tar.gz https://github.com/postgres/postgres/archive/REL9_6_2.tar.gz + - IF NOT EXIST postgres-REL9_6_2.zip ( + curl -fsSL -o postgres-REL9_6_2.zip https://github.com/postgres/postgres/archive/REL9_6_2.zip ) # Setup build config file (config.pl) # Build libpgport first # Build libpq # NOTE: Cannot set and use the same variable inside an IF - - SET PGBUILD=%BUILD_DIR%\postgresql-9.6.2 + - SET PGBUILD=%BUILD_DIR%\postgres-REL9_6_2 - IF NOT EXIST %PGTOP%\lib\libpq.lib ( CD %BUILD_DIR% && - 7z x C:\Others\postgresql-9.6.2.tar.gz -so | 7z x -si -ttar > nul && - CD postgresql-9.6.2\src\tools\msvc && + 7z x C:\Others\postgres-REL9_6_2.zip && + CD postgres-REL9_6_2\src\tools\msvc && ECHO $config-^>{ldap} = 0; > config.pl && ECHO $config-^>{openssl} = "%OPENSSLTOP:\=\\%"; >> config.pl && ECHO.>> config.pl &&