Skip to content

Commit

Permalink
Remove fine-grained features (#185)
Browse files Browse the repository at this point in the history
We aren't automatically testing the power-set of features in CI, so it
may be possible for users to create invalid combinations. The crate
isn't particularly large; let's just remove the fine-grained features.
  • Loading branch information
mkeeter authored Nov 16, 2024
1 parent 606fc25 commit 6da3a17
Show file tree
Hide file tree
Showing 15 changed files with 130 additions and 62 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/check-wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ jobs:
- name: Check
# cargo check doesn't find MIR diagnostics, so we use cargo build instead
# (https://github.com/rust-lang/rust/issues/49292)
run: cargo build --target=${{ matrix.target }} -pfidget --no-default-features --features="rhai,render,mesh"
run: cargo build --target=${{ matrix.target }} -pfidget --no-default-features --features="rhai"
- name: Clippy
run: cargo clippy --target=${{ matrix.target }} -pfidget --no-default-features --features="rhai,render,mesh"
run: cargo clippy --target=${{ matrix.target }} -pfidget --no-default-features --features="rhai"
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
- Remove `fidget::render::render2d/3d` from the public API, as they're
equivalent to the functions on `ImageRenderConfig` / `VoxelRenderConfig`
- Move `RenderHints` into `fidget::render`
- Remove fine-grained features from `fidget` crate, because we aren't actually
testing the power-set of feature combinations in CI (and some were breaking!).
The only remaining features are `rhai`, `jit` and `eval-tests`.

# 0.3.3
- `Function` and evaluator types now produce multiple outputs
Expand Down
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion demos/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ image.workspace = true
log.workspace = true
nalgebra.workspace = true

fidget = { path = "../../fidget", default-features = false, features = ["render", "mesh"] }
fidget.path = "../../fidget"
workspace-hack = { version = "0.1", path = "../../workspace-hack" }

[features]
Expand Down
2 changes: 1 addition & 1 deletion demos/constraints/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ anyhow.workspace = true
eframe.workspace = true
log.workspace = true

fidget = { path = "../../fidget", default-features = false, features = ["solver"] }
fidget.path = "../../fidget"
workspace-hack = { version = "0.1", path = "../../workspace-hack" }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
Expand Down
2 changes: 1 addition & 1 deletion demos/viewer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ nalgebra.workspace = true
notify.workspace = true
rhai.workspace = true

fidget = { path = "../../fidget", default-features = false, features = ["render", "rhai"] }
fidget.path = "../../fidget"
workspace-hack = { version = "0.1", path = "../../workspace-hack" }

[features]
Expand Down
121 changes: 109 additions & 12 deletions demos/web-editor/crate/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion demos/web-editor/crate/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ bincode = "1.3.3"
wasm-bindgen = "0.2.92"
nalgebra = "0.33"

fidget = {path = "../../../fidget", default-features = false, features = ["rhai", "mesh", "render"]}
fidget.path = "../../../fidget"

# Take advantage of feature unification to turn on wasm-bindgen here
rhai = { version = "*", features = ["wasm-bindgen"] }
23 changes: 5 additions & 18 deletions fidget/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,36 +11,33 @@ readme = "../README.md"
[dependencies]
arrayvec.workspace = true
bimap.workspace = true
crossbeam-deque.workspace = true
document-features.workspace = true
ieee754.workspace = true
nalgebra.workspace = true
num-traits.workspace = true
ordered-float.workspace = true
rand.workspace = true
serde.workspace = true
static_assertions.workspace = true
thiserror.workspace = true
serde.workspace = true

rhai = { workspace = true, optional = true }

workspace-hack = { version = "0.1", path = "../workspace-hack" }

# JIT
dynasmrt = { workspace = true, optional = true }
libc = { workspace = true, optional = true }

# Rhai
rhai = { workspace = true, optional = true }

# Meshing
crossbeam-deque = { workspace = true, optional = true }

[target.'cfg(target_os = "windows")'.dependencies]
windows.workspace = true

[target.'cfg(target_arch = "wasm32")'.dependencies]
getrandom.workspace = true

[features]
default = ["jit", "rhai", "render", "mesh", "solver"]
default = ["jit", "rhai"]

## Enables fast evaluation via a JIT compiler. This is exposed in the
## [`fidget::jit`](crate::jit) module, and is supported on macOS, Linux, and
Expand All @@ -54,16 +51,6 @@ jit = ["dep:dynasmrt", "dep:libc"]
## [`fidget::rhai`](crate::rhai) module
rhai = ["dep:rhai"]

## Enable 2D and 3D rendering, in the [`fidget::render`](crate::render) module
render = []

## Enable 3D meshing, in the [`fidget::mesh`](crate::mesh) module
mesh = ["dep:crossbeam-deque"]

## Enable a system-of-equations solver, in the [`fidget::solver`](crate::solver)
## module
solver = []

## Enable `eval-tests` if you're writing your own evaluators and want to
## unit-test them. When enabled, the crate exports a set of macros to test each
## evaluator type, e.g. `float_slice_tests!(...)`.
Expand Down
4 changes: 1 addition & 3 deletions fidget/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ fn main() {
}
}

if std::env::var("CARGO_FEATURE_MESH").is_ok() {
build_mdc_table().unwrap();
}
build_mdc_table().unwrap();
}

/// Builds a table for Manifold Dual Contouring connectivity.
Expand Down
Loading

0 comments on commit 6da3a17

Please sign in to comment.