Skip to content

Commit

Permalink
Remove build.rs.
Browse files Browse the repository at this point in the history
This was more useful at the time when we were determining, e.g., optimal lookup
table sizes and could regenerate them more easily, but it came at a massive
complexity cost.  It also meant that we were unable to implement backend
autoselection.  This commit removes the `build.rs` entirely.  In the future, a
different `build.rs` could be added that auto-selects a backend, but it seems
like the current default-u64 setup has been working fine.
  • Loading branch information
hdevalence committed Oct 23, 2019
1 parent 8602ec0 commit 5742176
Show file tree
Hide file tree
Showing 13 changed files with 12,306 additions and 291 deletions.
27 changes: 2 additions & 25 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ exclude = [
".gitignore",
".travis.yml",
]
build = "build.rs"

[package.metadata.docs.rs]
# Disabled for now since this is borked; tracking https://github.com/rust-lang/docs.rs/issues/302
Expand All @@ -37,12 +36,6 @@ rand = "0.6"
name = "dalek_benchmarks"
harness = false

# Note: we generate precomputed tables by building the crate twice: once as
# part of build.rs, and then once "for real".
#
# This means that the [dependencies] and [build-dependencies] sections must
# match exactly, since the build.rs uses the crate itself as a library.

[dependencies]
rand_core = { version = "0.3.0", default-features = false }
byteorder = { version = "^1.2.3", default-features = false, features = ["i128"] }
Expand All @@ -52,34 +45,18 @@ subtle = { version = "2", default-features = false }
serde = { version = "1.0", default-features = false, optional = true }
packed_simd = { version = "0.3.0", features = ["into_bits"], optional = true }

[build-dependencies]
rand_core = { version = "0.3.0", default-features = false }
byteorder = { version = "^1.2.3", default-features = false, features = ["i128"] }
digest = { version = "0.8", default-features = false }
clear_on_drop = "=0.2.3"
subtle = { version = "2", default-features = false }
serde = { version = "1.0", default-features = false, optional = true }
packed_simd = { version = "0.3.0", features = ["into_bits"], optional = true }

[features]
nightly = ["subtle/nightly", "clear_on_drop/nightly"]
default = ["std", "u64_backend"]
std = ["alloc", "subtle/std", "rand_core/std"]
alloc = []
yolocrypto = []

# The u32 backend uses u32s with u64 products.
u32_backend = []
# The u64 backend uses u64s with u128 products.
u64_backend = []
# The SIMD backend uses parallel formulas, using either AVX2 or AVX512-IFMA.
simd_backend = ["nightly", "u64_backend", "packed_simd"]
# Old name for the SIMD backend, preserved for compatibility
# DEPRECATED: this is now an alias for `simd_backend` and may be removed
# in some future release.
avx2_backend = ["simd_backend"]

# Signals that we're in the main build stage. This is off by default,
# to signal stage 1 of the build, where build.rs loads the library
# into the build script. Then, the build.rs emits the stage2_build
# feature before the main-stage compilation.
stage2_build = []

131 changes: 0 additions & 131 deletions build.rs

This file was deleted.

1 change: 0 additions & 1 deletion src/backend/serial/scalar_mul/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
pub mod variable_base;

#[cfg(feature = "stage2_build")]
pub mod vartime_double_base;

#[cfg(feature = "alloc")]
Expand Down
Loading

0 comments on commit 5742176

Please sign in to comment.