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

tailor should not create go_package targets without a valid owning go.mod #15735

Closed
stuhood opened this issue Jun 2, 2022 · 3 comments · Fixed by #15750
Closed

tailor should not create go_package targets without a valid owning go.mod #15735

stuhood opened this issue Jun 2, 2022 · 3 comments · Fixed by #15750
Assignees
Labels
backend: Go Go backend-related issues onboarding Issues that affect a new user's onboarding experience

Comments

@stuhood
Copy link
Member

stuhood commented Jun 2, 2022

Similar to #15734: tailor will currently create go_package targets for go files, even if they do not have a valid associated go.mod target.

Two cases of this encountered in "the wild":

  • When running tailor on the pantsbuild/pants repo (with all existing configuration ignored) test go files without associated go.mods are picked up by go_package.
    • Although the resulting error message is good, there is a high probability that if someone does not have a go.mod that we will not be able to successfully build that code.
  • When running tailor on https://github.com/OpenAPITools/openapi-generator, the go.mod fails to parse.
    • The error (Pants cannot handle go.mod with replace #14996) should also be fixed directly. But if it's possible to statically attempt to load/validate the go.mod content during tailor and render as a warning instead, that would be likely to catch more unknowns in the future.
@stuhood stuhood added onboarding Issues that affect a new user's onboarding experience backend: Go Go backend-related issues labels Jun 2, 2022
@Eric-Arellano Eric-Arellano self-assigned this Jun 6, 2022
Eric-Arellano added a commit that referenced this issue Jun 6, 2022
Closes #15735.

[ci skip-rust]
[ci skip-build-wheels]
@stuhood
Copy link
Member Author

stuhood commented Jun 6, 2022

Thanks a lot! It would be great to fix the second aspect of this ticket as well, although totally fine as a separate PR.

@Eric-Arellano
Copy link
Contributor

Ah, let's track that via #14996. I added that to the onboarding project. Is that one high priority to fix this week?

@stuhood
Copy link
Member Author

stuhood commented Jun 6, 2022

Ah, let's track that via #14996. I added that to the onboarding project. Is that one high priority to fix this week?

No, not critical for this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend: Go Go backend-related issues onboarding Issues that affect a new user's onboarding experience
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants