-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Support OpenSSL on Windows #11477
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
straight-shoota
merged 4 commits into
crystal-lang:master
from
HertzDevil:feature/windows-openssl
Nov 23, 2021
Merged
Support OpenSSL on Windows #11477
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,7 +40,13 @@ jobs: | |
id: cache-libs | ||
uses: actions/cache@v2 | ||
with: | ||
path: libs | ||
path: | # openssl and llvm take much longer to build so they are cached separately | ||
libs/pcre.lib | ||
libs/gc.lib | ||
libs/z.lib | ||
libs/mpir.lib | ||
libs/yaml.lib | ||
libs/xml2.lib | ||
key: win-libs-${{ hashFiles('.github/workflows/win.yml') }} | ||
- name: Download libgc | ||
if: steps.cache-libs.outputs.cache-hit != 'true' | ||
|
@@ -138,6 +144,40 @@ jobs: | |
mv libyaml/Release/yaml.lib libs/ | ||
mv libxml2/Release/libxml2s.lib libs/xml2.lib | ||
|
||
- name: Cache OpenSSL | ||
id: cache-openssl | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
libs/crypto.lib | ||
libs/ssl.lib | ||
libs/openssl_VERSION | ||
key: win-openssl-libs-3.0.0 | ||
- name: Set up NASM | ||
if: steps.cache-openssl.outputs.cache-hit != 'true' | ||
uses: ilammy/[email protected] | ||
- name: Download OpenSSL | ||
if: steps.cache-openssl.outputs.cache-hit != 'true' | ||
run: | | ||
iwr https://www.openssl.org/source/openssl-3.0.0.tar.gz -OutFile openssl.tar.gz | ||
(Get-FileHash -Algorithm SHA256 .\openssl.tar.gz).hash -eq "59eedfcb46c25214c9bd37ed6078297b4df01d012267fe9e9eee31f61bc70536" | ||
7z x openssl.tar.gz | ||
7z x openssl.tar | ||
del pax_global_header | ||
mv openssl-* openssl | ||
- name: Build OpenSSL | ||
if: steps.cache-openssl.outputs.cache-hit != 'true' | ||
working-directory: ./openssl | ||
run: | | ||
perl Configure VC-WIN64A /MT -static no-tests --with-zlib-lib=..\zlib\Release --with-zlib-include=..\zlib | ||
nmake | ||
- name: Gather OpenSSL | ||
if: steps.cache-openssl.outputs.cache-hit != 'true' | ||
run: | | ||
cp openssl/libcrypto.lib libs/crypto.lib | ||
cp openssl/libssl.lib libs/ssl.lib | ||
[IO.File]::WriteAllLines("libs/openssl_VERSION", "3.0.0") | ||
|
||
- name: Cache LLVM | ||
id: cache-llvm | ||
uses: actions/cache@v2 | ||
|
@@ -172,6 +212,7 @@ jobs: | |
- name: Set up environment | ||
run: | | ||
echo "CRYSTAL_PATH=$(pwd)\src" >> ${env:GITHUB_ENV} | ||
echo "CRYSTAL_LIBRARY_PATH=$(pwd)\libs" >> ${env:GITHUB_ENV} | ||
echo "LIB=${env:LIB};$(pwd)\libs" >> ${env:GITHUB_ENV} | ||
echo "TERM=dumb" >> ${env:GITHUB_ENV} | ||
echo "LLVM_CONFIG=$(pwd)\llvm\bin\llvm-config.exe" >> ${env:GITHUB_ENV} | ||
|
@@ -206,7 +247,7 @@ jobs: | |
|
||
- name: Build stdlib specs executable | ||
run: | | ||
bin\crystal.exe build spec/std_spec.cr --exclude-warnings spec/std --exclude-warnings spec/compiler -Dwithout_openssl -Di_know_what_im_doing | ||
bin\crystal.exe build spec/std_spec.cr --exclude-warnings spec/std --exclude-warnings spec/compiler -Di_know_what_im_doing | ||
- name: Run socket specs | ||
run: | | ||
.\std_spec.exe --verbose -e TCPSocket | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.