softprops / atty

are you or are you not a tty?
MIT License
271 stars 48 forks source link

Build failure because of 2018 edition #36

Closed iliekturtles closed 4 years ago

iliekturtles commented 4 years ago

My crate uom has dev-dependencies on quickcheck = "0.7". quickcheck has a dependency on evn_logger = "0.5". evn_logger has a dependency on atty = "0.2.5". I support older versions of rustc in uom and currently have a minimum of 1.28.0. The recent release of atty v0.2.12 ended up breaking my build. The way env_logger's dependency on atty is written any patch version in the v0.2 series can be used and rustc 1.28.0 doesn't support the 2018 edition.

Would you consider yanking v0.2.12 or releasing a v0.2.13 which doesn't require the 2018 edition and re-releasing the 2018 edition changes as v0.3?

I've worked around issues like this in the past by only running my full test suite on a newer version of rustc while ensuring the crate itself compiles with the older version. However it would be great if I could continue to run tests on the older version as well.

softprops commented 4 years ago

Sorry about that. I was under the assumption that 2018 crates can safely be consumed by those using 2015 rust. I can pick this up tomorrow.

softprops commented 4 years ago

was feeling sympathetic so I went ahead and did this tonight. published as 0.2.13

BurntSushi commented 4 years ago

Sorry about that. I was under the assumption that 2018 crates can safely be consumed by those using 2015 rust. I can pick this up tomorrow.

They can, definitely. The issue here is that if you rely on something in the 2018 edition that requires a newer compiler (for example, dropping extern crate), then older compilers won't be able to build it.

(The more important thing is probably that 2018 crates can still depend on 2015 crates.)

iliekturtles commented 4 years ago

@softprops Thanks so much! Build passed! I appreciate the quick response.

I also don't want to impede progress. At least for uom's dependency tree releasing your update to the 2018 edition as v0.3.0 would work.

Even if you don't use any 2018 edition features just having the edition keyword in your Cargo.toml can cause issues. At least for versions 1.28.0 through 1.30.1 the existence of the keyword is a hard error as it is considered unstable. Older versions (I'm not exactly sure where it starts) just ignore the keyword with a warning and will still compile as long as there are no 2018 edition exclusive features.