Skip to content

incremental compilation + proc macros: undefined symbol error #47292

Closed
@rukai

Description

error: /home/rubic/Projects/Crates/syn/examples/heapsize2/example/target/debug/deps/libheapsize_derive-3ef99e9f83ff68d2.so: undefined symbol: __rustc_derive_registrar__59da0d2c3725c53af805cb0071a3b093_24
 --> src/main.rs:2:1
  |
2 | extern crate heapsize_derive;
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Disabling incremental compilation or deleting the build files fixes the issue.

$ rustc --version --verbose
rustc 1.25.0-nightly (b5392f545 2018-01-08)
binary: rustc
commit-hash: b5392f54503fdaf04df4b9578510b2baa944f4af
commit-date: 2018-01-08
host: x86_64-unknown-linux-gnu
release: 1.25.0-nightly
LLVM version: 4.0

Steps to reproduce

  1. git clone https://github.com/dtolnay/syn
  2. cd syn/examples/heapsize2/example/src/ && CARGO_INCREMENTAL=1 cargo run (build succeeds as expected)
  3. at syn/examples/heapsize2/heapsize_derive/src/lib.rs:20 insert a line "foo()"
  4. cd syn/examples/heapsize2/example/src/ && CARGO_INCREMENTAL=1 cargo run (build fails as expected)
  5. at syn/examples/heapsize2/heapsize_derive/src/lib.rs:16 insert a line "fn foo() { }"
  6. cd syn/examples/heapsize2/example/src/ && CARGO_INCREMENTAL=1 cargo run (build fails with error above)

In case the changes to source code above weren't clear, refer to the commits 1 & 2 https://github.com/rukai/syn/commits/bug

Activity

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

Metadata

Labels

A-incr-compArea: Incremental compilationA-macros-2.0Area: Declarative macros 2.0 (#39412)T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions