Skip to content

Commit

Permalink
catch up to dpdk-sys a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-noland committed Oct 22, 2024
1 parent d6a98da commit 9b79510
Show file tree
Hide file tree
Showing 13 changed files with 580 additions and 125 deletions.
338 changes: 232 additions & 106 deletions Cargo.lock

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ resolver = "2"

[workspace.dependencies]

bindgen = { version = "0.70.1" }
bolero = { version = "0.11.1" }
cc = { version = "1.1.21" }
doxygen-rs = { version = "0.4.0" }
bindgen = { version = "0.70.1", default-features = false, features = [] }
bolero = { version = "0.11.1", default-features = false, features = [] }
cc = { version = "1.1.21", default-features = false, features = [] }
criterion = { version = "0.5.1", default-features = false, features = [] }
doxygen-rs = { version = "0.4.0", default-features = false, features = [] }
etherparse = { version = "0.16.0", default-features = false, features = [] }
libc = { version = "0.2.158" }
libc = { version = "0.2.158", default-features = false, features = [] }
rand = { version = "0.8.4", default-features = false, features = [] }
rstest = { version = "0.23.0", default-features = false, features = [] }
rustc_version = { version = "0.4.1" }
serde = { version = "1.0.210", default-features = false, features = ["derive", "alloc", "rc"] }
syscalls = { version = "0.6.18" }
thiserror = { version = "2.0.0", package = "thiserror-no-std" } # replace with regular thiserror when https://github.com/dtolnay/thiserror/pull/304 lands
thiserror = { version = "2.0.0", package = "thiserror-no-std", default-features = false, features = [] } # replace with regular thiserror when https://github.com/dtolnay/thiserror/pull/304 lands
tracing = { version = "0.1.40", default-features = false, features = ["attributes"] }
tracing-subscriber = { version = "0.3.18" }
tracing-test = { version = "0.2.5" }
tracing-subscriber = { version = "0.3.18", default-features = false, features = ["fmt"] }
tracing-test = { version = "0.2.5", default-features = false, features = [] }
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
- Recent linux machine of some kind required for development

> [!NOTE]
> I might be able to make this work on Mac if folks are interested and can help test
> I might be able to make this work on Mac if folks are interested and can help test.
- Bash (you very likely have this)
- [Docker](https://www.docker.com/) (install through your package manager
Expand Down
232 changes: 232 additions & 0 deletions deny.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,232 @@
[graph]
targets = []
#exclude = []
all-features = false
no-default-features = false
#features = []

# The output table provides options for how/if diagnostics are outputted
[output]
feature-depth = 1

[advisories]
ignore = []
[licenses]
unused-allowed-license = "allow"
allow = [
"AFL-1.1",
"AFL-1.2",
"AFL-2.0",
"AFL-2.1",
"AFL-3.0",
# "AGPL-3.0", # I don't have any problem with AGPL, but the Google _hates_ it
"Apache-1.1",
"Apache-2.0",
"APSL-2.0",
"Artistic-2.0",
"BSD-2-Clause",
"BSD-3-Clause",
"BSL-1.0",
"CDDL-1.0",
"CPAL-1.0",
"CPL-1.0",
"ECL-2.0",
"EFL-2.0",
"EPL-1.0",
"EPL-2.0",
"EUDatagrid",
"EUPL-1.1",
"EUPL-1.2",
"GPL-2.0",
"GPL-3.0",
"HPND",
"Intel",
"IPA",
"IPL-1.0",
"ISC",
"LGPL-2.1",
"LGPL-3.0",
"LPL-1.02",
"MIT",
"MPL-1.1",
"MPL-2.0",
"MS-PL",
"MS-RL",
"NCSA",
"Nokia",
"OFL-1.1",
"OSL-1.0",
"OSL-2.0",
"OSL-2.1",
"OSL-3.0",
"PHP-3.01",
"Python-2.0",
"QPL-1.0",
"RPSL-1.0",
"SISSL",
"Sleepycat",
"SPL-1.0",
"Unlicense",
"UPL-1.0",
"W3C",
"Zlib",
"ZPL-2.0",
"ZPL-2.1",
]
# The confidence threshold for detecting a license from license text.
# The higher the value, the more closely the license text must be to the
# canonical license text of a valid SPDX license file.
# [possible values: any between 0.0 and 1.0].
confidence-threshold = 1.0
# Allow 1 or more licenses on a per-crate basis, so that particular licenses
# aren't accepted for every possible crate as with the normal allow list
exceptions = [
# Each entry is the crate and version constraint, and its specific allow
# list
#{ allow = ["Zlib"], crate = "adler32" },
# mostly harmless
{ allow = ["Unicode-DFS-2016"], crate = "unicode-ident" },
]

# Some crates don't have (easily) machine readable licensing information,
# adding a clarification entry for it allows you to manually specify the
# licensing information
#[[licenses.clarify]]
# The package spec the clarification applies to
#crate = "ring"
# The SPDX expression for the license requirements of the crate
#expression = "MIT AND ISC AND OpenSSL"
# One or more files in the crate's source used as the "source of truth" for
# the license expression. If the contents match, the clarification will be used
# when running the license check, otherwise the clarification will be ignored
# and the crate will be checked normally, which may produce warnings or errors
# depending on the rest of your configuration
#license-files = [
# Each entry is a crate relative path, and the (opaque) hash of its contents
#{ path = "LICENSE", hash = 0xbd0eed23 }
#]

[licenses.private]
# If true, ignores workspace crates that aren't published, or are only
# published to private registries.
# To see how to mark a crate as unpublished (to the official registry),
# visit https://doc.rust-lang.org/cargo/reference/manifest.html#the-publish-field.
ignore = true
# One or more private registries that you might publish crates to, if a crate
# is only published to private registries, and ignore is true, the crate will
# not have its license(s) checked
registries = [
#"https://sekretz.com/registry
]

# This section is considered when running `cargo deny check bans`.
# More documentation about the 'bans' section can be found here:
# https://embarkstudios.github.io/cargo-deny/checks/bans/cfg.html
[bans]
# Lint level for when multiple versions of the same crate are detected
multiple-versions = "deny"
# Lint level for when a crate version requirement is `*`
wildcards = "deny"
# The graph highlighting used when creating dotgraphs for crates
# with multiple versions
# * lowest-version - The path to the lowest versioned duplicate is highlighted
# * simplest-path - The path to the version with the fewest edges is highlighted
# * all - Both lowest-version and simplest-path are used
highlight = "all"
# The default lint level for `default` features for crates that are members of
# the workspace that is being checked. This can be overridden by allowing/denying
# `default` on a crate-by-crate basis if desired.
workspace-default-features = "allow"
# The default lint level for `default` features for external crates that are not
# members of the workspace. This can be overridden by allowing/denying `default`
# on a crate-by-crate basis if desired.
external-default-features = "allow"
# List of crates that are allowed. Use with care!
allow = [
#"[email protected]",
#{ crate = "[email protected]", reason = "you can specify a reason it is allowed" },
]
# List of crates to deny
deny = [
#"[email protected]",
#{ crate = "[email protected]", reason = "you can specify a reason it is banned" },
# Wrapper crates can optionally be specified to allow the crate when it
# is a direct dependency of the otherwise banned crate
#{ crate = "[email protected]", wrappers = ["this-crate-directly-depends-on-ansi_term"] },
]

# List of features to allow/deny
# Each entry the name of a crate and a version range. If version is
# not specified, all versions will be matched.
#[[bans.features]]
#crate = "reqwest"
# Features to not allow
#deny = ["json"]
# Features to allow
#allow = [
# "rustls",
# "__rustls",
# "__tls",
# "hyper-rustls",
# "rustls",
# "rustls-pemfile",
# "rustls-tls-webpki-roots",
# "tokio-rustls",
# "webpki-roots",
#]
# If true, the allowed features must exactly match the enabled feature set. If
# this is set there is no point setting `deny`
#exact = true

# Similarly to `skip` allows you to skip certain crates during duplicate
# detection. Unlike skip, it also includes the entire tree of transitive
# dependencies starting at the specified crate, up to a certain depth, which is
# by default infinite.
skip-tree = [
#"[email protected]", # will be skipped along with _all_ of its direct and transitive dependencies
#{ crate = "[email protected]", depth = 20 },
]

[[bans.skip]]
name = "dpdk-sys"
reason = "workspace internal"

[[bans.skip]]
name = "scratch"
reason = "workspace internal"

[[bans.skip]]
name = "dpdk"
reason = "workspace internal"

[[bans.skip]]
name = "net"
reason = "workspace internal"

[[bans.skip]]
name = "syn"
reason = "syn is basically always a build time dependency so we aren't shipping multiple versions"

# This section is considered when running `cargo deny check sources`.
# More documentation about the 'sources' section can be found here:
# https://embarkstudios.github.io/cargo-deny/checks/sources/cfg.html
[sources]
# Lint level for what to happen when a crate from a crate registry that is not
# in the allow list is encountered
unknown-registry = "deny"
# Lint level for what to happen when a crate from a git repository that is not
# in the allow list is encountered
unknown-git = "deny"
# List of URLs for allowed crate registries. Defaults to the crates.io index
# if not specified. If it is specified but empty, no registries are allowed.
allow-registry = ["https://github.com/rust-lang/crates.io-index"]
# List of URLs for allowed Git repositories
allow-git = []

[sources.allow-org]
# github.com organizations to allow git sources for
github = []
# gitlab.com organizations to allow git sources for
gitlab = []
# bitbucket.org organizations to allow git sources for
bitbucket = []
1 change: 1 addition & 0 deletions dpdk-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name = "dpdk-sys"
version = "0.0.1"
edition = "2021"
description = "Low-level bindings to the Data Plane Development Kit (DPDK)"
publish = false

[build-dependencies]
bindgen = { workspace = true, features = ["runtime"] }
Expand Down
4 changes: 1 addition & 3 deletions dpdk-sysroot-helper/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@
name = "dpdk-sysroot-helper"
version = "0.0.1"
edition = "2021"

[dependencies]
rustc_version = { workspace = true }
publish = false
2 changes: 1 addition & 1 deletion dpdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "dpdk"
version = "0.1.0"
edition = "2021"
publish = false

[features]
default = ["serde", "tracing_max_level_trace", "tracing_release_max_level_debug"]
Expand Down Expand Up @@ -31,7 +32,6 @@ net = { path = "../net" }

etherparse = { workspace = true, default-features = false, features = [] }
serde = { workspace = true, optional = true }
syscalls = { workspace = true }
thiserror = { workspace = true }
tracing = { workspace = true, features = ["attributes"] }

Expand Down
1 change: 1 addition & 0 deletions errno/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "errno"
version = "0.1.0"
edition = "2021"
publish = false

[dependencies]

Expand Down
9 changes: 8 additions & 1 deletion net/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
name = "net"
version = "0.0.1"
edition = "2021"
publish = false

[[bench]]
name = "parse"
harness = false

[features]
default = ["serde", "tracing_max_level_trace", "tracing_release_max_level_debug"]
Expand All @@ -24,11 +29,13 @@ tracing_release_max_level_trace = ["tracing/release_max_level_trace"]
tracing_release_max_level_warn = ["tracing/release_max_level_warn"]

[dependencies]

serde = { workspace = true, optional = true }
thiserror = { workspace = true }
tracing = { workspace = true }

[dev-dependencies]
bolero = { workspace = true }
criterion = { workspace = true }
rand = { workspace = true }
etherparse = { workspace = true, default-features = false, features = ["std"] }

17 changes: 17 additions & 0 deletions net/benches/parse.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
use std::hint::black_box;
use criterion::{criterion_group, criterion_main, Criterion};

fn fibonacci(n: u64) -> u64 {
match n {
0 => 1,
1 => 1,
n => fibonacci(n-1) + fibonacci(n-2),
}
}

fn criterion_benchmark(c: &mut Criterion) {
c.bench_function("fib 20", |b| b.iter(|| fibonacci(black_box(20))));
}

criterion_group!(benches, criterion_benchmark);
criterion_main!(benches);
Loading

0 comments on commit 9b79510

Please sign in to comment.