Skip to content

Commit a1f8f6e

Browse files
authored
Merge pull request #147 from timvw/feat/openssl-binaries-check
Gate vendored OpenSSL per target and add binaries PR check
2 parents e24b6e9 + e41b54b commit a1f8f6e

6 files changed

Lines changed: 120 additions & 19 deletions

File tree

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: "Binaries (PR check)"
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
env:
10+
CARGO_INCREMENTAL: 0
11+
CARGO_NET_GIT_FETCH_WITH_CLI: true
12+
CARGO_NET_RETRY: 10
13+
CARGO_TERM_COLOR: always
14+
PKG_CONFIG_ALLOW_CROSS: 1
15+
RUST_BACKTRACE: 1
16+
RUSTFLAGS: -D warnings
17+
RUSTUP_MAX_RETRIES: 10
18+
19+
defaults:
20+
run:
21+
shell: bash
22+
23+
jobs:
24+
build:
25+
name: ${{ matrix.target }}
26+
runs-on: ${{ matrix.os }}
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
include:
31+
- target: aarch64-unknown-linux-gnu
32+
os: ubuntu-24.04
33+
use_cross: true
34+
features: vendored-openssl
35+
- target: aarch64-unknown-linux-musl
36+
os: ubuntu-24.04
37+
use_cross: true
38+
features: vendored-openssl
39+
- target: aarch64-apple-darwin
40+
os: macos-15
41+
use_cross: false
42+
features: vendored-openssl
43+
- target: aarch64-pc-windows-msvc
44+
os: windows-2022
45+
use_cross: false
46+
features: ""
47+
- target: x86_64-unknown-linux-gnu
48+
os: ubuntu-24.04
49+
use_cross: true
50+
features: vendored-openssl
51+
- target: x86_64-unknown-linux-musl
52+
os: ubuntu-24.04
53+
use_cross: true
54+
features: vendored-openssl
55+
- target: x86_64-apple-darwin
56+
os: macos-15
57+
use_cross: false
58+
features: vendored-openssl
59+
- target: x86_64-pc-windows-msvc
60+
os: windows-2022
61+
use_cross: false
62+
features: ""
63+
timeout-minutes: 60
64+
steps:
65+
- name: Checkout repository
66+
uses: actions/checkout@v6
67+
- name: Install Linux build deps
68+
if: startsWith(matrix.os, 'ubuntu')
69+
run: |
70+
sudo apt-get update
71+
sudo apt-get install -y pkg-config libssl-dev ca-certificates
72+
- name: Install Rust toolchain
73+
uses: dtolnay/rust-toolchain@stable
74+
with:
75+
targets: ${{ matrix.target }}
76+
- name: Install cross
77+
if: matrix.use_cross == true
78+
uses: taiki-e/install-action@v2
79+
with:
80+
tool: cross
81+
- run: echo "RUSTFLAGS=${RUSTFLAGS} -C target-feature=+crt-static" >> "${GITHUB_ENV}"
82+
if: endsWith(matrix.target, 'windows-msvc')
83+
- name: Build target
84+
run: |
85+
set -euo pipefail
86+
if [[ "${{ matrix.use_cross }}" == "true" ]]; then
87+
cross build --release --target "${{ matrix.target }}" ${EXTRA_FEATURES}
88+
else
89+
cargo build --release --target "${{ matrix.target }}" ${EXTRA_FEATURES}
90+
fi
91+
env:
92+
EXTRA_FEATURES: ${{ matrix.features && format('--features {0}', matrix.features) || '' }}

.github/workflows/binaries.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,27 +48,35 @@ jobs:
4848
- target: aarch64-unknown-linux-gnu
4949
os: ubuntu-24.04
5050
use_cross: true
51+
features: vendored-openssl
5152
- target: aarch64-unknown-linux-musl
5253
os: ubuntu-24.04
5354
use_cross: true
55+
features: vendored-openssl
5456
- target: aarch64-apple-darwin
5557
os: macos-15
5658
use_cross: false
59+
features: vendored-openssl
5760
- target: aarch64-pc-windows-msvc
5861
os: windows-2022
5962
use_cross: false
63+
features: ""
6064
- target: x86_64-unknown-linux-gnu
6165
os: ubuntu-24.04
6266
use_cross: true
67+
features: vendored-openssl
6368
- target: x86_64-unknown-linux-musl
6469
os: ubuntu-24.04
6570
use_cross: true
71+
features: vendored-openssl
6672
- target: x86_64-apple-darwin
6773
os: macos-15
6874
use_cross: false
75+
features: vendored-openssl
6976
- target: x86_64-pc-windows-msvc
7077
os: windows-2022
7178
use_cross: false
79+
features: ""
7280
timeout-minutes: 60
7381
steps:
7482
- name: Checkout repository
@@ -80,15 +88,13 @@ jobs:
8088
sudo apt-get install -y pkg-config libssl-dev ca-certificates
8189
- name: Install Rust toolchain
8290
uses: dtolnay/rust-toolchain@stable
91+
with:
92+
targets: ${{ matrix.target }}
8393
- name: Install cross
8494
if: matrix.use_cross == true
8595
uses: taiki-e/install-action@v2
8696
with:
8797
tool: cross
88-
- name: Prefer Strawberry Perl on Windows
89-
if: startsWith(matrix.os, 'windows')
90-
shell: pwsh
91-
run: echo "PERL=C:/Strawberry/perl/bin/perl" >> $env:GITHUB_ENV
9298
- run: echo "RUSTFLAGS=${RUSTFLAGS} -C target-feature=+crt-static" >> "${GITHUB_ENV}"
9399
if: endsWith(matrix.target, 'windows-msvc')
94100
- uses: taiki-e/upload-rust-binary-action@v1
@@ -97,4 +103,5 @@ jobs:
97103
target: ${{ matrix.target }}
98104
tar: all
99105
zip: windows
106+
features: ${{ matrix.features }}
100107
token: ${{ secrets.GITHUB_TOKEN }}

Cargo.toml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ deltalake = { git = "https://github.com/delta-io/delta-rs.git", rev = "rust-v0.2
3131
futures = "0.3"
3232
glob = "0.3"
3333
object_store = { version = "0.11", features = ["aws", "gcp"] }
34-
openssl = { version = "0.10", features = ["vendored"] }
34+
openssl = { version = "0.10", optional = true }
3535
regex = "1.10"
3636
tokio = { version = "1", features = ["macros", "rt", "rt-multi-thread", "sync", "parking_lot"] }
3737
url = "2.5"
@@ -52,3 +52,9 @@ delta_kernel_derive = { git = "https://github.com/delta-io/delta-kernel-rs.git",
5252
[dev-dependencies]
5353
assert_cmd = "2.0.14"
5454
predicates = "3.1"
55+
56+
[features]
57+
default = []
58+
# Enable OpenSSL when needed; use vendored builds for fully static artifacts.
59+
openssl-tls = ["dep:openssl"]
60+
vendored-openssl = ["openssl-tls", "openssl/vendored"]

src/main.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![allow(clippy::result_large_err)]
2+
13
use std::collections::HashMap;
24
use std::env;
35
use std::sync::Arc;

tests/files_on_localfs.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
1-
use assert_cmd::cargo::CargoError;
1+
#![allow(clippy::result_large_err)]
2+
3+
use assert_cmd::cargo;
24
use assert_cmd::prelude::*;
3-
use datafusion::common::DataFusionError;
45
use predicates::prelude::*;
56
use predicates::str::RegexPredicate;
67
use std::env;
78
use std::process::Command;
89

9-
fn map_cargo_to_datafusion_error(e: CargoError) -> DataFusionError {
10-
DataFusionError::External(Box::new(e))
11-
}
12-
1310
fn get_qv_cmd() -> datafusion::common::Result<Command> {
14-
Command::cargo_bin(env!("CARGO_PKG_NAME")).map_err(map_cargo_to_datafusion_error)
11+
Ok(Command::new(cargo::cargo_bin!(env!("CARGO_PKG_NAME"))))
1512
}
1613

1714
fn get_qv_testing_path(rel_data_path: &str) -> String {

tests/files_on_s3.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
use assert_cmd::cargo::CargoError;
1+
#![allow(clippy::result_large_err)]
2+
3+
use assert_cmd::cargo;
24
use assert_cmd::prelude::*;
3-
use datafusion::common::DataFusionError;
45
use predicates::prelude::*;
56
use predicates::str::RegexPredicate;
67
use std::env;
@@ -18,12 +19,8 @@ fn configure_minio() {
1819
env::set_var("AWS_ALLOW_HTTP", "true");
1920
}
2021

21-
fn map_cargo_to_datafusion_error(e: CargoError) -> DataFusionError {
22-
DataFusionError::External(Box::new(e))
23-
}
24-
2522
fn get_qv_cmd() -> datafusion::common::Result<Command> {
26-
Command::cargo_bin(env!("CARGO_PKG_NAME")).map_err(map_cargo_to_datafusion_error)
23+
Ok(Command::new(cargo::cargo_bin!(env!("CARGO_PKG_NAME"))))
2724
}
2825

2926
fn build_row_regex_predicate(columns: Vec<&str>) -> RegexPredicate {

0 commit comments

Comments
 (0)