Skip to content

Commit 548261e

Browse files
authored
Merge branch 'master' into alex-patch-4
2 parents b41214c + 10041cd commit 548261e

File tree

175 files changed

+27776
-1737
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

175 files changed

+27776
-1737
lines changed

.github/ISSUE_TEMPLATE.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
If you're filing a bug (as opposed to a feature request), please try the
2+
following things:
3+
4+
* Upgrade to the latest version of ``setuptools`` and ``pip``
5+
* Make sure you're on a supported version of OpenSSL
6+
* Try with the latest version of ``cryptography``
7+
8+
If none of that works, please make sure to include the following information in
9+
your bug report:
10+
11+
* Versions of Python, ``cryptography``, ``cffi``, ``pip``, and ``setuptools``
12+
you're using
13+
* How you installed ``cryptography``
14+
* Clear steps for reproducing your bug

.jenkins/Jenkinsfile-OpenSSL-1.1

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
def configs = [
2+
[
3+
label: "windows2012-openssl", arch: "x86", "vsversion": 2010
4+
],
5+
[
6+
label: "windows2012-openssl", arch: "x86_64", "vsversion": 2010
7+
],
8+
[
9+
label: "windows2012-openssl", arch: "x86", "vsversion": 2015
10+
],
11+
[
12+
label: "windows2012-openssl", arch: "x86_64", "vsversion": 2015
13+
],
14+
]
15+
16+
script = """
17+
wmic qfe
18+
powershell "[Net.ServicePointManager]::SecurityProtocol = 'tls12'; wget 'https://www.openssl.org/source/openssl-1.1.0-latest.tar.gz' -OutFile 'openssl-latest.tar.gz'"
19+
REM Next decompress the tarball using winrar. INUL disables error msgs, which are GUI prompts and therefore undesirable
20+
"C:\\Program Files\\WinRAR\\WinRAR.exe" -INUL x openssl-latest.tar.gz
21+
cd openssl-1*
22+
REM The next line determines the name of the current directory. Batch is great.
23+
FOR %%I IN (.) DO @SET CURRENTDIR=%%~nI%%~xI
24+
if "%BUILDARCH%" == "x86" (
25+
@SET BUILDARCHFLAG=x86
26+
@SET OPENSSLARCHFLAG="VC-WIN32"
27+
) else (
28+
@SET BUILDARCHFLAG=amd64
29+
@SET OPENSSLARCHFLAG="VC-WIN64A"
30+
)
31+
if "%BUILDVSVERSION%" == "2010" (
32+
call "C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\vcvarsall.bat" %BUILDARCHFLAG%
33+
echo "Building with VS 2010"
34+
) else (
35+
call "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\vcvarsall.bat" %BUILDARCHFLAG%
36+
echo "Building with VS 2015"
37+
)
38+
SET
39+
perl Configure no-comp no-shared %OPENSSLARCHFLAG%
40+
nmake
41+
nmake test
42+
43+
if "%BUILDARCH%" == "x86" (
44+
@SET FINALDIR="openssl-win32-%BUILDVSVERSION%"
45+
) else (
46+
@SET FINALDIR="openssl-win64-%BUILDVSVERSION%"
47+
)
48+
mkdir %FINALDIR%
49+
mkdir %FINALDIR%\\lib
50+
move include %FINALDIR%\\include
51+
move libcrypto.lib %FINALDIR%\\lib\\
52+
move libssl.lib %FINALDIR%\\lib\\
53+
"C:\\Program Files\\WinRAR\\WinRAR.exe" -INUL a %CURRENTDIR%-%BUILDVSVERSION%-%BUILDARCH%.zip %FINALDIR%\\include %FINALDIR%\\lib\\libcrypto.lib %FINALDIR%\\lib\\libssl.lib
54+
"""
55+
56+
def build(label, vsversion, arch) {
57+
node(label) {
58+
try {
59+
timeout(time: 30, unit: 'MINUTES') {
60+
stage("Compile") {
61+
withEnv(["BUILDARCH=$arch", "BUILDVSVERSION=$vsversion"]) {
62+
bat script
63+
}
64+
}
65+
stage("Archive") {
66+
archiveArtifacts artifacts: "**/openssl-*.zip"
67+
}
68+
}
69+
} finally {
70+
deleteDir()
71+
}
72+
}
73+
}
74+
75+
def builders = [:]
76+
77+
for (config in configs) {
78+
def vsversion = config["vsversion"]
79+
def arch = config["arch"]
80+
def label = config["label"]
81+
builders["${vsversion}-${arch}"] = {
82+
build(label, vsversion, arch)
83+
}
84+
}
85+
86+
parallel builders
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
def configs = ["sierra", "yosemite"]
2+
3+
def _build(label) {
4+
node(label) {
5+
try {
6+
timeout(time: 30, unit: 'MINUTES') {
7+
stage("Compile") {
8+
sh """
9+
set -xe
10+
11+
/usr/local/bin/brew update
12+
/usr/local/bin/brew reinstall [email protected] --build-bottle
13+
"""
14+
}
15+
}
16+
} finally {
17+
deleteDir()
18+
}
19+
}
20+
}
21+
22+
def builders = [:]
23+
24+
for (_label in configs) {
25+
def label = _label
26+
builders[label] = {
27+
_build(label)
28+
}
29+
}
30+
31+
parallel builders
32+
33+
build job: 'pyca/cryptography/master', wait: false
Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
properties([
2+
parameters([
3+
string(defaultValue: '', description: 'The version from PyPI to build', name: 'BUILD_VERSION')
4+
]),
5+
pipelineTriggers([])
6+
])
7+
8+
def configs = [
9+
[
10+
label: 'windows',
11+
versions: ['py26', 'py27', 'py34', 'py35', 'py36'],
12+
],
13+
[
14+
label: 'windows64',
15+
versions: ['py26', 'py27', 'py34', 'py35', 'py36'],
16+
],
17+
[
18+
label: 'sierra',
19+
versions: ['py26', 'py27', 'py34', 'py35', 'py36'],
20+
],
21+
[
22+
label: 'docker',
23+
imageName: 'pyca/cryptography-manylinux1:i686',
24+
versions: [
25+
'cp26-cp26m', 'cp26-cp26mu', 'cp27-cp27m',
26+
'cp27-cp27mu', 'cp34-cp34m', 'cp35-cp35m',
27+
'cp36-cp36m'
28+
],
29+
],
30+
[
31+
label: 'docker',
32+
imageName: 'pyca/cryptography-manylinux1:x86_64',
33+
versions: [
34+
'cp26-cp26m', 'cp26-cp26mu', 'cp27-cp27m',
35+
'cp27-cp27mu', 'cp34-cp34m', 'cp35-cp35m',
36+
'cp36-cp36m'
37+
],
38+
],
39+
]
40+
41+
42+
def build(version, label, imageName) {
43+
try {
44+
timeout(time: 30, unit: 'MINUTES') {
45+
if (label.contains("windows")) {
46+
def pythonPath = [
47+
py26: "C:\\Python26\\python.exe",
48+
py27: "C:\\Python27\\python.exe",
49+
py34: "C:\\Python34\\python.exe",
50+
py35: "C:\\Python35\\python.exe",
51+
py36: "C:\\Python36\\python.exe"
52+
]
53+
if (version == "py35" || version == "py36") {
54+
opensslPaths = [
55+
"windows": [
56+
"include": "C:\\OpenSSL-Win32-2015\\include",
57+
"lib": "C:\\OpenSSL-Win32-2015\\lib"
58+
],
59+
"windows64": [
60+
"include": "C:\\OpenSSL-Win64-2015\\include",
61+
"lib": "C:\\OpenSSL-Win64-2015\\lib"
62+
]
63+
]
64+
} else {
65+
opensslPaths = [
66+
"windows": [
67+
"include": "C:\\OpenSSL-Win32-2010\\include",
68+
"lib": "C:\\OpenSSL-Win32-2010\\lib"
69+
],
70+
"windows64": [
71+
"include": "C:\\OpenSSL-Win64-2010\\include",
72+
"lib": "C:\\OpenSSL-Win64-2010\\lib"
73+
]
74+
]
75+
}
76+
bat """
77+
wmic qfe
78+
@set PATH="C:\\Python27";"C:\\Python27\\Scripts";%PATH%
79+
@set PYTHON="${pythonPath[version]}"
80+
81+
@set INCLUDE="${opensslPaths[label]['include']}";%INCLUDE%
82+
@set LIB="${opensslPaths[label]['lib']}";%LIB%
83+
virtualenv -p %PYTHON% .release
84+
call .release\\Scripts\\activate
85+
pip install wheel virtualenv
86+
pip wheel cryptography==$BUILD_VERSION --wheel-dir=wheelhouse --no-binary cryptography
87+
pip install -f wheelhouse cryptography --no-index
88+
python -c "from cryptography.hazmat.backends.openssl.backend import backend;print('Loaded: ' + backend.openssl_version_text());print('Linked Against: ' + backend._ffi.string(backend._lib.OPENSSL_VERSION_TEXT).decode('ascii'))"
89+
"""
90+
} else if (label.contains("sierra")) {
91+
def pythonPath = [
92+
py26: "python2.6",
93+
py27: "/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7",
94+
py34: "/Library/Frameworks/Python.framework/Versions/3.4/bin/python3.4",
95+
py35: "/Library/Frameworks/Python.framework/Versions/3.5/bin/python3.5",
96+
py36: "/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6",
97+
]
98+
ansiColor {
99+
sh """#!/usr/bin/env bash
100+
set -xe
101+
# output the list of things we've installed as a point in time check of how up
102+
# to date the builder is
103+
/usr/sbin/system_profiler SPInstallHistoryDataType
104+
105+
# Jenkins logs in as a non-interactive shell, so we don't even have /usr/local/bin in PATH
106+
export PATH="/usr/local/bin:\${PATH}"
107+
export PATH="/Users/jenkins/.pyenv/shims:\${PATH}"
108+
109+
printenv
110+
111+
virtualenv .venv -p ${pythonPath[version]}
112+
source .venv/bin/activate
113+
pip install -U wheel # upgrade wheel to latest before we use it to build the wheel
114+
CRYPTOGRAPHY_SUPPRESS_LINK_FLAGS="1" LDFLAGS="/usr/local/opt/[email protected]/lib/libcrypto.a /usr/local/opt/[email protected]/lib/libssl.a" CFLAGS="-I/usr/local/opt/[email protected]/include -mmacosx-version-min=10.9" pip wheel cryptography==$BUILD_VERSION --wheel-dir=wheelhouse --no-binary cryptography
115+
pip install -f wheelhouse cryptography --no-index
116+
python -c "from cryptography.hazmat.backends.openssl.backend import backend;print('Loaded: ' + backend.openssl_version_text());print('Linked Against: ' + backend._ffi.string(backend._lib.OPENSSL_VERSION_TEXT).decode('ascii'))"
117+
otool -L `find .venv -name '_openssl*.so'`
118+
lipo -info `find .venv -name '*.so'`
119+
otool -L `find .venv -name '_openssl*.so'` | grep -vG "libcrypto\\|libssl"
120+
"""
121+
}
122+
} else if (label.contains("docker")) {
123+
linux32 = ""
124+
if (imageName.contains("i686")) {
125+
linux32 = "linux32"
126+
}
127+
sh """#!/usr/bin/env bash
128+
set -x -e
129+
# Because we are doing this as root in the container, but we write to a mounted dir that is outside the container
130+
# we need to make sure we set these files writable such that the jenkins user can delete them afterwards
131+
mkdir -p tmpwheelhouse
132+
mkdir -p wheelhouse
133+
chmod -R 777 tmpwheelhouse
134+
chmod -R 777 wheelhouse
135+
136+
$linux32 /opt/python/$version/bin/pip install cffi six idna asn1crypto ipaddress enum34
137+
LDFLAGS="-L/opt/pyca/cryptography/openssl/lib" \
138+
CFLAGS="-I/opt/pyca/cryptography/openssl/include -Wl,--exclude-libs,ALL" \
139+
$linux32 /opt/python/$version/bin/pip wheel cryptography==$BUILD_VERSION -w tmpwheelhouse/ --no-binary cryptography --no-deps
140+
$linux32 auditwheel repair tmpwheelhouse/cryptography*.whl -w wheelhouse/
141+
$linux32 /opt/python/$version/bin/pip install cryptography==$BUILD_VERSION --no-index -f wheelhouse/
142+
$linux32 /opt/python/$version/bin/python -c "from cryptography.hazmat.backends.openssl.backend import backend;print('Loaded: ' + backend.openssl_version_text());print('Linked Against: ' + backend._ffi.string(backend._lib.OPENSSL_VERSION_TEXT).decode('ascii'))"
143+
"""
144+
}
145+
archiveArtifacts artifacts: "wheelhouse/cryptography*.whl"
146+
}
147+
} finally {
148+
deleteDir()
149+
}
150+
151+
}
152+
153+
def builders = [:]
154+
for (config in configs) {
155+
def label = config["label"]
156+
def versions = config["versions"]
157+
158+
for (_version in versions) {
159+
def version = _version
160+
161+
if (label.contains("docker")) {
162+
def imageName = config["imageName"]
163+
def combinedName = "${imageName}-${version}"
164+
builders[combinedName] = {
165+
node(label) {
166+
stage(combinedName) {
167+
def buildImage = docker.image(imageName)
168+
buildImage.pull()
169+
buildImage.inside("-u root") {
170+
build(version, label, imageName)
171+
}
172+
}
173+
}
174+
}
175+
} else {
176+
def combinedName = "${label}-${version}"
177+
builders[combinedName] = {
178+
node(label) {
179+
stage(combinedName) {
180+
build(version, label, "")
181+
}
182+
}
183+
}
184+
}
185+
}
186+
}
187+
188+
parallel builders

.jenkins/mac-wheel.sh

Lines changed: 0 additions & 72 deletions
This file was deleted.

0 commit comments

Comments
 (0)