summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2019-04-14 14:49:41 +0100
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2019-04-14 14:49:41 +0100
commit4821a6294eb5c387ebe48cbed88b6e8210f284a6 (patch)
treeb7556cc25af04eb99d5921639c0b9ee96c451497
parent14bfc5434418249f86f6dfa5ab5ef057cf57074c (diff)
parent26b61e809fffffc4f7c27ebde546f91902dfea80 (diff)
downloadpsycopg2-4821a6294eb5c387ebe48cbed88b6e8210f284a6.tar.gz
Merge branch 'openssl-1.1-windows'
-rw-r--r--.appveyor.yml24
-rw-r--r--NEWS2
-rw-r--r--scripts/appveyor.cache_rebuild2
-rw-r--r--scripts/win_openssl_11.patch20
-rw-r--r--setup.py4
5 files changed, 33 insertions, 19 deletions
diff --git a/.appveyor.yml b/.appveyor.yml
index 54a71ab..81515e4 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -24,7 +24,7 @@ environment:
- {PYVER: "34", PYTHON_ARCH: "32"}
- {PYVER: "34", PYTHON_ARCH: "64"}
- OPENSSL_VERSION: "1_0_2r"
+ OPENSSL_VERSION: "1_1_1b"
POSTGRES_VERSION: "11_2"
PSYCOPG2_TESTDB: psycopg2_test
@@ -135,11 +135,9 @@ install:
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
@@ -148,22 +146,12 @@ install:
curl -fsSL -o OpenSSL_%OPENSSL_VERSION%.zip https://github.com/openssl/openssl/archive/OpenSSL_%OPENSSL_VERSION%.zip
)
- # 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 (
+ - IF NOT EXIST %OPENSSLTOP%\lib\libssl.lib (
CD %BUILD_DIR% &&
7z x C:\Others\OpenSSL_%OPENSSL_VERSION%.zip &&
CD openssl-OpenSSL_%OPENSSL_VERSION% &&
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 &&
+ nmake build_libs install_dev &&
CD %BASE_DIR% &&
RMDIR /S /Q %BUILD_DIR%\openssl-OpenSSL_%OPENSSL_VERSION%
)
@@ -190,12 +178,16 @@ install:
# Copy over built libraries
# Prepare local include directory for building from
# Build pg_config in place
+ # Note patch for OpenSSL 1.1 configuration. See:
+ # https://www.postgresql-archive.org/Compile-psql-9-6-with-SSL-Version-1-1-0-td6054118.html
# NOTE: Cannot set and use the same variable inside an IF
- SET PGBUILD=%BUILD_DIR%\postgres-REL_%POSTGRES_VERSION%
- IF NOT EXIST %PGTOP%\lib\libpq.lib (
CD %BUILD_DIR% &&
7z x C:\Others\postgres-REL_%POSTGRES_VERSION%.zip &&
- CD postgres-REL_%POSTGRES_VERSION%\src\tools\msvc &&
+ CD postgres-REL_%POSTGRES_VERSION% &&
+ patch -p1 < %APPVEYOR_BUILD_FOLDER%\scripts\win_openssl_11.patch &&
+ CD src\tools\msvc &&
ECHO $config-^>{ldap} = 0; > config.pl &&
ECHO $config-^>{openssl} = "%OPENSSLTOP:\=\\%"; >> config.pl &&
ECHO.>> config.pl &&
diff --git a/NEWS b/NEWS
index 29390e7..c2f88d1 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,8 @@ What's new in psycopg 2.8.2
- Fixed `~psycopg2.extras.RealDictCursor` when there are repeated columns
(:ticket:`#884`).
+- Binary packages built with openssl 1.1.1b. Should fix concurrency problems
+ (:tickets:`#543, #836`).
What's new in psycopg 2.8.1
diff --git a/scripts/appveyor.cache_rebuild b/scripts/appveyor.cache_rebuild
index 28cd082..c09e36d 100644
--- a/scripts/appveyor.cache_rebuild
+++ b/scripts/appveyor.cache_rebuild
@@ -9,7 +9,7 @@ To invalidate the cache, update this file and check it into git.
Currently used modules built in the cache:
OpenSSL
- Version: 1.0.2r
+ Version: 1.1.1b
PostgreSQL
Version: 11.2
diff --git a/scripts/win_openssl_11.patch b/scripts/win_openssl_11.patch
new file mode 100644
index 0000000..57d0bd8
--- /dev/null
+++ b/scripts/win_openssl_11.patch
@@ -0,0 +1,20 @@
+diff --git a/src/include/pg_config.h.win32 b/src/include/pg_config.h.win32
+index dfd6972383..72d1259ffb 100644
+--- a/src/include/pg_config.h.win32
++++ b/src/include/pg_config.h.win32
+@@ -74,12 +74,15 @@
+
+ /* Define to 1 if you have the `ASN1_STRING_get0_data' function. */
+ /* #undef HAVE_ASN1_STRING_GET0_DATA */
++#define HAVE_ASN1_STRING_GET0_DATA 1
+
+ /* Define to 1 if you have the `BIO_get_data' function. */
+ /* #undef HAVE_BIO_GET_DATA */
++#define HAVE_BIO_GET_DATA 1
+
+ /* Define to 1 if you have the `BIO_meth_new' function. */
+ /* #undef HAVE_BIO_METH_NEW */
++#define HAVE_BIO_METH_NEW 1
+
+ /* Define to 1 if you have the `cbrt' function. */
+ //#define HAVE_CBRT 1
diff --git a/setup.py b/setup.py
index 660d0c9..d5eac11 100644
--- a/setup.py
+++ b/setup.py
@@ -366,8 +366,8 @@ For further information please check the 'doc/src/install.rst' file (also at
self.library_dirs.append(os.path.join(path, "ms"))
break
if self.have_ssl:
- self.libraries.append("libeay32")
- self.libraries.append("ssleay32")
+ self.libraries.append("libcrypto")
+ self.libraries.append("libssl")
self.libraries.append("crypt32")
self.libraries.append("user32")
self.libraries.append("gdi32")