Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

Conversation

@cachebag
Copy link
Contributor

@cachebag cachebag commented Dec 1, 2025

closes #1365

If I understood this issue correctly, I think this should cleanly drop the crate. The path functions now simply return the default ::zvariant / ::zbus paths. Users who rename the crate will need to use the original name or a future crate attribute could be added if needed.

If you had something else in mind I'm happy to amend.

P.s. I love the work you've all done. zbus is awesome!

pub fn zvariant_path() -> TokenStream {
if let Ok(FoundCrate::Name(name)) = crate_name("zvariant") {
let ident = format_ident!("{}", name);
pub fn zvariant_path(crate_path: Option<&str>) -> TokenStream {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but nothing passes Some to this? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I was thinking ahead to potentially adding the crate attribute. For now I just took the param out. Thanks for catching that

@zeenix
Copy link
Contributor

zeenix commented Dec 1, 2025

If I understood this issue correctly, I think this should cleanly drop the crate.

Yeah, that's the idea.

Users who rename the crate will need to use the original name or a future crate attribute could be added if needed.

Correct and I think we should add the crate attribute before dropping proc-macro-crate. Unfortunately it's still a breaking change though so we'll likely have to wait till 6.0 to get it merged. We seems to have collected enough breaking changes in the pipeline though, so I think I'll have to look into that soon. Many issues still need doing though so it could still take some time unfortunately but the more ready PRs are available, the less time I'll have to find and more likely that 6.0 happens sooner so PRs like these really help. So thanks for this contribution.

P.s. I love the work you've all done. zbus is awesome!

Thanks!

@codspeed-hq
Copy link

codspeed-hq bot commented Dec 1, 2025

CodSpeed Performance Report

Merging #1590 will not alter performance

Comparing cachebag:pro-macro-crate-removal (27cdd13) with main (cce25aa)

Summary

✅ 22 untouched

@cachebag cachebag force-pushed the pro-macro-crate-removal branch from 27cdd13 to d6c6bc7 Compare December 1, 2025 12:28
@zeenix
Copy link
Contributor

zeenix commented Dec 6, 2025

Correct and I think we should add the crate attribute before dropping proc-macro-crate.

Any chance you could add that? We can already merge and advertise that in the docs then. Best to do that in a separate PR and then rebase this one on top of main when that's merged.

cachebag added a commit to cachebag/zbus that referenced this pull request Dec 6, 2025
Allows users to specify custom crate paths via the `krate` attribute
when they have renamed zbus/zvariant in Cargo.toml.

As discussed in z-galaxy#1590
cachebag added a commit to cachebag/zbus that referenced this pull request Dec 6, 2025
Allows users to specify custom crate paths via the `krate` attribute
when they have renamed zbus/zvariant in Cargo.toml.

As discussed in z-galaxy#1590
cachebag added a commit to cachebag/zbus that referenced this pull request Dec 6, 2025
Allows users to specify custom crate paths via the `krate` attribute
when they have renamed zbus/zvariant in Cargo.toml.

As discussed in z-galaxy#1590
cachebag added a commit to cachebag/zbus that referenced this pull request Dec 8, 2025
Updates `def_attrs!` macro to support `crate` attribute, allowing users
to specify custom crate paths when zbus/zvariant are renamed.

Users write: #[derive(Type, crate = "...")]
Devs access: attrs.crate_path

As discussed in z-galaxy#1590
@cachebag cachebag closed this Dec 24, 2025
@cachebag cachebag deleted the pro-macro-crate-removal branch December 24, 2025 04:39
@cachebag cachebag restored the pro-macro-crate-removal branch December 24, 2025 04:39
@cachebag
Copy link
Contributor Author

cachebag commented Dec 24, 2025

Accidentally deleted this branch on my fork.

@cachebag cachebag reopened this Dec 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Drop proc-macro-crate dependency

2 participants