Skip to content

Commit

Permalink
Move things around
Browse files Browse the repository at this point in the history
  • Loading branch information
udoprog committed Apr 12, 2024
1 parent 2d1bd59 commit a07ef74
Show file tree
Hide file tree
Showing 86 changed files with 67 additions and 59 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ jobs:
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{matrix.rust}}
- run: cargo build --workspace --exclude tools --exclude musli-tests
- run: cargo build
if: matrix.rust != 'stable'
- run: cargo build --workspace --exclude no-std-examples --all-targets
- run: cargo build --all-targets
if: matrix.rust == 'stable'
- run: cargo test --workspace --exclude no-std-examples --all-targets --features test
- run: cargo test --all-targets --features test
if: matrix.rust == 'stable'
- run: cargo test --workspace --exclude no-std-examples --doc
- run: cargo test --doc
if: matrix.rust == 'stable'

tests_clippy:
Expand All @@ -51,7 +51,7 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- run: cargo build
- run: cargo +nightly run -p no-std-examples --example no-std-${{matrix.example}}
- run: cargo +nightly run -p no-std --example no-std-${{matrix.example}}

fuzz:
needs: [test, tests_clippy, each_package, recursive]
Expand All @@ -70,7 +70,7 @@ jobs:
- uses: dtolnay/rust-toolchain@nightly
with:
components: miri
- run: cargo miri test --workspace --exclude no-std-examples --features test
- run: cargo miri test --features test
- run: cargo miri run -p tests --features test --bin fuzz
- run: cargo miri run -p tests --features test --bin fuzz -- --random

Expand Down Expand Up @@ -117,7 +117,7 @@ jobs:
- uses: dtolnay/[email protected]
with:
components: clippy
- run: cargo clippy --workspace --exclude no-std-examples --all-targets --features test -- -D warnings
- run: cargo clippy --all-targets --features test -- -D warnings

rustfmt:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/weekly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ jobs:
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{matrix.rust}}
- run: cargo build --workspace --exclude tools --exclude musli-tests
- run: cargo build
15 changes: 13 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,16 @@ opt-level = 3

[workspace]
resolver = "2"
members = ["crates/*"]
default-members = ["crates/musli*"]
members = [
"crates/*",
"asm",
"tests",
"tools",
"no-std"
]
default-members = [
"crates/*",
"asm",
"tests",
"tools",
]
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -373,12 +373,12 @@ safety, extensive testing and fuzzing is performed using `miri`. See
[`protobuf`]: https://developers.google.com/protocol-buffers
[`serde`]: https://serde.rs
[`simdutf8`]: https://docs.rs/simdutf8
[`tests`]: https://github.com/udoprog/musli/tree/main/crates/tests
[`tests`]: https://github.com/udoprog/musli/tree/main/tests
[benchmarks]: https://udoprog.github.io/musli/benchmarks/
[bit packing]: https://github.com/udoprog/musli/blob/main/crates/musli-descriptive/src/tag.rs
[detailed tracing]: https://udoprog.github.io/rust/2023-05-22/abductive-diagnostics-for-musli.html
[musli-name-type]: https://docs.rs/musli/latest/musli/derives/index.html#musliname_type--
[no-std and no-alloc]: https://github.com/udoprog/musli/blob/main/crates/no-std-examples/examples/no-std-json.rs
[no-std and no-alloc]: https://github.com/udoprog/musli/blob/main/no-std/examples/no-std-json.rs
[scoped allocations]: https://docs.rs/musli-allocator
[size comparisons]: https://udoprog.github.io/musli/benchmarks/#size-comparisons
[when decoding collections]: https://docs.rs/serde/latest/serde/trait.Deserializer.html#tymethod.deserialize_seq
Expand Down
3 changes: 2 additions & 1 deletion crates/asm/Cargo.toml → asm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ zerocopy = ["dep:zerocopy", "tests/zerocopy"]
[dependencies]
tests = { path = "../tests", default-features = false, features = ["std"] }

musli-zerocopy = { path = "../musli-zerocopy", optional = true }
musli-zerocopy = { path = "../crates/musli-zerocopy", optional = true }

zerocopy = { version = "0.7.32", default-features = false, optional = true, features = ["byteorder", "derive"] }
File renamed without changes.
4 changes: 2 additions & 2 deletions crates/musli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -373,12 +373,12 @@ safety, extensive testing and fuzzing is performed using `miri`. See
[`protobuf`]: https://developers.google.com/protocol-buffers
[`serde`]: https://serde.rs
[`simdutf8`]: https://docs.rs/simdutf8
[`tests`]: https://github.com/udoprog/musli/tree/main/crates/tests
[`tests`]: https://github.com/udoprog/musli/tree/main/tests
[benchmarks]: https://udoprog.github.io/musli/benchmarks/
[bit packing]: https://github.com/udoprog/musli/blob/main/crates/musli-descriptive/src/tag.rs
[detailed tracing]: https://udoprog.github.io/rust/2023-05-22/abductive-diagnostics-for-musli.html
[musli-name-type]: https://docs.rs/musli/latest/musli/derives/index.html#musliname_type--
[no-std and no-alloc]: https://github.com/udoprog/musli/blob/main/crates/no-std-examples/examples/no-std-json.rs
[no-std and no-alloc]: https://github.com/udoprog/musli/blob/main/no-std/examples/no-std-json.rs
[scoped allocations]: https://docs.rs/musli-allocator
[size comparisons]: https://udoprog.github.io/musli/benchmarks/#size-comparisons
[when decoding collections]: https://docs.rs/serde/latest/serde/trait.Deserializer.html#tymethod.deserialize_seq
Expand Down
4 changes: 2 additions & 2 deletions crates/musli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -382,12 +382,12 @@
//! [`protobuf`]: https://developers.google.com/protocol-buffers
//! [`serde`]: https://serde.rs
//! [`simdutf8`]: https://docs.rs/simdutf8
//! [`tests`]: https://github.com/udoprog/musli/tree/main/crates/tests
//! [`tests`]: https://github.com/udoprog/musli/tree/main/tests
//! [benchmarks]: https://udoprog.github.io/musli/benchmarks/
//! [bit packing]: https://github.com/udoprog/musli/blob/main/crates/musli-descriptive/src/tag.rs
//! [detailed tracing]: https://udoprog.github.io/rust/2023-05-22/abductive-diagnostics-for-musli.html
//! [musli-name-type]: https://docs.rs/musli/latest/musli/derives/index.html#musliname_type--
//! [no-std and no-alloc]: https://github.com/udoprog/musli/blob/main/crates/no-std-examples/examples/no-std-json.rs
//! [no-std and no-alloc]: https://github.com/udoprog/musli/blob/main/no-std/examples/no-std-json.rs
//! [scoped allocations]: https://docs.rs/musli-allocator
//! [size comparisons]: https://udoprog.github.io/musli/benchmarks/#size-comparisons
//! [when decoding collections]: https://docs.rs/serde/latest/serde/trait.Deserializer.html#tymethod.deserialize_seq
Expand Down
12 changes: 0 additions & 12 deletions crates/no-std-examples/Cargo.toml

This file was deleted.

12 changes: 12 additions & 0 deletions no-std/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
name = "no-std"
edition = "2021"
publish = false

[dependencies]
musli = { path = "../crates/musli", default-features = false }
musli-json = { path = "../crates/musli-json", default-features = false, features = ["parse-full"] }
musli-utils = { path = "../crates/musli-utils", default-features = false }

[target.'cfg(unix)'.dependencies]
compiler_builtins = { git = "https://github.com/rust-lang/compiler-builtins", features = ["mem"] }
File renamed without changes.
File renamed without changes.
32 changes: 16 additions & 16 deletions crates/tests/Cargo.toml → tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ bitcode-derive = ["dep:bitcode", "bitcode?/derive", "no-cstring"]
miniserde = ["dep:miniserde", "alloc", "no-cstring", "no-btree", "no-map", "no-set", "no-nonunit-variant", "no-128", "no-char", "no-tuple", "no-binary-equality"]

[dependencies]
musli = { path = "../musli", version = "0.0.112", default-features = false, optional = true, features = [] }
musli-utils = { path = "../musli-utils", version = "0.0.112", default-features = false, features = [] }
musli-wire = { path = "../musli-wire", version = "0.0.112", default-features = false, features = ["test"], optional = true }
musli-descriptive = { path = "../musli-descriptive", version = "0.0.112", default-features = false, features = ["test"], optional = true }
musli-storage = { path = "../musli-storage", version = "0.0.112", default-features = false, features = ["test"], optional = true }
musli-json = { path = "../musli-json", version = "0.0.112", default-features = false, features = ["test"], optional = true }
musli-value = { path = "../musli-value", version = "0.0.112", default-features = false, features = ["test"], optional = true }
musli-zerocopy = { path = "../musli-zerocopy", version = "0.0.112", default-features = false, features = [], optional = true }
musli-macros = { path = "../musli-macros", version = "0.0.112", features = ["test"] }
musli = { path = "../crates/musli", version = "0.0.112", default-features = false, optional = true, features = [] }
musli-utils = { path = "../crates/musli-utils", version = "0.0.112", default-features = false, features = [] }
musli-wire = { path = "../crates/musli-wire", version = "0.0.112", default-features = false, features = ["test"], optional = true }
musli-descriptive = { path = "../crates/musli-descriptive", version = "0.0.112", default-features = false, features = ["test"], optional = true }
musli-storage = { path = "../crates/musli-storage", version = "0.0.112", default-features = false, features = ["test"], optional = true }
musli-json = { path = "../crates/musli-json", version = "0.0.112", default-features = false, features = ["test"], optional = true }
musli-value = { path = "../crates/musli-value", version = "0.0.112", default-features = false, features = ["test"], optional = true }
musli-zerocopy = { path = "../crates/musli-zerocopy", version = "0.0.112", default-features = false, features = [], optional = true }
musli-macros = { path = "../crates/musli-macros", version = "0.0.112", features = ["test"] }

anyhow = "1.0.81"
serde = { version = "1.0.197", default-features = false, optional = true, features = ["derive"] }
Expand All @@ -89,13 +89,13 @@ zerocopy = { version = "0.7.32", default-features = false, optional = true, feat
miniserde = { version = "0.1.38", default-features = false, optional = true }

[dev-dependencies]
musli = { path = "../musli", version = "0.0.112", default-features = false, features = ["alloc"] }
musli-serde = { path = "../musli-serde", version = "0.0.112", default-features = false, features = ["alloc"] }
musli-storage = { path = "../musli-storage", version = "0.0.112", default-features = false, features = ["alloc", "test"] }
musli-wire = { path = "../musli-wire", version = "0.0.112", default-features = false, features = ["alloc", "test"] }
musli-descriptive = { path = "../musli-descriptive", version = "0.0.112", default-features = false, features = ["alloc", "test"] }
musli-json = { path = "../musli-json", version = "0.0.112", default-features = false, features = ["alloc", "test"] }
musli-value = { path = "../musli-value", version = "0.0.112", default-features = false, features = ["alloc", "test"] }
musli = { path = "../crates/musli", version = "0.0.112", default-features = false, features = ["alloc"] }
musli-serde = { path = "../crates/musli-serde", version = "0.0.112", default-features = false, features = ["alloc"] }
musli-storage = { path = "../crates/musli-storage", version = "0.0.112", default-features = false, features = ["alloc", "test"] }
musli-wire = { path = "../crates/musli-wire", version = "0.0.112", default-features = false, features = ["alloc", "test"] }
musli-descriptive = { path = "../crates/musli-descriptive", version = "0.0.112", default-features = false, features = ["alloc", "test"] }
musli-json = { path = "../crates/musli-json", version = "0.0.112", default-features = false, features = ["alloc", "test"] }
musli-value = { path = "../crates/musli-value", version = "0.0.112", default-features = false, features = ["alloc", "test"] }
serde = { version = "1.0.197", default-features = false, features = ["derive"] }
criterion = { version = "0.5.1", features = ["html_reports"] }
trybuild = "1.0.90"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 0 additions & 3 deletions crates/tests/src/lib.rs → tests/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
//! [<img alt="github" src="https://img.shields.io/badge/github-udoprog/musli-8da0cb?style=for-the-badge&logo=github" height="20">](https://github.com/udoprog/musli)
//! [<img alt="crates.io" src="https://img.shields.io/crates/v/tests.svg?style=for-the-badge&color=fc8d62&logo=rust" height="20">](https://crates.io/crates/tests)
//! [<img alt="docs.rs" src="https://img.shields.io/badge/docs.rs-tests-66c2a5?style=for-the-badge&logoColor=white&logo=data:image/svg+xml;base64,PHN2ZyByb2xlPSJpbWciIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDUxMiA1MTIiPjxwYXRoIGZpbGw9IiNmNWY1ZjUiIGQ9Ik00ODguNiAyNTAuMkwzOTIgMjE0VjEwNS41YzAtMTUtOS4zLTI4LjQtMjMuNC0zMy43bC0xMDAtMzcuNWMtOC4xLTMuMS0xNy4xLTMuMS0yNS4zIDBsLTEwMCAzNy41Yy0xNC4xIDUuMy0yMy40IDE4LjctMjMuNCAzMy43VjIxNGwtOTYuNiAzNi4yQzkuMyAyNTUuNSAwIDI2OC45IDAgMjgzLjlWMzk0YzAgMTMuNiA3LjcgMjYuMSAxOS45IDMyLjJsMTAwIDUwYzEwLjEgNS4xIDIyLjEgNS4xIDMyLjIgMGwxMDMuOS01MiAxMDMuOSA1MmMxMC4xIDUuMSAyMi4xIDUuMSAzMi4yIDBsMTAwLTUwYzEyLjItNi4xIDE5LjktMTguNiAxOS45LTMyLjJWMjgzLjljMC0xNS05LjMtMjguNC0yMy40LTMzLjd6TTM1OCAyMTQuOGwtODUgMzEuOXYtNjguMmw4NS0zN3Y3My4zek0xNTQgMTA0LjFsMTAyLTM4LjIgMTAyIDM4LjJ2LjZsLTEwMiA0MS40LTEwMi00MS40di0uNnptODQgMjkxLjFsLTg1IDQyLjV2LTc5LjFsODUtMzguOHY3NS40em0wLTExMmwtMTAyIDQxLjQtMTAyLTQxLjR2LS42bDEwMi0zOC4yIDEwMiAzOC4ydi42em0yNDAgMTEybC04NSA0Mi41di03OS4xbDg1LTM4Ljh2NzUuNHptMC0xMTJsLTEwMiA0MS40LTEwMi00MS40di0uNmwxMDItMzguMiAxMDIgMzguMnYuNnoiPjwvcGF0aD48L3N2Zz4K" height="20">](https://docs.rs/tests)
#![no_std]

#[cfg(feature = "alloc")]
Expand Down
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.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
error: #[musli(default)] variant must be empty
--> tests/ui/illegal_fallback_variant_error.rs:6:5
--> tests/ui/illegal_fallback_variant_error.rs:6:13
|
6 | #[musli(default)]
| ^
| ^^^^^^^

error: #[musli(default)] only one fallback variant is supported
--> tests/ui/illegal_fallback_variant_error.rs:17:5
--> tests/ui/illegal_fallback_variant_error.rs:17:13
|
17 | #[musli(default)]
| ^
| ^^^^^^^
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.
3 changes: 2 additions & 1 deletion crates/tools/Cargo.toml → tools/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ edition = "2021"
publish = false

[dependencies]
tests = { path = "../tests" }

anyhow = "1.0.81"
clap = { version = "4.5.4", features = ["derive"] }
serde = { version = "1.0.197", features = ["derive"] }
serde_json = "1.0.114"
tests = { path = "../tests" }
toml = "0.8.12"
File renamed without changes.
File renamed without changes.
10 changes: 4 additions & 6 deletions crates/tools/src/main.rs → tools/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,19 +199,17 @@ fn main() -> Result<()> {
let root =
PathBuf::from(env::var_os("CARGO_MANIFEST_DIR").context("missing `CARGO_MANIFEST_DIR`")?);

let root = root
.parent()
.and_then(|p| p.parent())
.context("Missing root directory")?;
let root = root.parent().context("Missing root directory")?;

let target = root.join("target");

let args = Args::try_parse()?;

let command = args.command.unwrap_or_default();

let reports_path = root.join("crates").join("tools").join("report.toml");
let reports = fs::read_to_string(&reports_path)?;
let reports_path = root.join("tools").join("report.toml");
let reports =
fs::read_to_string(&reports_path).with_context(|| anyhow!("{}", reports_path.display()))?;
let manifest: Manifest =
toml::from_str(&reports).with_context(|| anyhow!("{}", reports_path.display()))?;

Expand Down
File renamed without changes.

0 comments on commit a07ef74

Please sign in to comment.