Skip to content

Commit 7389a25

Browse files
committed
remove reliance on openSSL
This project's production code never does `git clone`, so we really shouldn't need the `https` feature of the `git2` crate enabled.
1 parent 73c9c27 commit 7389a25

9 files changed

Lines changed: 373 additions & 207 deletions

File tree

.github/workflows/binary-builds.yml

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -42,63 +42,48 @@ jobs:
4242
include:
4343
- target: aarch64-unknown-linux-gnu
4444
os: ubuntu-latest
45-
vendored: true
4645
cross: true
4746
- target: aarch64-unknown-linux-musl
4847
os: ubuntu-latest
49-
vendored: true
5048
cross: true
5149
- target: x86_64-unknown-linux-gnu
5250
os: ubuntu-latest
53-
vendored: false
5451
cross: false
5552
- target: x86_64-unknown-linux-musl
5653
os: ubuntu-latest
57-
vendored: true
5854
cross: true
5955
- target: arm-unknown-linux-gnueabi
6056
os: ubuntu-latest
61-
vendored: true
6257
cross: true
6358
- target: arm-unknown-linux-gnueabihf
6459
os: ubuntu-latest
65-
vendored: true
6660
cross: true
6761
- target: armv7-unknown-linux-gnueabihf
6862
os: ubuntu-latest
69-
vendored: true
7063
cross: true
7164
- target: powerpc-unknown-linux-gnu
7265
os: ubuntu-latest
73-
vendored: true
7466
cross: true
75-
# - target: powerpc64-unknown-linux-gnu
76-
# os: ubuntu-latest
77-
# vendored: true
78-
# cross: true
67+
- target: powerpc64-unknown-linux-gnu
68+
os: ubuntu-latest
69+
cross: true
7970
- target: powerpc64le-unknown-linux-gnu
8071
os: ubuntu-latest
81-
vendored: true
8272
cross: true
8373
- target: s390x-unknown-linux-gnu
8474
os: ubuntu-latest
85-
vendored: true
8675
cross: true
8776
- target: aarch64-apple-darwin
8877
os: macos-latest
89-
vendored: true
9078
cross: false
9179
- target: x86_64-apple-darwin
9280
os: macos-latest
93-
vendored: true
9481
cross: false
9582
- target: x86_64-pc-windows-msvc
9683
os: windows-latest
97-
vendored: false
9884
cross: false
9985
- target: aarch64-pc-windows-msvc
10086
os: windows-latest
101-
vendored: false
10287
cross: false
10388
runs-on: ${{ matrix.os }}
10489
permissions:
@@ -136,7 +121,7 @@ jobs:
136121
--bin clang-tools
137122
--release
138123
--target ${{ matrix.target }}
139-
--features ${{ matrix.vendored && 'bin,openssl-vendored' || 'bin' }}
124+
--features bin
140125
141126
- name: Prepare artifacts (unix)
142127
if: runner.os != 'Windows'

.github/workflows/node-js-packaging.yml

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
settings:
4646
- host: macos-latest
4747
target: x86_64-apple-darwin
48-
build: yarn build --target x86_64-apple-darwin --features openssl-vendored
48+
build: yarn build --target x86_64-apple-darwin
4949
- host: windows-latest
5050
build: yarn build --target x86_64-pc-windows-msvc
5151
target: x86_64-pc-windows-msvc
@@ -54,22 +54,22 @@ jobs:
5454
target: i686-pc-windows-msvc
5555
- host: ubuntu-latest
5656
target: x86_64-unknown-linux-gnu
57-
build: yarn build --target x86_64-unknown-linux-gnu --use-cross --features openssl-vendored
57+
build: yarn build --target x86_64-unknown-linux-gnu --use-cross
5858
- host: ubuntu-latest
5959
target: x86_64-unknown-linux-musl
60-
build: yarn build --target x86_64-unknown-linux-musl -x --features openssl-vendored
60+
build: yarn build --target x86_64-unknown-linux-musl -x
6161
- host: macos-latest
6262
target: aarch64-apple-darwin
63-
build: yarn build --target aarch64-apple-darwin --features openssl-vendored
63+
build: yarn build --target aarch64-apple-darwin
6464
- host: ubuntu-latest
6565
target: aarch64-unknown-linux-gnu
66-
build: yarn build --target aarch64-unknown-linux-gnu --use-cross --features openssl-vendored
66+
build: yarn build --target aarch64-unknown-linux-gnu --use-cross
6767
- host: ubuntu-latest
6868
target: armv7-unknown-linux-gnueabihf
69-
build: yarn build --target armv7-unknown-linux-gnueabihf --use-cross --features openssl-vendored
69+
build: yarn build --target armv7-unknown-linux-gnueabihf --use-cross
7070
- host: ubuntu-latest
7171
target: aarch64-unknown-linux-musl
72-
build: yarn build --target aarch64-unknown-linux-musl -x --features openssl-vendored
72+
build: yarn build --target aarch64-unknown-linux-musl -x
7373
- host: windows-latest
7474
target: aarch64-pc-windows-msvc
7575
build: yarn build --target aarch64-pc-windows-msvc
@@ -100,20 +100,20 @@ jobs:
100100
target/
101101
key: ${{ matrix.settings.target }}-cargo-${{ matrix.settings.host }}
102102
- uses: mlugg/setup-zig@d1434d08867e3ee9daa34448df10607b98908d29 # v2.2.1
103-
if: ${{ contains(matrix.settings.build, ' -x ') }}
103+
if: ${{ endsWith(matrix.settings.build, ' -x') }}
104104
with:
105105
version: 0.14.1
106106
use-cache: true # zizmor: ignore[cache-poisoning]
107107
- name: Install cargo-binstall
108-
if: contains(matrix.settings.build, ' -x ') || contains(matrix.settings.build, '--use-cross ')
108+
if: endsWith(matrix.settings.build, ' -x') || endsWith(matrix.settings.build, '--use-cross')
109109
uses: cargo-bins/cargo-binstall@aaa84a43aec4955a42c5ffc65d258961e39f276e # v1.19.1
110110
env:
111111
GITHUB_TOKEN: ${{ github.token }}
112-
- name: Install ${{contains(matrix.settings.build, ' -x ') && 'cargo-zigbuild' || 'cargo-cross'}}
113-
if: contains(matrix.settings.build, ' -x ') || contains(matrix.settings.build, '--use-cross ')
112+
- name: Install ${{endsWith(matrix.settings.build, ' -x') && 'cargo-zigbuild' || 'cargo-cross'}}
113+
if: endsWith(matrix.settings.build, ' -x') || endsWith(matrix.settings.build, '--use-cross')
114114
env:
115115
GITHUB_TOKEN: ${{ github.token }}
116-
tool: ${{contains(matrix.settings.build, ' -x ') && 'cargo-zigbuild' || 'cross'}}
116+
tool: ${{endsWith(matrix.settings.build, ' -x') && 'cargo-zigbuild' || 'cross'}}
117117
run: cargo binstall -y $tool
118118
- name: Setup toolchain
119119
run: ${{ matrix.settings.setup }}
@@ -139,8 +139,7 @@ jobs:
139139
- uses: actions/checkout@v6
140140
with:
141141
persist-credentials: false
142-
- name: Build
143-
id: build
142+
- name: setup FreeBSD VM
144143
uses: cross-platform-actions/action@0c165ad7eb2d6a7e8552d6af5aad2bbedfc646b0 # v1.1.0
145144
env:
146145
DEBUG: napi:*
@@ -151,29 +150,30 @@ jobs:
151150
memory: 8G
152151
cpu_count: 3
153152
environment_variables: DEBUG RUSTUP_IO_THREADS
154-
shell: bash
155-
run: |
156-
sudo pkg install -y -f curl node libnghttp2 npm cmake
157-
sudo npm install -g yarn --ignore-scripts
158-
curl https://sh.rustup.rs -sSf --output rustup.sh
159-
sh rustup.sh -y --profile minimal --default-toolchain stable
160-
source "$HOME/.cargo/env"
161-
echo "~~~~ rustc --version ~~~~"
162-
rustc --version
163-
echo "~~~~ node -v ~~~~"
164-
node -v
165-
echo "~~~~ yarn --version ~~~~"
166-
yarn --version
167-
pwd
168-
ls -lah
169-
whoami
170-
env
171-
freebsd-version
172-
yarn install
173-
yarn build
174-
rm -rf node_modules
175-
rm -rf target
176-
rm -rf .yarn/cache
153+
- name: Build
154+
shell: cpa.sh {0}
155+
run: |-
156+
sudo pkg install -y -f curl node libnghttp2 npm cmake
157+
sudo npm install -g yarn --ignore-scripts
158+
curl https://sh.rustup.rs -sSf --output rustup.sh
159+
sh rustup.sh -y --profile minimal --default-toolchain stable
160+
. "$HOME/.cargo/env"
161+
echo "~~~~ rustc --version ~~~~"
162+
rustc --version
163+
echo "~~~~ node -v ~~~~"
164+
node -v
165+
echo "~~~~ yarn --version ~~~~"
166+
yarn --version
167+
pwd
168+
ls -lah
169+
whoami
170+
env
171+
freebsd-version
172+
yarn install
173+
yarn build
174+
rm -rf node_modules
175+
rm -rf target
176+
rm -rf .yarn/cache
177177
- name: Upload artifact
178178
uses: actions/upload-artifact@v7
179179
with:

.github/workflows/python-packaging.yml

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -72,34 +72,33 @@ jobs:
7272
with:
7373
python-version: '3.x'
7474

75-
- name: Calculate openssl-vendored
76-
shell: bash
77-
id: is-openssl-vendored
78-
run: |
79-
if [[ "${{ startsWith(matrix.platform.target, 'x86') }}" == "true" ]]; then
80-
echo "enabled=" >> $GITHUB_OUTPUT
81-
else
82-
echo "enabled=--features openssl-vendored" >> $GITHUB_OUTPUT
83-
fi
84-
8575
- name: Build wheels
8676
uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
8777
with:
8878
target: ${{ matrix.platform.target }}
89-
args: --release --out dist --find-interpreter ${{ steps.is-openssl-vendored.outputs.enabled }}
90-
# sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} # zizmor: ignore[cache-poisoning]
79+
# Use the zig toolchain for all targets except ppc64le.
80+
# Note, this is meant to avoid build errors in aws-lc-sys crate, which compiles C code.
81+
args: >-
82+
--release --out dist --find-interpreter
83+
${{ matrix.platform.target != 'ppc64le' && '--zig' || ''}}
84+
# avoid cache-poisoning potential for actually distributed builds
85+
sccache: ${{ startsWith(github.ref, 'refs/tags') && 'false' || 'true' }}
9186
manylinux: auto
87+
# here we either install the ppc64le compiler/toolchain or install zig on all others
9288
before-script-linux: |
9389
case "${{ matrix.platform.target }}" in
94-
"aarch64" | "armv7" | "s390x" | "ppc64le")
95-
# NOTE: pypa/manylinux docker images are Debian based
96-
sudo apt-get update
97-
sudo apt-get install -y pkg-config libssl-dev
90+
ppc64le)
91+
apt-get update
92+
apt-get install -y \
93+
pkg-config \
94+
gcc-powerpc64le-linux-gnu \
95+
g++-powerpc64le-linux-gnu \
96+
binutils-powerpc64le-linux-gnu \
97+
libc6-dev-ppc64el-cross
9898
;;
99-
"x86" | "x86_64")
100-
# NOTE: rust-cross/manylinux docker images are CentOS based
101-
yum update -y
102-
yum install -y openssl openssl-devel
99+
*)
100+
# spell-checker: disable-next-line
101+
pip install ziglang
103102
;;
104103
esac
105104
- name: Upload wheels
@@ -158,7 +157,7 @@ jobs:
158157
uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
159158
with:
160159
target: ${{ matrix.platform.target }}
161-
args: --release --out dist --find-interpreter --features openssl-vendored
160+
args: --release --out dist --find-interpreter
162161
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} # zizmor: ignore[cache-poisoning]
163162
- name: Upload wheels
164163
uses: actions/upload-artifact@v7

0 commit comments

Comments
 (0)