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

Fix several warnings and reduce Rust target clobbering #1069

Merged
merged 4 commits into from
Jan 14, 2022

Conversation

jdisanti
Copy link
Collaborator

@jdisanti jdisanti commented Jan 13, 2022

Motivation and Context

The protocol test output had several warnings in it, one of which was called out in #1040. Additionally, local development has involved a lot of recompiling of Rust dependencies lately due to clobbering of the target/ directory due to Gradle targets invoking Rust with different compiler flags.

This PR addresses both issues and stops short of disallowing warnings from Rustdoc, which isn't quite possible until we implement #1068.

These changes should also make the license header lint run faster since it will recompile the tool less frequently.

Note: One protocol test Rustdoc warning is left in place since it didn't seem worth the effort to fix right now. This is a warning about the crate::model module not existing. There's a doc link to this module, but the module doesn't get generated if there are no structs or enums that would be placed in it (which is determined by the Smithy model). We could fix this by always producing an empty module in the future.

Testing

  • Ran protocol tests and verified there is only one warning left that wasn't worth the time investment to fix
  • Ran codegen-test:check followed by aws:sdk:assemble followed by codegen-test:check and verified that it didn't recompile all dependencies for the last codegen-test:check invocation.

Checklist

  • I have updated CHANGELOG.next.toml if I made changes to the smithy-rs codegen or runtime crates

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@jdisanti jdisanti requested review from a team as code owners January 13, 2022 00:18
@github-actions
Copy link

A new doc preview is ready to view.

@github-actions
Copy link

A new generated diff is ready to view.

@github-actions
Copy link

A new doc preview is ready to view.

@github-actions
Copy link

A new generated diff is ready to view.

* Rustdoc doesn't support `r#` for raw identifiers.
* This function adjusts doc links to refer to raw identifiers directly.
*/
fun docLink(docLink: String): String = docLink.replace("::r##", "::").replace("::r#", "::")
Copy link
Collaborator

Choose a reason for hiding this comment

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

there may be other places where we make doc links that need to be audited (but maybe those aren't dynamic?)

Nevermind, looks like you got em

@github-actions
Copy link

A new doc preview is ready to view.

@github-actions
Copy link

A new generated diff is ready to view.

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.

2 participants