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

spanner: go.sum is 8x bigger than other packages and inclues versions of all other subpackages #10991

Open
jschaf opened this issue Oct 14, 2024 · 0 comments
Assignees
Labels
api: spanner Issues related to the Spanner API. triage me I really want to be triaged.

Comments

@jschaf
Copy link

jschaf commented Oct 14, 2024

Client

Spanner

Code and Dependencies

# Print the number of lines in go.sum for each package
find . -name 'go.sum' -maxdepth 2 -print0 | xargs -0 -I{} wc -l {} | sort -nr | head -20

    1616 ./spanner/go.sum
     206 ./storage/go.sum
     203 ./bigquery/go.sum
     192 ./bigtable/go.sum
     191 ./profiler/go.sum
     174 ./pubsublite/go.sum
     174 ./pubsub/go.sum
     172 ./logging/go.sum
     172 ./go.sum
     170 ./asset/go.sum
     168 ./kms/go.sum
     168 ./containeranalysis/go.sum
     166 ./vertexai/go.sum
     166 ./translate/go.sum
     166 ./secretmanager/go.sum
     166 ./iam/go.sum
     166 ./firestore/go.sum
     166 ./datastore/go.sum
     164 ./workstations/go.sum
     164 ./vmwareengine/go.sum

Expected behavior

I expect the Spanner go.sum to be comparable in size to other packages in this repo, about 200 lines of related dependencies.

Actual behavior

The Spanner go.sum is 1600 lines versus ~200 lines for other packages. It includes multiple versions of every other sub-package in this repo, sqlite, and a host of other entries.

Additional context

Likely caused by cyclic imports, similar to golang/protobuf#1204.

  • cloud.google.com/go/spanner depends on google.golang.org/genproto.
  • google.golang.org/genproto depends cloud.google.com/go/spanner

The cycle causes the minimal version selection algorithm to pull in all (most?) tagged versions. For example, https://github.com/googleapis/google-cloud-go/blob/main/spanner/go.sum#L124C1-L135C92:

cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE=
cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc=
cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg=
cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc=
cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ=
cloud.google.com/go/bigquery v1.42.0/go.mod h1:8dRTJxhtG+vwBKzE5OseQn/hiydoQN3EedCaOdYmxRA=
cloud.google.com/go/bigquery v1.43.0/go.mod h1:ZMQcXHsl+xmU1z36G2jNGZmKp9zNY5BUua5wDgmNCfw=
cloud.google.com/go/bigquery v1.44.0/go.mod h1:0Y33VqXTEsbamHJvJHdFmtqHvMIY28aK1+dFsvaChGc=
cloud.google.com/go/bigquery v1.47.0/go.mod h1:sA9XOgy0A8vQK9+MWhEQTY6Tix87M/ZurWFIxmF9I/E=
cloud.google.com/go/bigquery v1.48.0/go.mod h1:QAwSz+ipNgfL5jxiaK7weyOhzdoAy1zFm0Nf1fysJac=
cloud.google.com/go/bigquery v1.49.0/go.mod h1:Sv8hMmTFFYBlt/ftw2uN6dFdQPzBlREY9yBh7Oy7/4Q=
cloud.google.com/go/bigquery v1.50.0/go.mod h1:YrleYEh2pSEbgTBZYMJ5SuSr0ML3ypjRB1zgf7pvQLU=
@jschaf jschaf added the triage me I really want to be triaged. label Oct 14, 2024
@product-auto-label product-auto-label bot added the api: spanner Issues related to the Spanner API. label Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the Spanner API. triage me I really want to be triaged.
Projects
None yet
Development

No branches or pull requests

2 participants