fuzzball-muck / fuzzball

Ongoing development of the Fuzzball MUCK server software and associated functionality.
Other
47 stars 27 forks source link

ci: [win] Fix OpenSSL build, cleanup Conan, AppVeyor #660

Closed digitalcircuit closed 3 years ago

digitalcircuit commented 3 years ago

In short

Commits are intentionally split up for easier reference in the future. However, if preferred, they can still be squashed.

Criteria Rank Reason
Impact ★★☆ 2/3 Fixes Windows AppVeyor builds, upgrades OpenSSL
Risk ★★☆ 2/3 Switches Windows to OpenSSL 1.1.x, uses space in AppVeyor build cache
Intrusiveness ★☆☆ 1/3 Windows Makefile and CI, shouldn't interfere with other pull requests

Details

OpenSSL upgrade 1.0.x1.1.x

This is a significant upgrade to OpenSSL which includes changes to the Windows build process. Conan's OpenSSL package renamed ssleay32.lib into libssl.lib and libeay32.lib into libcrypto.lib. This PR updates makefile.win in a backwards-compatible way, using the newer file names if available, otherwise using the older paths.

The newer OpenSSL version might also impact Fuzzball's usage. Basic testing showed the TLS port as still working, but more thorough testing could be done.

Conan also renamed OpenSSL to openssl, which needed fixing in conanfile.txt.

Python 2 → Python 3

Python 2 technically still works, but is no longer supported. Unfortunately, it's a bit more difficult to access Python 3 on AppVeyor, so the Python 3 Scripts folder is determined at runtime and added to PATH.

Examples

Improved build failure handling

Before, the build error might be buried in the log file. Now, it shows up right after the build process.

Microsoft (R) Program Maintenance Utility Version 14.29.30133.0
Copyright (C) Microsoft Corporation.  All rights reserved.

[makefile.win] OpenSSL directory OPENSSLDIR not specified, assuming default
[makefile.win] Selected OpenSSL path: C:\projects\fuzzball/bin\lib\vc
[makefile.win] Using OpenSSL library names libcrypto.lib and libssl.lib
C:\projects\fuzzball/makefile.win(65) : fatal error U1050: TESTING BUILD PROCESS
Stop.
Build command exit code not zero: 2
Could not compile Fuzzball, build failed

Tested by inserting !ERROR TESTING BUILD PROCESS into makefile.win after the OpenSSL path logic.

AppVeyor Conan package caching

Once merged and built, the AppVeyor build cache should persist the OpenSSL build, resulting in faster future builds.

[...]
Restoring build cache
Cache 'C:\Users\Appveyor\.conan' - Restored
Running Install scripts

[...]

Version ranges solved
    Version range '~=1.1.1l' required by 'conanfile.txt' resolved to 'openssl/1.1.1l' in local cache
conanfile.txt: Installing package
Requirements
    openssl/1.1.1l from 'conancenter' - Cache
Packages
    openssl/1.1.1l:7b67ea8a8298b2c22e3896c8cb83cc30002fb75b - Cache
Cross-build from 'Windows:x86_64' to 'Windows:x86'
Installing (downloading, building) binaries...
openssl/1.1.1l: Already installed!
conanfile.txt: Generator txt created conanbuildinfo.txt
conanfile.txt: Aggregating env generators
conanfile.txt: Generated conaninfo.txt
[...]

Screenshots

Fuzzball running on AppVeyor with OpenSSL 1.1.1l, TLSv1.3

Screenshot of Windows 10 on AppVeyor showing Fuzzball running, launched via cmd.exe, with Fuzzball server window open and another cmd.exe window with "openssl s_client -connect 127.0.0.1:5201" showing the TLSv1.3 negotiation

Though not shown in the screenshot, Fuzzball's welcome message shows and commands work. The source code commit hash does not match exactly as I had to push a modified commit to enable AppVeyor RDP login.