Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
go: use module sources digest for each of its packages (#17728)
## Problem As reported in #17592, third-party Go modules are allowed to assume that all files packaged with the module will be visible during compilation. In that particular issue, the [Confluent Kafka client library](https://github.com/confluentinc/confluent-kafka-go) uses Cgo and expected a subdirectory with files used during C compilation will be visible to the package using Cgo. Pants, however, subsets the modules sources digest to just the files in the exact subdirectory for each of the module's packages. This means that the [subdirectory files](https://github.com/confluentinc/confluent-kafka-go/tree/master/kafka/librdkafka_vendor) were not visible when compiling [the package in confluent-kafka-go in the immediate parent directory](https://github.com/confluentinc/confluent-kafka-go/tree/master/kafka/). ## Solution Since Pants cannot predict how a third party package will use the files in the modules sources, Pants cannot reasonably subset the modules source digest. Solve the issue by not subsetting the module sources digest to produce a package-specific digest. This is a partial fix for #17592.
- Loading branch information