Skip to content

Commit

Permalink
chore: use openssl/vendored
Browse files Browse the repository at this point in the history
  • Loading branch information
dfx-json committed Jan 17, 2023
1 parent e101bbc commit 602df98
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 76 deletions.
36 changes: 1 addition & 35 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
rust: [1.60.0]
task: [check, fmt, clippy, test, build]
task: [check, fmt, clippy, test]
steps:
- uses: actions/checkout@master

Expand All @@ -26,40 +26,6 @@ jobs:
env:
VCPKG_ROOT: 'C:\vcpkg'

- name: Install dependencies (macOS only)
if: matrix.os == 'macos-latest' && matrix.task == 'build'
shell: bash
run: |
# below steps taken from https://gist.github.com/byronmansfield/97d74d8b0d1ea28b48536020dbd6d53e
# prepare workspace
mkdir -p ~/openssl-build/ && cd $_
# download source code
curl -LO https://www.openssl.org/source/openssl-1.1.1d.tar.gz
# expand tar
tar -xzvf openssl-1.1.1d.tar.gz
cd openssl-1.1.1d
# configure, make, install
perl ./Configure --prefix=/usr/local --openssldir=/usr/local/openssl no-ssl3 no-ssl3-method no-zlib darwin64-x86_64-cc enable-ec_nistp_64_gcc_128
make
sudo make install MANDIR=/usr/local/openssl/share/man MANSUFFIX=ssl
# verify
openssl version
which -a openssl
- name: Link OpenSSL (macOS only)
if: matrix.os == 'macos-latest' && matrix.task == 'build'
shell: bash
run: |
# see # see https://github.dev/sfackler/rust-openssl/blob/2e986986784f0136d6666a0ef354ff6bafee63eb/openssl/src/lib.rs#L62-L63
echo "::set-env OPENSSL_STATIC '1'"
echo "::set-env OPENSSL_INCLUDE_DIR '/usr/local/include'"
echo "::set-env OPENSSL_LIB_DIR '/usr/local/lib'"
- uses: actions-rs/toolchain@v1
with:
profile: minimal
Expand Down
33 changes: 0 additions & 33 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,39 +50,6 @@ jobs:
env:
VCPKG_ROOT: 'C:\vcpkg'

- name: Install dependencies (macOS only)
if: matrix.name == 'macos'
shell: bash
run: |
# below steps taken from https://gist.github.com/byronmansfield/97d74d8b0d1ea28b48536020dbd6d53e
# prepare workspace
mkdir -p ~/openssl-build/ && cd $_
# download source code
curl -LO https://www.openssl.org/source/openssl-1.1.1d.tar.gz
# expand tar
tar -xzvf openssl-1.1.1d.tar.gz
cd openssl-1.1.1d
# configure, make, install
perl ./Configure --prefix=/usr/local --openssldir=/usr/local/openssl no-ssl3 no-ssl3-method no-zlib darwin64-x86_64-cc enable-ec_nistp_64_gcc_128
make
sudo make install MANDIR=/usr/local/openssl/share/man MANSUFFIX=ssl
# verify
openssl version
which -a openssl
- name: Link OpenSSL (macOS only)
if: matrix.name == 'macos'
run: |
# see https://github.dev/sfackler/rust-openssl/blob/2e986986784f0136d6666a0ef354ff6bafee63eb/openssl/src/lib.rs#L62-L63
echo "::set-env OPENSSL_STATIC '1'"
echo "::set-env OPENSSL_INCLUDE_DIR '/usr/local/include'"
echo "::set-env OPENSSL_LIB_DIR '/usr/local/lib'"
- name: Install toolchain (Linux static)
if: matrix.name == 'linux'
uses: mariodfinity/rust-musl-action@master
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build:
cargo build

release:
cargo build --release --locked
cargo build --release --locked --features openssl/vendored

musl-static:
cargo build --target x86_64-unknown-linux-musl --release --locked
Expand Down
11 changes: 4 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,6 @@ Use pre-built binaries from the latest [release](https://github.com/dfinity/quil

### MacOS (Intel Chip & Apple Silicon)

#### Prerequisite - OpenSSL

You must have `openssl` version 1.1 installed on your mac to use `quill`. One
way to achieve this is to build it from source.
See [Building OpenSSL from Source](#building-openssl-from-source-on-macos) below.

#### Install quill
1. Download the file named `quill-macos-x86_64`
2. Move the file to your `/usr/local/bin` directory to make it available system-wide
Expand All @@ -71,7 +65,7 @@ sudo mv quill-macos-x86_64 /usr/local/bin/quill
3. Make the file executable

```shell
chmod +x /usr/local/bin/quill
chmod +x /usr/local/bin/quill
```

4. Run quill
Expand Down Expand Up @@ -143,6 +137,9 @@ example:
IC_URL=https://nnsdapp.dfinity.network quill --insecure-local-dev-mode --pem-file <path> list-neurons

## Building OpenSSL from Source on macOS
Quill depends on OpenSSL v1.1. When building Quill from source, you can choose to
statically link OpenSSL using the openssl crate's `vendored` flag, or build it from
source. Below are instructions for how to build OpenSSL version 1.1 from source on macOS.

Prepare workspace

Expand Down

0 comments on commit 602df98

Please sign in to comment.