Skip to content

Commit

Permalink
fix: install openssl@3 when building wws in actions (#164)
Browse files Browse the repository at this point in the history
* fix: install openssl@3 when building wws in actions

* fix: install pkg-config-wrapper to avoid issues with cross-compilation

* fix: try to install openssl arm64 on macOS

* fix: typo error in the macos version

* fix: force install openssl@3 arm64 and set the environment variable

* fix: point openssl crate to use the right location for libs and headerS

* fix: move OpenSSL vendored to a feature we can toggle. Enabled it for macOS on GitHub actions

* fix: disable cross for macOS aarch64 as it's not required

* fix: make openssl optional as it's not required for all platforms

* fix: remove artifacts build condition that I added for testing
  • Loading branch information
Angelmmiguel committed Jun 30, 2023
1 parent 707c952 commit 1c0599e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,36 +18,42 @@ jobs:
platform: unknown-linux-musl
cross: false
name: linux-musl
features: --features vendored-openssl
- build: linux
arch: aarch64
os: ubuntu-latest
platform: unknown-linux-musl
cross: true
name: linux-musl
features: --features vendored-openssl
- build: windows
arch: x86_64
os: windows-latest
platform: pc-windows-msvc
cross: false
name: pc-windows
features:
- build: windows
arch: aarch64
os: windows-latest
platform: pc-windows-msvc
cross: false
name: pc-windows
features:
- build: macos
arch: x86_64
os: macos-latest
platform: apple-darwin
cross: false
name: macos-darwin
features:
- build: macos
arch: aarch64
os: macos-latest
platform: apple-darwin
cross: false
name: macos-darwin
features: --features vendored-openssl
runs-on: ${{ matrix.os }}
env:
# This variable can be overriden with `cross` for builds that
Expand All @@ -63,13 +69,13 @@ jobs:
- name: Install target
if: matrix.cross == false
run: rustup target add ${{ matrix.arch }}-${{ matrix.platform }}
- name: Install deps
- name: Install deps (Linux)
if: ${{ matrix.build == 'linux' }}
run: |
sudo apt-get update
sudo apt-get install musl-tools
- name: Build
run: ${{env.CARGO}} build --verbose --release --target=${{ matrix.arch }}-${{ matrix.platform }}
run: ${{env.CARGO}} build --verbose --release --target=${{ matrix.arch }}-${{ matrix.platform }} ${{ matrix.features }}
- name: Tarball
shell: bash
run: |
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,8 @@ wws-project = { workspace = true }
[dev-dependencies]
reqwest = { version = "0.11", features = ["blocking"] }

[target.x86_64-unknown-linux-musl.dependencies]
openssl = { version = "=0.10.55", features = ["vendored"] }

[target.aarch64-unknown-linux-musl.dependencies]
openssl = { version = "=0.10.55", features = ["vendored"] }
[features]
vendored-openssl = ["wws-project/vendored-openssl"]

[workspace]
members = [
Expand Down Expand Up @@ -89,3 +86,4 @@ wasmtime = "10.0.1"
wasmtime-wasi = "10.0.1"
wasi-common = "10.0.1"
path-slash = "0.2.1"
openssl = { version = "=0.10.55" }
5 changes: 5 additions & 0 deletions crates/project/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ url = "2.3.1"
sha256 = "1.1.1"
reqwest = "0.11"
git2 = "0.17.2"
# Not all platforms require OpenSSL
openssl = { workspace = true, optional = true }

[features]
vendored-openssl = ["openssl/vendored"]

[dev-dependencies]
path-slash = { workspace = true }

0 comments on commit 1c0599e

Please sign in to comment.