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

go: introduce _go_sdk and _go_sdk_package target types for SDK analysis #17973

Merged
merged 5 commits into from
Jan 12, 2023

Conversation

tdyas
Copy link
Contributor

@tdyas tdyas commented Jan 11, 2023

Introduce the _go_sdk and _go_sdk_package target types to allow the build graph to represent the structure of a Go SDK.

  • The _go_sdk target type is used to create a synthetic target //:default_go_sdk to represent the Go SDK found using the [golang].go_search_paths option. This target type is a target generator and generates a _go_sdk_package target for each SDK package.
    • This target type could be made visible to users in the future if we decide to support multiple Go SDKs in a repository, but for now it is an implementation detail to provide a place to use target generation when analyzing the Go SDK.
  • The _go_sdk_package target type is used as the target type for each target representing a SDK package.

This is part of fixing #17950 and was extracted from #17914.

@tdyas tdyas added backend: Go Go backend-related issues category:internal CI, fixes for not-yet-released features, etc. labels Jan 11, 2023
@tdyas tdyas requested review from stuhood, kaos and benjyw January 11, 2023 22:04
@tdyas tdyas merged commit 217c39c into pantsbuild:main Jan 12, 2023
@tdyas tdyas deleted the golang_sdk_analysis branch January 12, 2023 19:23
tdyas added a commit that referenced this pull request Jan 12, 2023
Add Go to wheel building jobs to work around issue where Pants is looking for `go`. Example errors here: https://github.com/pantsbuild/pants/actions/runs/3905384605/jobs/6672312872

After landing #17973, Pants now generates a synthetic target to represent the Go SDK. That target type is a target generator and eagerly calls `go` to find out what targets to generate for the Go SDK.

The wheel building jobs were missing Go, so boom.
@thejcannon
Copy link
Member

FYI This breaks for any Pants dev that doesn't have go installed on their machine 😢

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 category:internal CI, fixes for not-yet-released features, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants