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

#[belongs_to(Blah)] causes compile error #406

Closed
nerdrew opened this Issue Aug 17, 2016 · 4 comments

Comments

Projects
None yet
3 participants
@nerdrew
Contributor

nerdrew commented Aug 17, 2016

#401 causes my build to fail.

Example project that fails: https://github.com/nerdrew/diesel_belongs_to_test

Failure:

% rustc --version
rustc 1.12.0-nightly (197be89f3 2016-08-15)
% cargo test
   Compiling libc v0.2.15
   Compiling byteorder v0.3.13
   Compiling winapi v0.2.8
   Compiling regex-syntax v0.3.4
   Compiling diesel_codegen_syntex v0.7.1
   Compiling pq-sys v0.2.3
   Compiling winapi-build v0.1.1
   Compiling utf8-ranges v0.1.3
   Compiling kernel32-sys v0.2.2
   Compiling diesel v0.7.0 (file:///./diesel)
   Compiling thread-id v2.0.0
   Compiling thread_local v0.2.6
   Compiling memchr v0.1.11
   Compiling aho-corasick v0.5.2
   Compiling regex v0.1.73
   Compiling dotenv v0.8.0
   Compiling dotenv_codegen v0.9.0
   Compiling dotenv_macros v0.9.0
   Compiling diesel_codegen v0.7.0 (file:////diesel_codegen)
   Compiling test_diesel v0.1.0 (file:///./test_diesel)
error: expected ident, found ,
  --> <diesel macros>:28:70
   |
28 | ( foreign_key_kind = $ foreign_key_kind , $ ( $ remaining_args ) * ) , fields
   |                                                                      ^

error: expected ident, found ,
  --> <diesel macros>:28:70
   |
28 | ( foreign_key_kind = $ foreign_key_kind , $ ( $ remaining_args ) * ) , fields
   |                                                                      ^

Build failed, waiting for other jobs to finish...
error: Could not compile `test_diesel`.

To learn more, run the command again with --verbose.
@killercup

This comment has been minimized.

Member

killercup commented Aug 17, 2016

I'm pretty sure you need to use an older nightly -- try the one from
2016-07-07 (same as in Travis file).

In general, each diesel version will be tested against the nightly from the
date of release of the latest stable.

Andrew Ryan Lazarus notifications@github.com schrieb am Mi. 17. Aug. 2016
um 08:54:

#401 #401 causes my build to
fail.

Example project that fails:
https://github.com/nerdrew/diesel_belongs_to_test

Failure:

% rustc --version
rustc 1.12.0-nightly (197be89f3 2016-08-15)
% cargo test
Compiling libc v0.2.15
Compiling byteorder v0.3.13
Compiling winapi v0.2.8
Compiling regex-syntax v0.3.4
Compiling diesel_codegen_syntex v0.7.1
Compiling pq-sys v0.2.3
Compiling winapi-build v0.1.1
Compiling utf8-ranges v0.1.3
Compiling kernel32-sys v0.2.2
Compiling diesel v0.7.0 (file:///./diesel)
Compiling thread-id v2.0.0
Compiling thread_local v0.2.6
Compiling memchr v0.1.11
Compiling aho-corasick v0.5.2
Compiling regex v0.1.73
Compiling dotenv v0.8.0
Compiling dotenv_codegen v0.9.0
Compiling dotenv_macros v0.9.0
Compiling diesel_codegen v0.7.0 (file:////diesel_codegen)
Compiling test_diesel v0.1.0 (file:///./test_diesel)
error: expected ident, found ,
--> :28:70
|
28 | ( foreign_key_kind = $ foreign_key_kind , $ ( $ remaining_args ) * ) , fields
| ^

error: expected ident, found ,
--> :28:70
|
28 | ( foreign_key_kind = $ foreign_key_kind , $ ( $ remaining_args ) * ) , fields
| ^

Build failed, waiting for other jobs to finish...
error: Could not compile test_diesel.

To learn more, run the command again with --verbose.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#406, or mute the thread
https://github.com/notifications/unsubscribe-auth/AABOX8C5XhiH9qa5Te1dREaWCZi7_t6bks5qgrAegaJpZM4JmJbv
.

@sgrif

This comment has been minimized.

Member

sgrif commented Aug 17, 2016

I actually can't reproduce this either with the supported nightly or the latest nightly. Your given example compiles fine for me on both. I did notice that the output you've pasted isn't using the code from crates.io, it's using files on your local machine (Compiling diesel_codegen v0.7.0 (file:////diesel_codegen)). Do you have a .cargo/config which is overriding it? Either way I also notice that the version it states is out of date. The latest version in 0.7.1 so either pointing at the released version from crates.io or updating your local copy should fix this issue for you.

@sgrif sgrif closed this Aug 17, 2016

@sgrif

This comment has been minimized.

Member

sgrif commented Aug 17, 2016

Ah, actually I can see exactly what the problem is. You're using diesel_codegen_syntex 0.7.1 which will be generating code for the macro provided by diesel 0.7.1 but the version of diesel being used is 0.7.0 (unfortunately I can't prevent this, restricting the version of diesel in Cargo.toml would just cause it to use two copies of diesel, not force you to update the version used in your app). But basically some of your dependencies are missing ccd2a75

@nerdrew

This comment has been minimized.

Contributor

nerdrew commented Aug 17, 2016

Ah, ok. I'm using .cargo/config to override diesel and diesel_codegen to use master. Sounds like I need to add diesel_codegen_syntex to that list too. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment