Publish workspace with top-level crate + proc macro

Hey there! I have a workspace that has the following layout:

  • pisserror (crate to publish to Crates.io)
    • pisserror_macros

I'd like to publish pisserror on Crates.io.

pisserror uses the pisserror_macros crate as a path dependency. If I try to publish pisserror, cargo is upset since pisserror_macros is not yet published.

Do I need to first publish pisserror_macros, and does it make any sense to publish the macro crate that's just being re-exported by the intended workspace library?

What kind of setup would you recommend for this kind of project? Thank you for your assistance.


You may view the full git repo here: GitHub - onkoe/pisserror: A golden replacement for `thiserror`.

Publishing the macro crate separately is the only way to do this. If you look around crates.io you will see lots of examples of the same thing.

1 Like

I thought that may be the case! I was hoping to find something clever, but all the other options are just... unholy.

Thank you for your assistance. :slight_smile:

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.