feldera icon indicating copy to clipboard operation
feldera copied to clipboard

rust: error for compilation of only the nexmark crate

Open snkas opened this issue 1 year ago • 1 comments

If you clone the feldera repository, only leave the essential crates, and build:

git clone [email protected]:feldera/feldera.git
mkdir -p temp/crates
cp -r feldera/crates/pipeline-types temp/crates
cp -r feldera/crates/dbsp temp/crates
cp -r feldera/crates/nexmark temp/crates
cd temp/crates/nexmark
cargo build -p dbsp_nexmark --example generate --features with-kafka

... the following error is thrown:

error[E0277]: the trait bound `OrderedFloat<f64>: Archive` is not satisfied
   --> <path>/temp/crates/dbsp/src/algebra/floats.rs:21:122
    |
21  |               #[derive(Default, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, SizeOf, rkyv::Archive, rkyv::Serialize, rkyv::Deserialize)]
    |                                                                                                                            ^^^^^^^^^^^^^^^^^ the trait `Archive` is not implemented for `OrderedFloat<f64>`
...
385 | / float! {
386 | |     F32(f32),
387 | |     F64(f64),
388 | | }
    | |_- in this macro invocation
    |
    = help: the following other types implement trait `Archive`:
              bool
              char
              isize
              i8
              i16
              i32
              i64
              i128
            and 197 others
    = help: see issue #48214
    = note: this error originates in the derive macro `rkyv::Deserialize` which comes from the expansion of the macro `float` (in Nightly builds, run with -Z macro-backtrace for more info)

For more information about this error, try `rustc --explain E0277`.
error: could not compile `dbsp` (lib) due to 38 previous errors
warning: build failed, waiting for other jobs to finish...

Likely related to https://github.com/feldera/feldera/issues/1271 and https://github.com/feldera/feldera/issues/1279

snkas avatar Jun 26 '24 12:06 snkas

Yes, you'll need to include part of the Cargo.toml from the feldera repo, e.g.:

[workspace]
members = [
  "crates/dbsp",
  "crates/nexmark",
  "crates/pipeline-types",
]
resolver = "2"

[workspace.metadata.release]
release = false

[profile.bench]
debug = true

[patch.crates-io]
rkyv = { git = "https://github.com/gz/rkyv.git", rev = "3d3fd86" }
rust_decimal = { git = "https://github.com/gz/rust-decimal.git", rev = "ea85fdf" }
size-of = { git = "https://github.com/gz/size-of.git", rev = "3ec40db" }

blp avatar Jun 26 '24 18:06 blp