bkchr / proc-macro-crate

`$crate` in procedural macros.
Apache License 2.0
65 stars 17 forks source link

Does not support workspace inheriting #34

Closed clearloop closed 1 year ago

clearloop commented 1 year ago

https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#inheriting-a-dependency-from-a-workspace

https://github.com/bkchr/proc-macro-crate/blob/1fdce5d354fdd73bbfb442820823a4b802254bd3/src/lib.rs#L179

[workspace.dependencies]
foo = { package = "bar" }
[dependencies]
foo = { workspace = true }

only iterated the dependencies inside the package, once a package renamed its dependency in workspace level, the searching logic doesn't work

pmikolajczyk41 commented 1 year ago

Seems like the nasty workaround is to include package attribute, which is ignored by rust compiler (and throws warning), but is taken into consideration by this macro - see: https://github.com/paritytech/ink/pull/1835