Skip to content

Commit

Permalink
chore(core): add "vendored" feature flag to eppo_core (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
rasendubi authored Oct 16, 2024
1 parent b114013 commit c1117b8
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 26 deletions.
20 changes: 19 additions & 1 deletion eppo_core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "eppo_core"
version = "4.0.0"
version = "4.1.0"
edition = "2021"
description = "Eppo SDK core library"
repository = "https://github.com/Eppo-exp/rust-sdk"
Expand All @@ -12,6 +12,11 @@ rust-version = "1.71.1"
[features]
# Add implementation of `FromPyObject`/`ToPyObject` for some types.
pyo3 = ["dep:pyo3", "dep:serde-pyobject"]
# Vendor any external libraries that we need (OpenSSL on Linux), so we
# don’t depend on shared libraries.
#
# See: https://github.com/PyO3/maturin-action/discussions/78
vendored = ["reqwest/native-tls-vendored"]

[dependencies]
chrono = { version = "0.4.38", features = ["serde"] }
Expand All @@ -32,6 +37,19 @@ url = "2.5.0"
pyo3 = { version = "0.22.0", optional = true, default-features = false }
serde-pyobject = { version = "0.4.0", optional = true}

# vendored dependencies
[target.'cfg(all(target_os = "linux", target_arch = "s390x"))'.dependencies]
# OpenSSL 3.3+ includes a patch[1] for s390x architecture that uses a
# specialized instruction (cijne), which is not recognized by GCC in
# ghcr.io/rust-cross/manylinux2014-cross:s390x, and thus fails to
# compile in CI.
#
# Pin "openssl-src" to 300.2.x, which will install openssl-3.2.x,
# which didn't use cijne.
#
# [1]: https://github.com/openssl/openssl/pull/22221
openssl-src = { version = "~300.2", optional = true }

[dev-dependencies]
criterion = { version = "0.4", features = ["html_reports"] }
env_logger = "0.11.3"
Expand Down
22 changes: 1 addition & 21 deletions python-sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,9 @@ publish = false
crate-type = ["cdylib"]

[dependencies]
eppo_core = { version = "4.0.0", path = "../eppo_core", features = ["pyo3"] }
eppo_core = { version = "4.1.0", path = "../eppo_core", features = ["pyo3", "vendored"] }
log = "0.4.22"
pyo3 = { version = "0.22.0" }
pyo3-log = "0.11.0"
serde-pyobject = "0.4.0"
serde_json = "1.0.125"

[target.'cfg(target_os = "linux")'.dependencies]
# We don't use reqwest directly, so the following overrides it to
# enable feature flag. native-tls-vendored is required to vendor
# OpenSSL on linux builds, so we don't depend on shared libraries.
#
# See: https://github.com/PyO3/maturin-action/discussions/78
reqwest = { version = "*", features = ["native-tls-vendored"] }

[target.'cfg(all(target_os = "linux", target_arch = "s390x"))'.dependencies]
# OpenSSL 3.3+ includes a patch[1] for s390x architecture that uses a
# specialized instruction (cijne), which is not recognized by GCC in
# ghcr.io/rust-cross/manylinux2014-cross:s390x, and thus fails to
# compile in CI.
#
# Pin "openssl-src" to 300.2.x, which will install openssl-3.2.x,
# which didn't use cijne.
#
# [1]: https://github.com/openssl/openssl/pull/22221
openssl-src = "~300.2"
4 changes: 2 additions & 2 deletions ruby-sdk/ext/eppo_client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "eppo_client"
# TODO: this version and lib/eppo_client/version.rb should be in sync
version = "3.2.0"
version = "3.2.1"
edition = "2021"
license = "MIT"
publish = false
Expand All @@ -12,7 +12,7 @@ crate-type = ["cdylib"]

[dependencies]
env_logger = { version = "0.11.3", features = ["unstable-kv"] }
eppo_core = { version = "4.0.0" }
eppo_core = { version = "4.1.0", features = ["vendored"] }
log = { version = "0.4.21", features = ["kv_serde"] }
magnus = { version = "0.6.4" }
serde = { version = "1.0.203", features = ["derive"] }
Expand Down
2 changes: 1 addition & 1 deletion ruby-sdk/lib/eppo_client/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

# TODO: this version and ext/eppo_client/Cargo.toml should be in sync
module EppoClient
VERSION = "3.2.0"
VERSION = "3.2.1"
end
2 changes: 1 addition & 1 deletion rust-sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ categories = ["config"]
rust-version = "1.71.1"

[dependencies]
eppo_core = { version = "4.0.0", path = "../eppo_core" }
eppo_core = { version = "4.1.0", path = "../eppo_core" }
log = { version = "0.4.21", features = ["kv", "kv_serde"] }
serde_json = "1.0.116"

Expand Down

0 comments on commit c1117b8

Please sign in to comment.