Skip to content

Compile error on darwin: proc-macro derive panicked #1573

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

Closed
rwz opened this issue May 21, 2017 · 6 comments
Closed

Compile error on darwin: proc-macro derive panicked #1573

rwz opened this issue May 21, 2017 · 6 comments
Labels
bug Panic, non-idempotency, invalid code, etc.

Comments

@rwz
Copy link

rwz commented May 21, 2017

Attempting to run cargo install rustfmt on OSX Sierra 10.12.5 with rustc 1.17.0 produces the following output:

~ > cargo install rustfmt
    Updating registry `https://github.com/rust-lang/crates.io-index`

 Downloading rustfmt v0.8.4
  Installing rustfmt v0.8.4
 Downloading serde_derive v1.0.7
 Downloading getopts v0.2.14
 Downloading env_logger v0.4.2
 Downloading term v0.4.5
 Downloading unicode-segmentation v1.2.0
 Downloading diff v0.1.10
 Downloading serde v1.0.7
 Downloading syntex_syntax v0.58.1
 Downloading multimap v0.3.0
 Downloading strings v0.0.1
 Downloading itertools v0.5.10
 Downloading toml v0.4.1
 Downloading serde_json v1.0.2
 Downloading syntex_errors v0.58.1
 Downloading regex v0.2.2
 Downloading log v0.3.7
 Downloading serde_derive_internals v0.15.0
 Downloading syn v0.11.11
 Downloading quote v0.3.15
 Downloading synom v0.11.3
 Downloading aho-corasick v0.6.3
 Downloading utf8-ranges v1.0.0
 Downloading regex-syntax v0.4.1
 Downloading memchr v1.0.1
 Downloading thread_local v0.3.3
 Downloading libc v0.2.23
 Downloading unreachable v0.1.1
 Downloading syntex_pos v0.58.1
 Downloading rustc-serialize v0.3.24
 Downloading bitflags v0.8.2
 Downloading either v1.1.0
 Downloading dtoa v0.4.1
 Downloading itoa v0.3.1
 Downloading num-traits v0.1.37
 Downloading walkdir v1.0.7
 Downloading same-file v0.1.3
 Downloading thread-id v3.1.0
   Compiling log v0.3.7
   Compiling void v1.0.2
   Compiling either v1.1.0
   Compiling term v0.4.5
   Compiling dtoa v0.4.1
   Compiling diff v0.1.10
   Compiling quote v0.3.15
   Compiling serde v1.0.7
   Compiling itertools v0.5.10
   Compiling unicode-xid v0.0.4
   Compiling synom v0.11.3
   Compiling itoa v0.3.1
   Compiling syn v0.11.11
   Compiling strings v0.0.1
   Compiling getopts v0.2.14
   Compiling bitflags v0.8.2
   Compiling num-traits v0.1.37
   Compiling multimap v0.3.0
   Compiling utf8-ranges v1.0.0
   Compiling regex-syntax v0.4.1
   Compiling same-file v0.1.3
   Compiling walkdir v1.0.7
   Compiling serde_json v1.0.2
   Compiling rustfmt v0.8.4
   Compiling toml v0.4.1
   Compiling serde_derive_internals v0.15.0
   Compiling unreachable v0.1.1
   Compiling libc v0.2.23
   Compiling memchr v1.0.1
   Compiling aho-corasick v0.6.3
   Compiling thread-id v3.1.0
   Compiling thread_local v0.3.3
   Compiling rustc-serialize v0.3.24
   Compiling regex v0.2.2
   Compiling unicode-segmentation v1.2.0
   Compiling serde_derive v1.0.7
   Compiling syntex_pos v0.58.1
   Compiling syntex_errors v0.58.1
   Compiling syntex_syntax v0.58.1
   Compiling env_logger v0.4.2
error: proc-macro derive panicked
   --> .cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/rustfmt-0.8.4/src/config.rs:213:18
    |
213 |         #[derive(Deserialize, Clone)]
    |                  ^^^^^^^^^^^
...
329 | create_config! {
    | - in this macro invocation
    |
    = help: message: proc_macro::__internal::with_parse_sess() called before set_parse_sess()!

error: failed to compile `rustfmt v0.8.4`, intermediate artifacts can be found at `/var/folders/85/qvgvg3597k198f316dqt07v40000gn/T/cargo-install.5QV9zfspwI6h`

Caused by:
  Could not compile `rustfmt`.

To learn more, run the command again with --verbose.
@rwz
Copy link
Author

rwz commented May 21, 2017

Here's the output of the same command ran with --verbose flag: https://gist.github.com/rwz/3006004456df85c73f2593a2477b87b4

@rwz rwz changed the title Does not compile on darwin Compile error on darwin: proc-macro derive panicked May 21, 2017
@nrc nrc added the bug Panic, non-idempotency, invalid code, etc. label May 21, 2017
@nrc
Copy link
Member

nrc commented May 21, 2017

This seems unlikely to be platform-specific. Looks like an error in the Deserialize implementation. However, I could not reproduce with the same version of serde-derive on nightly (1.19). We should not have made breaking changes in the proc macro stuff, but maybe something happened?

@nrc
Copy link
Member

nrc commented May 22, 2017

This might be useful to bisect the issue - https://github.com/Mark-Simulacrum/bisect-rust

@dtolnay
Copy link
Member

dtolnay commented May 22, 2017

The homebrew Rust distribution is hosed. You need to uninstall with homebrew and reinstall with rustup. See rust-lang/rust#39870.

@rwz
Copy link
Author

rwz commented May 22, 2017

Yeah, switching to rustup helped. Thanks @dtolnay. Closing, since it's not a rustfmt feature.

@ilovezfs
Copy link

This should no longer be a problem in Homebrew due to Homebrew/homebrew-core#14490.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Panic, non-idempotency, invalid code, etc.
Projects
None yet
Development

No branches or pull requests

4 participants