Skip to content

Commit

Permalink
[#5576] Build OpenSSL, Python, cryptography on Windows. (#147)
Browse files Browse the repository at this point in the history
* Updated brink stuff.

* Removed support for old Unices.

* Removed Python 2.7.8 sources.

* Not really needing texinfo any more.

* Unbreak Solaris version check on Solaris 10.

* More related comment updates.

* Imported OpenSSL build BATs for VS 2010 from pyca/infra repo.

* Try adapting the pyca/infra BATs for our build.

* Some more adapting from pyca/infra repo.

* Install and test for Visual Studio 2010.

* No need to install windows-sdk-7.1, which fails anyway.

* Minor Windows build fixes.

* Cheat with the OpenSSL build under Windows, for now.

* Build OpenSSL and cryptography on Windows.

* Build on Windows 2016. Improved package checks.

* Build OpenSSL statically on Windows too.

* Apply ActivePython's patches as hot fixes.

* Minor cleanups.

* Updated external deps sheets.

* Changes after own review.

* Updated OpenSSL 1.1.1 sources to 1.1.1k.

* Updated OpenSSL version in our scripts.

* Documented updated OpenSSL version.

* BUILD_CFFI is not needed any more.
  • Loading branch information
dumol authored Mar 31, 2021
1 parent f61b1f6 commit e26e753
Show file tree
Hide file tree
Showing 7,504 changed files with 1,042 additions and 1,686,787 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
15 changes: 10 additions & 5 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ jobs:

# Fix back Homebrew, to make everything functional.
- name: Unhack Homebrew
if: failure() && env.TMATE_DEBUG == 'yes'
run: |
sudo find /usr/local -name 'libintl*' -exec chmod a+r {} +
sudo find /usr/local -name 'libffi*' -exec chmod a+r {} +
Expand Down Expand Up @@ -135,9 +136,14 @@ jobs:
limit-access-to-actor: true


windows-2019:
runs-on: windows-2019
timeout-minutes: 30
windows:
runs-on: ${{ matrix.runs-on }}
strategy:
# Workflow won't be cancelled at the first failed job.
fail-fast: false
matrix:
runs-on: [ windows-2019, windows-2016 ]
timeout-minutes: 45
steps:
- uses: chevah/auto-cancel-redundant-job@v1
- uses: actions/checkout@v2
Expand All @@ -153,8 +159,7 @@ jobs:

# Add packages needed to build our patched pycrypto.
- name: Prepare OS
run: |
chocolatey install --yes --no-progress make vcpython27
run: chocolatey install --yes --no-progress make vcpython27 nasm 7zip

# Explicitly run our scripts with Bash, not PowerShell (GitHub's default).
- name: Download needed deps for the detected OS
Expand Down
2 changes: 1 addition & 1 deletion brink.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
BASE_REQUIREMENTS='pip==20.2.4 chevah-brink==0.78.1 paver==1.2.4'
PYTHON_CONFIGURATION='[email protected].bd461724:[email protected]'
PYTHON_CONFIGURATION='[email protected].f61b1f61'
BINARY_DIST_URI='http://binary.chevah.com/production'
PIP_INDEX='http://pypi.chevah.com/simple'

Expand Down
57 changes: 19 additions & 38 deletions brink.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ PYTHON_CONFIGURATION='NOT-YET-DEFINED'
PYTHON_VERSION='not.defined.yet'
PYTHON_PLATFORM='unknown-os-and-arch'
PYTHON_NAME='python2.7'
BINARY_DIST_URI='https://binary.chevah.com/production'
BINARY_DIST_URI='http://binary.chevah.com/production'
PIP_INDEX='http://pypi.chevah.com'
BASE_REQUIREMENTS=''

Expand Down Expand Up @@ -556,8 +556,8 @@ install_dependencies(){
# Check version of current OS to see if it is supported.
# If it's too old, exit with a nice informative message.
# If it's supported, return through eval the version numbers to be used for
# naming the package, for example: '7' for RHEL 7.7, '2' for Amazon 2,
# '2004' for Ubuntu 20.04', '312' for Alpine Linux 3.12, '11' for Solaris 11.
# naming the package, for example: '8' for RHEL 8.2, '2004' for Ubuntu 20.04,
# '312' for Alpine Linux 3.12, '71' for AIX 7.1, '114' for Solaris 11.4.
#
check_os_version() {
# First parameter should be the human-readable name for the current OS.
Expand Down Expand Up @@ -786,46 +786,31 @@ detect_os() {
;;
SunOS)
ARCH=$(isainfo -n)
os_version_raw=$(uname -r | cut -d'.' -f2)
check_os_version "Solaris" 10 "$os_version_raw" os_version_chevah
OS="sol${os_version_chevah}"
case "$OS" in
sol10)
# Solaris 10u8 (from 10/09) updated libc version, so for
# older releases up to 10u7 (from 5/09) we build on 10u3.
# The "sol10u3" code path also shows the way to link to
# OpenSSL 0.9.7 libs bundled in /usr/sfw/ with Solaris 10.
# Update number is taken from first line of /etc/release.
un=$(head -1 /etc/release | cut -d_ -f2 | sed s/[^0-9]*//g)
if [ "$un" -lt 8 ]; then
OS="sol10u3"
fi
ver_major=$(uname -r | cut -d'.' -f2)
case $ver_major in
10)
ver_minor=$(\
head -1 /etc/release | cut -d_ -f2 | sed s/[^0-9]*//g)
;;
sol11)
# Solaris 11 releases prior to 11.4 bundled OpenSSL libs
# missing support for Elliptic-curve crypto. From here on:
# * Solaris 11.4 (or newer) with OpenSSL 1.0.2 is "sol11",
# * Solaris 11.2/11.3 with OpenSSL 1.0.1 is "sol112",
# * Solaris 11.0/11.1 with OpenSSL 1.0.0 is not supported.
minor_version=$(uname -v | cut -d'.' -f2)
if [ "$minor_version" -lt 4 ]; then
OS="sol112"
fi
11)
ver_minor=$(head -1 /etc/release | awk '{print $3}')
;;
*)
# Not sure if $ver_minor detection works on other versions.
(>&2 echo "Unsupported Solaris version: ${ver_major}.")
exit 15
;;
esac
os_version_raw="${ver_major}.${ver_minor}"
check_os_version "Solaris" 11.4 "$os_version_raw" os_version_chevah
OS="sol${os_version_chevah}"
;;
AIX)
ARCH="ppc$(getconf HARDWARE_BITMODE)"
os_version_raw=$(oslevel)
check_os_version AIX 5.3 "$os_version_raw" os_version_chevah
check_os_version AIX 7.1 "$os_version_raw" os_version_chevah
OS="aix${os_version_chevah}"
;;
HP-UX)
ARCH=$(uname -m)
os_version_raw=$(uname -r | cut -d'.' -f2-)
check_os_version HP-UX 11.31 "$os_version_raw" os_version_chevah
OS="hpux${os_version_chevah}"
;;
*)
(>&2 echo "Unsupported operating system: ${OS}.")
exit 14
Expand All @@ -840,10 +825,6 @@ detect_os() {
"amd64"|"x86_64")
ARCH="x64"
case "$OS" in
sol10*)
# On Solaris 10, x64 built fine prior to adding "bcrypt".
ARCH="x86"
;;
win)
# 32bit build on Windows 2016, 64bit otherwise.
# Should work with a l10n pack too (tested with French).
Expand Down
Loading

0 comments on commit e26e753

Please sign in to comment.