Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Obviate typespec_client_core dependency in generated code #2382

Open
heaths opened this issue Mar 24, 2025 · 0 comments
Open

Obviate typespec_client_core dependency in generated code #2382

heaths opened this issue Mar 24, 2025 · 0 comments
Assignees
Labels
Azure.Core The azure_core crate Client This issue points to a problem in the data-plane of the library.
Milestone

Comments

@heaths
Copy link
Member

heaths commented Mar 24, 2025

As mentioned in Azure/typespec-rust#324, we couldn't get rid of the typespec_client_core dependency in generated crates' Cargo.toml files because of a couple derive procedural macros.

The Model derive macro does already have a solution where we can change the crate referenced used:

#[derive(Model)]
#[typespec(crate = "azure_core")]

But it looks like the SafeDebug derive macro would need the same capability, or find a way to avoid even referencing the typespec_client_core crate. The only reason it does currently is because it actually implements the typespec_client_core::fmt::SafeDebug trait in addition to std::fmt::Debug:

        #[automatically_derived]
        impl #impl_generics ::typespec_client_core::fmt::SafeDebug for #name #ty_generics #where_clause {}

We probably don't even need that trait. I didn't have specific plans for it. The main goal was to safely implement std::fmt::Debug but figured a separate trait could factor into issues regarding sanitization.

See https://github.com/Azure/typespec-rust/pull/324#discussion_r2010755513 for context

@github-project-automation github-project-automation bot moved this to Untriaged in Azure SDK Rust Mar 24, 2025
@heaths heaths self-assigned this Mar 24, 2025
@heaths heaths added Client This issue points to a problem in the data-plane of the library. Azure.Core The azure_core crate labels Mar 24, 2025
@heaths heaths added this to the 2025-05 milestone Mar 24, 2025
@github-actions github-actions bot added the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Mar 24, 2025
@heaths heaths removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Mar 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Azure.Core The azure_core crate Client This issue points to a problem in the data-plane of the library.
Projects
Status: Untriaged
Development

No branches or pull requests

1 participant