Equivalent of cargo:rerun-if-changed for procedural macros?

The is the standard (and only) way to get cargo to track external files used by proc macros at the current time.

My guess as to why it's erroring for you is the difference in relative path base. If a proc macro uses a relative path, it's relative to the project root by default (iirc, may also be working directory...). The include_str! relative path is relative to the file that it's located in.

1 Like