Nightly regression for rustlex_codegen crate?


#1

I’m working on systemd-cron-next project and I depend on a few unstable features, so I had to use nightly Rust compiler.

I haven’t updated my rust compiler for a while and everything worked just fine, until recently I turned on Travis CI for the project, and it failed to compile with latest nightly.

I updated my compiler and try to cargo build my project, and it failed:

$ cargo build --verbose
...
   Compiling rumblebars v0.3.0
     Running `rustc /home/kstep/.cargo/registry/src/github.com-0a35038f75765ae4/rumblebars-0.3.0/build.rs --crate-name build_script_build --crate-type bin -C prefer-dynamic -g --cfg feature=\"default\" --cfg feature=\"stable\" --cfg feature=\"syntex\" --cfg feature=\"with-syntex\" --out-dir /home/kstep/git/systemd-crontab-generator/target/debug/build/rumblebars-ba09936dc968be81 --emit=dep-info,link -L dependency=/home/kstep/git/systemd-crontab-generator/target/debug/deps -L dependency=/home/kstep/git/systemd-crontab-generator/target/debug/deps --extern syntex=/home/kstep/git/systemd-crontab-generator/target/debug/deps/libsyntex-d3edc118a3ec6f5a.rlib -Awarnings`
       Fresh rustlex_codegen v0.3.0
/home/kstep/.cargo/registry/src/github.com-0a35038f75765ae4/rumblebars-0.3.0/build.rs:5:5: 5:34 error: can't find crate for `rustlex_codegen`
/home/kstep/.cargo/registry/src/github.com-0a35038f75765ae4/rumblebars-0.3.0/build.rs:5     extern crate rustlex_codegen;
                                                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
Could not compile `rumblebars`.

Caused by:
  Process didn't exit successfully: `rustc /home/kstep/.cargo/registry/src/github.com-0a35038f75765ae4/rumblebars-0.3.0/build.rs --crate-name build_script_build --crate-type bin -C prefer-dynamic -g --cfg feature="default" --cfg feature="stable" --cfg feature="syntex" --cfg feature="with-syntex" --out-dir /home/kstep/git/systemd-crontab-generator/target/debug/build/rumblebars-ba09936dc968be81 --emit=dep-info,link -L dependency=/home/kstep/git/systemd-crontab-generator/target/debug/deps -L dependency=/home/kstep/git/systemd-crontab-generator/target/debug/deps --extern syntex=/home/kstep/git/systemd-crontab-generator/target/debug/deps/libsyntex-d3edc118a3ec6f5a.rlib -Awarnings` (exit code: 101)

I use build.rs script with rumblebars crate to generate some files from templates.

I’m not sure since what nightly version the code was broken, but rustc 1.3.0-nightly (69ca01256 2015-07-23) is already broken, while rustc 1.3.0-nightly (7ea2674c7 2015-07-13) works perfectly fine, so whatever regression happened in rust nightly, it was between 7/13 and 7/23.

Any pointers?

Thanks in advance.


#2

According to http://bitrust.octarineparrot.com/ the only breaking changes between 7/13 and 7/23 are these:

commit 18557500cb91596f3614d4cf65439f8c5f47b2e0 Merge: 39d4faf 0ca8e49 Author: bors bors@rust-lang.org AuthorDate: Mon Jul 20 16:38:33 2015 +0000 Commit: bors bors@rust-lang.org CommitDate: Mon Jul 20 16:38:33 2015 +0000

Auto merge of #27026 - nagisa:overflowing-unsigned, r=pnkfelix

This commit fixes the negate_unsigned feature gate to appropriately
account for inferred variables.

This is technically a [breaking-change], but I’d consider it a bug fix.

cc @brson for your relnotes.

Fixes https://github.com/rust-lang/rust/issues/24676
Fixes #26840
Fixes https://github.com/rust-lang/rust/issues/25206

commit e05ac3938bcbdd616930bb010a3bbfa35f22850e Merge: d4432b3 de6b3c2 Author: bors bors@rust-lang.org AuthorDate: Fri Jul 17 18:35:50 2015 +0000 Commit: bors bors@rust-lang.org CommitDate: Fri Jul 17 18:35:50 2015 +0000

Auto merge of #27045 - nikomatsakis:better-object-defaults-error, r=pnkfelix

Transition to the new object lifetime defaults, replacing the old defaults completely.

r? @pnkfelix

This is a [breaking-change] as specified by [RFC 1156][1156] (though all cases that would break should have been receiving warnings

starting in Rust 1.2). Types like &'a Box<Trait> (or &'a Rc<Trait>, etc) will change from being interpreted as &'a Box<Trait+'a> to &'a Box<Trait+'static>. To restore the old behavior, write the +'a explicitly. For example, the function:

```rust
trait Trait { }
fn foo(x: &Box<Trait>) { ... }
```

would be rewritten as:

```rust
trait Trait { }
fn foo(x: &'a Box<Trait+'a>) { ... }
```

if one wanted to preserve the current typing.

[1156]: https://github.com/rust-lang/rfcs/blob/master/text/1156-adjust-default-object-bounds.md

commit 0c9e3dc75cf2b2d122af0596225594240ed254eb Author: Simonas Kazlauskas git@kazlauskas.me AuthorDate: Tue Jul 14 01:03:24 2015 +0300 Commit: Simonas Kazlauskas git@kazlauskas.me CommitDate: Tue Jul 14 21:48:43 2015 +0300

Fix negate_unsigned feature gate check

This commit fixes the negate_unsigned feature gate to appropriately
account for infered variables.

This is technically a [breaking-change].

And these changes don’t look relevant to my problem for me.


#3

Maybe you need to ask the rumblebars maintainer for specifics?

I see you are using "*" versions for dependencies, so you’ll always get the latest versions of crates – even if they have been updated incompatibly. I’d suggest always using versioned dependencies, that way you don’t at least opt in to automatic breakage.

That said, discuss with the rumblebars maintainer, do they intend to support rust nightly? Is there a version of it that does (and which cargo feature flags would it need)?


#4

After looking at crate sources, I found out the crate support nightly, it just needs to be configured with correct features:

[build-dependencies.rumblebars]
version = "*"
features = ["nightly"]
default-features = false

This config snippet solved my problem. Sorry for bothering.