Skip to content

Commit

Permalink
Introduce cargo workspaces
Browse files Browse the repository at this point in the history
  • Loading branch information
christianschleifer committed Aug 5, 2024
1 parent c57c476 commit a849cca
Show file tree
Hide file tree
Showing 70 changed files with 64 additions and 68 deletions.
31 changes: 3 additions & 28 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,48 +46,24 @@ jobs:
with:
command: fetch

- name: Fetch benchmarks
uses: actions-rs/cargo@v1
with:
command: fetch
args: --manifest-path benchmarks/Cargo.toml

- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --all-targets

- name: Build benchmarks
uses: actions-rs/cargo@v1
with:
command: build
args: --manifest-path benchmarks/Cargo.toml --all-targets

- name: Check
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-targets -- -D warnings

- name: Check benchmarks
uses: actions-rs/cargo@v1
with:
command: clippy
args: --manifest-path benchmarks/Cargo.toml --all-targets -- -D warnings

- name: Check formatting
uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check

- name: Check benchmark formatting
uses: actions-rs/cargo@v1
with:
command: fmt
args: --manifest-path benchmarks/Cargo.toml -- --check

- name: Test
uses: actions-rs/cargo@v1
with:
Expand All @@ -103,8 +79,7 @@ jobs:
- name: Test benchmarks
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path benchmarks/Cargo.toml --benches
command: bench

- name: SIMD test
if: matrix.rust == 'nightly'
Expand All @@ -119,5 +94,5 @@ jobs:
uses: actions-rs/cargo@v1
with:
toolchain: nightly
command: test
args: --manifest-path benchmarks/Cargo.toml --features "simd" --benches
command: bench
args: --features "simd"
43 changes: 15 additions & 28 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,35 +1,22 @@
[package]
name = "roaring"
version = "0.10.6"
rust-version = "1.65.0"
authors = ["Wim Looman <wim@nemo157.com>", "Kerollmops <kero@meilisearch.com>"]
description = "A better compressed bitset - pure Rust implementation"
[workspace]
members = ["roaring", "benchmarks"]
resolver = "2"

documentation = "https://docs.rs/roaring"
repository = "https://github.com/RoaringBitmap/roaring-rs"
[workspace.dependencies]
roaring = { path = "roaring" }

readme = "README.md"
keywords = ["roaring", "data-structure", "bitmap"]
categories = ["data-structures"]
edition = "2021"

license = "MIT OR Apache-2.0"

[dependencies]
bytemuck = { version = "1.16.1", optional = true }
byteorder = { version = "1.5.0", optional = true }
serde = { version = "1.0.203", optional = true }

[features]
default = ["std"]
serde = ["dep:serde", "std"]
simd = []
std = ["dep:bytemuck", "dep:byteorder"]

[dev-dependencies]
bincode = "1.3.3"
bytemuck = "1.16.1"
byteorder = "1.5.0"
criterion = "0.5"
git2 = { version = "0.19", default-features = false }
indicatif = "0.17"
itertools = "0.13"
once_cell = "1.9"
proptest = "1.5.0"
serde = "1.0.203"
serde_json = "1.0.120"
bincode = "1.3.3"
zip = { version = "2", default-features = false }

[profile.test]
opt-level = 2
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,17 @@ This project uses [Clippy][], [rustfmt][], and denies warnings in CI builds. Ava
To ensure your changes will be accepted please check them with:
```
cargo fmt -- --check
cargo fmt --manifest-path benchmarks/Cargo.toml -- --check
cargo clippy --all-targets -- -D warnings
```

In addition, ensure all tests are passing with `cargo test`

### Benchmarking

It is recommended to run the `cargo bench` command inside of the `benchmarks` directory.
This directory contains a library that is dedicated to benchmarking the Roaring library
by using a set of [real-world datasets][]. It is also advised to run the benchmarks on
a bare-metal machine, running them on the base branch and then on the contribution PR
It is recommended to run the `cargo bench` command.
The [benchmarks directory](./benchmarks) contains a library that is dedicated to benchmarking the
Roaring library by using a set of [real-world datasets][]. It is also advised to run the benchmarks
on a bare-metal machine, running them on the base branch and then on the contribution PR
branch to better see the changes.

Those benchmarks are designed on top of the Criterion library,
Expand Down
14 changes: 7 additions & 7 deletions benchmarks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ edition = "2021"
publish = false

[dependencies]
roaring = { path = ".." }
roaring = { workspace = true }

[dev-dependencies]
once_cell = "1.9"
git2 = { version = "0.17", default-features = false, features = ["https", "vendored-openssl"] }
zip = { version = "0.5", default-features = false, features = ["deflate"] }
indicatif = "0.16"
criterion = { version = "0.3", features = ["html_reports"] }
itertools = "0.10"
criterion = { workspace = true, features = ["html_reports"] }
git2 = { workspace = true, default-features = false, features = ["https", "vendored-openssl"] }
indicatif = { workspace = true }
itertools = { workspace = true }
once_cell = { workspace = true }
zip = { workspace = true, default-features = false, features = ["deflate"] }

[features]
simd = ["roaring/simd"]
Expand Down
2 changes: 2 additions & 0 deletions benchmarks/benches/datasets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ fn init_datasets() -> Result<PathBuf, Box<dyn std::error::Error>> {
"{{prefix}}{{msg:.cyan/blue}} [{{bar}}] {{pos}}/{}",
progress.total_objects()
))
.expect("template string invalid")
.progress_chars("#> "),
)
.with_prefix(" ")
Expand Down Expand Up @@ -168,6 +169,7 @@ fn parse_datasets<P: AsRef<Path>>(path: P) -> Result<Vec<Dataset>, Box<dyn std::
.with_style(
ProgressStyle::default_bar()
.template(" {prefix:.green} [{bar}] {msg}")
.expect("template string invalid")
.progress_chars("#> "),
)
.with_prefix("Parsing")
Expand Down
33 changes: 33 additions & 0 deletions roaring/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[package]
name = "roaring"
version = "0.10.6"
rust-version = "1.65.0"
authors = ["Wim Looman <wim@nemo157.com>", "Kerollmops <kero@meilisearch.com>"]
description = "A better compressed bitset - pure Rust implementation"

documentation = "https://docs.rs/roaring"
repository = "https://github.com/RoaringBitmap/roaring-rs"

readme = "../README.md"
keywords = ["roaring", "data-structure", "bitmap"]
categories = ["data-structures"]
edition = "2021"

license = "MIT OR Apache-2.0"

[dependencies]
bytemuck = { workspace = true, optional = true }
byteorder = { workspace = true, optional = true }
serde = { workspace = true, optional = true }

[features]
default = ["std"]
serde = ["dep:serde", "std"]
simd = []
std = ["dep:bytemuck", "dep:byteorder"]

[dev-dependencies]
proptest = { workspace = true }
serde_json = { workspace = true }
bincode = { workspace = true }

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit a849cca

Please sign in to comment.