Marwes / schemafy

Crate for generating rust types from a json schema

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

travis: master is currently failing

lucab opened this issue · comments

Travis runs on master are currently red, see https://travis-ci.org/Marwes/schemafy/builds/263771322.

The failure seems to be outside of schemafy scope, somewhere in-between rustfmt and nightly toolchain. I had a similar problem with clippy and CI, and I solved it via a dedicated pinned-nightly run: https://github.com/lucab/caps-rs/blob/ec179c1a6e0907b9574a2672a1c81aac15ff533f/.travis.yml

Let me know if you'd fancy such approach and whether a PR for that is welcome.

Ah, this problem. It appears because the version of rustfmt being run is not compiled with the same rustc as is currently set as default by rustup which makes rustfmt unable to find the correct dlls.

It can probably not be solved with a pinned rustfmt as you did as running rustfmt ends up being required to make the test pass (that is, I need to run rustfmt for stable, beta and nightly instead of just a specific nightly).

Probably the most proper way to solve this is to do rustup run nightly rustfmt instead of only rustfmt (nightly may need to be substituted by the exact nightly version used to compile rustfmt).

let mut child = try!(Command::new("rustfmt")
.

May want that to be configurable as well. I'd be happy to accept a PR for anything that can get the tests green though (without just ignoring them :) ). I am unlikely to have time to look into this for maybe a two weeks or so (I have been wanting to get back to this just to clean up some warts in the code so it is not so hard to extend as it is right now).

Ouch, I didn't realize this was running rustfmt internally (as opposed to just a CI pass). You are of course right, pinning it won't solve that.

Yep, I rely fully on rustfmt to clean up the code I generate since i figured that anoyone that actually want to read the output will want to run rustfmt anyway to get an up to date formatting.

At least everything will still work even if rustfmt is ignored.