Skip to content

Handle multivalued target_family #1320

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion concrete-csprng/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "concrete-csprng"
version = "0.4.0"
version = "0.4.1"
edition = "2021"
license = "BSD-3-Clause-Clear"
description = "Cryptographically Secure PRNG used in the TFHE-rs library."
Expand Down
13 changes: 8 additions & 5 deletions concrete-csprng/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,15 @@ impl FeatureRequirement {
}
}

let target_family = get_target_family_cfg();
let target_families = get_target_family_cfgs();
if let Some(feature_req_target_family) = self.feature_req_target_family {
if feature_req_target_family != target_family {
if target_families
.split(',')
.all(|family| family != feature_req_target_family)
{
panic!(
"Feature `{}` requires target_family `{}`, current cfg: `{}`",
self.feature_name, feature_req_target_family, target_family
"Feature `{}` requires target_family `{}`, current cfgs: `{}`",
self.feature_name, feature_req_target_family, target_families
)
}
}
Expand Down Expand Up @@ -97,7 +100,7 @@ fn get_target_arch_cfg() -> String {
env::var("CARGO_CFG_TARGET_ARCH").expect("CARGO_CFG_TARGET_ARCH is not set")
}

fn get_target_family_cfg() -> String {
fn get_target_family_cfgs() -> String {
env::var("CARGO_CFG_TARGET_FAMILY").expect("CARGO_CFG_TARGET_FAMILY is not set")
}

Expand Down
2 changes: 1 addition & 1 deletion tfhe/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ tfhe-backward-compat-data = { git = "https://github.com/zama-ai/tfhe-backward-co
cbindgen = { version = "0.26.0", optional = true }

[dependencies]
concrete-csprng = { version = "0.4.0", path = "../concrete-csprng", features = [
concrete-csprng = { version = "0.4.1", path = "../concrete-csprng", features = [
"generator_fallback",
"parallel",
] }
Expand Down
Loading