Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rosetta testing breaks 'cargo test' #149

Closed
LingMan opened this issue Aug 25, 2020 · 2 comments · Fixed by #150
Closed

Rosetta testing breaks 'cargo test' #149

LingMan opened this issue Aug 25, 2020 · 2 comments · Fixed by #150
Labels
area: infra Project infrastructure kind: bug Something isn't working

Comments

@LingMan
Copy link
Contributor

LingMan commented Aug 25, 2020

Since #148 cargo test fails to compile.

$ cargo test
   Compiling naga v0.2.0 (git/naga)
error[E0277]: the trait bound `Module: serde::ser::Serialize` is not satisfied
  --> src/front/wgsl_rosetta_tests.rs:13:18
   |
13 |     let output = ron::ser::to_string_pretty(&module, Default::default()).unwrap();
   |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `serde::ser::Serialize` is not implemented for `Module`
   | 
  ::: .cargo/registry/src/github.com-1ecc6299db9ec823/ron-0.5.1/src/ser/mod.rs:30:8
   |
30 |     T: Serialize,
   |        --------- required by this bound in `ron::ser::to_string_pretty`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0277`.
error: could not compile `naga`.

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed

The problem is that the serialize feature needs to be enabled. That's also the reason this wasn't caught in CI since --all-features is enabled there.

cc @pjoe

@kvark
Copy link
Member

kvark commented Aug 25, 2020

We should gate these tests by feature = "serialize"

@kvark kvark added kind: bug Something isn't working area: infra Project infrastructure labels Aug 25, 2020
@pjoe
Copy link
Collaborator

pjoe commented Aug 25, 2020

Right, guess it should be a matter of adding:

#[cfg(feature="serialize")]

a couple of strategic places :)

pjoe added a commit to pjoe/naga that referenced this issue Aug 25, 2020
kvark pushed a commit that referenced this issue Aug 25, 2020
* Add dependency on serialize for Rosetta tests

Fixes #149

* Also run default cargo test on CI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: infra Project infrastructure kind: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants