-
Notifications
You must be signed in to change notification settings - Fork 39.3k
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
Cleanup manual conversions #123736
Cleanup manual conversions #123736
Conversation
These are not needed.
Explain why seemingly-useless manual conversions are needed. This is deeply unfortunate, but better to document it than not.
9cfffab
to
ca0d2e2
Compare
/retest |
I haven't looked deeply into conversion-gen, so here are some assumptions I'm making (forgive me if its an oversimplification):
IIUC the issue is that to determine # 4 the codebase needs to be compilable. This fails due to missing symbol references after removing generated code and enabling a build tag. I'm surprised that we need a valid full build for this. I would expect it to be possible to perform a best-effort typecheck (where type check/symbol errors are repalced with an Error AST node, or similar). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
can confirm PR is a no-op: removes manually written top level conversions functions to replace them with autogenerated ones with identical content.
LGTM label has been added. Git tree hash: 9b50a1beae8bae297b935201a03dcf9be5824355
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alexzielenski, thockin The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
More than that, we always exclude generated code when generating code. Fundamentally, it's (IMO) sloppy and horrible that we just search for functions with the right name and fingerprint. I think it would be better to do something like:
Edit: a few notes Consider the case of generating for (e.g.) We can't keep a lookaside to know which types have already been generated to track which are internal, because we can't (I think) be sure that the dep will already have been handled - the sort is alphabetic, not topological. So, in the absence of extra information, this is harder than I made it sound. |
/triage accepted |
These might have been needed in the past, but no longer. The ones that are left are a bad situation.
When we do codegen we: a) remove generated files; b) set a build tag to ignore generated files. Then conversion-gen tool searches for specially-named conversion functions. When there is a cross-API dependency, it can't find the functions (because (a) and (b) above) so they generate a compile error. We should do better. For now, docs++.
/kind cleanup