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

Use go mod tidy with compat flags #46

Closed
jpkrohling opened this issue Dec 9, 2021 · 10 comments
Closed

Use go mod tidy with compat flags #46

jpkrohling opened this issue Dec 9, 2021 · 10 comments
Assignees

Comments

@jpkrohling
Copy link
Member

When releasing the OpenTelemetry Collector Contrib, the multimod step is broken for several modules because of:

$ make multimod-prerelease
cd ./internal/tools && go install github.com/client9/misspell/cmd/misspell
cd ./internal/tools && go install github.com/golangci/golangci-lint/cmd/golangci-lint
cd ./internal/tools && go install github.com/google/addlicense
cd ./internal/tools && go install github.com/jstemmer/go-junit-report
cd ./internal/tools && go install github.com/pavius/impi/cmd/impi
cd ./internal/tools && go install github.com/tcnksm/ghr
cd ./internal/tools && go install go.opentelemetry.io/build-tools/checkdoc
cd ./internal/tools && go install go.opentelemetry.io/build-tools/issuegenerator
cd ./internal/tools && go install golang.org/x/tools/cmd/goimports
cd ./internal/tools && go install go.opentelemetry.io/build-tools/multimod
cd ./internal/tools && go install github.com/jcchavezs/porto/cmd/porto
multimod prerelease -v ./versions.yaml -m contrib-base
Using versioning file ./versions.yaml
Using repo with root at /home/jpkroehling/Projects/src/github.com/open-telemetry/opentelemetry-collector-contrib

===== Module Set: contrib-base =====
Updating versions for module set...
Updating all module versions in go.mod files...
could not run Go Mod Tidy: go mod tidy failed: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/jaegerexporter imports
        go.opentelemetry.io/collector/config/configgrpc imports
        go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc tested by
        go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc.test imports
        google.golang.org/grpc/interop imports
        golang.org/x/oauth2 loaded from golang.org/x/[email protected],
        but go 1.16 would select v0.0.0-20210819190943-2bc19b11175f
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/jaegerexporter imports
        go.opentelemetry.io/collector/config/configgrpc imports
        go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc tested by
        go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc.test imports
        google.golang.org/grpc/interop imports
        golang.org/x/oauth2/google loaded from golang.org/x/[email protected],
        but go 1.16 would select v0.0.0-20210819190943-2bc19b11175f
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/jaegerexporter imports
        go.opentelemetry.io/collector/config/configgrpc imports
        go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc tested by
        go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc.test imports
        google.golang.org/grpc/interop imports
        golang.org/x/oauth2 imports
        golang.org/x/oauth2/internal loaded from golang.org/x/[email protected],
        but go 1.16 would select v0.0.0-20210819190943-2bc19b11175f
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/jaegerexporter imports
        go.opentelemetry.io/collector/config/configgrpc imports
        go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc tested by
        go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc.test imports
        google.golang.org/grpc/interop imports
        golang.org/x/oauth2/google imports
        cloud.google.com/go/compute/metadata loaded from cloud.google.com/[email protected],
        but go 1.16 would select v0.93.3
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/jaegerexporter imports
        go.opentelemetry.io/collector/config/configgrpc imports
        go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc tested by
        go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc.test imports
        google.golang.org/grpc/interop imports
        golang.org/x/oauth2/google imports
        golang.org/x/oauth2/jws loaded from golang.org/x/[email protected],
        but go 1.16 would select v0.0.0-20210819190943-2bc19b11175f
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/jaegerexporter imports
        go.opentelemetry.io/collector/config/configgrpc imports
        go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc tested by
        go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc.test imports
        google.golang.org/grpc/interop imports
        golang.org/x/oauth2/google imports
        golang.org/x/oauth2/jwt loaded from golang.org/x/[email protected],
        but go 1.16 would select v0.0.0-20210819190943-2bc19b11175f
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/jaegerexporter imports
        go.opentelemetry.io/collector/config/configgrpc imports
        go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc tested by
        go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc.test imports
        google.golang.org/grpc/interop imports
        golang.org/x/oauth2/google imports
        google.golang.org/appengine loaded from google.golang.org/[email protected],
        but go 1.16 would select v1.6.7
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/jaegerexporter imports
        go.opentelemetry.io/collector/config/configgrpc imports
        go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc tested by
        go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc.test imports
        google.golang.org/grpc/interop imports
        golang.org/x/oauth2 imports
        golang.org/x/oauth2/internal imports
        google.golang.org/appengine/urlfetch loaded from google.golang.org/[email protected],
        but go 1.16 would select v1.6.7
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/jaegerexporter imports
        go.opentelemetry.io/collector/config/configgrpc imports
        go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc tested by
        go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc.test imports
        google.golang.org/grpc/interop imports
        golang.org/x/oauth2/google imports
        google.golang.org/appengine imports
        google.golang.org/appengine/internal loaded from google.golang.org/[email protected],
        but go 1.16 would select v1.6.7
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/jaegerexporter imports
        go.opentelemetry.io/collector/config/configgrpc imports
        go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc tested by
        go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc.test imports
        google.golang.org/grpc/interop imports
        golang.org/x/oauth2/google imports
        google.golang.org/appengine imports
        google.golang.org/appengine/internal/app_identity loaded from google.golang.org/[email protected],
        but go 1.16 would select v1.6.7
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/jaegerexporter imports
        go.opentelemetry.io/collector/config/configgrpc imports
        go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc tested by
        go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc.test imports
        google.golang.org/grpc/interop imports
        golang.org/x/oauth2/google imports
        google.golang.org/appengine imports
        google.golang.org/appengine/internal/modules loaded from google.golang.org/[email protected],
        but go 1.16 would select v1.6.7
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/jaegerexporter imports
        go.opentelemetry.io/collector/config/configgrpc imports
        go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc tested by
        go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc.test imports
        google.golang.org/grpc/interop imports
        golang.org/x/oauth2 imports
        golang.org/x/oauth2/internal imports
        google.golang.org/appengine/urlfetch imports
        google.golang.org/appengine/internal/urlfetch loaded from google.golang.org/[email protected],
        but go 1.16 would select v1.6.7
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/jaegerexporter imports
        go.opentelemetry.io/collector/config/configgrpc imports
        go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc tested by
        go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc.test imports
        google.golang.org/grpc/interop imports
        golang.org/x/oauth2/google imports
        google.golang.org/appengine imports
        google.golang.org/appengine/internal imports
        google.golang.org/appengine/internal/base loaded from google.golang.org/[email protected],
        but go 1.16 would select v1.6.7
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/jaegerexporter imports
        go.opentelemetry.io/collector/config/configgrpc imports
        go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc tested by
        go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc.test imports
        google.golang.org/grpc/interop imports
        golang.org/x/oauth2/google imports
        google.golang.org/appengine imports
        google.golang.org/appengine/internal imports
        google.golang.org/appengine/internal/datastore loaded from google.golang.org/[email protected],
        but go 1.16 would select v1.6.7
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/jaegerexporter imports
        go.opentelemetry.io/collector/config/configgrpc imports
        go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc tested by
        go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc.test imports
        google.golang.org/grpc/interop imports
        golang.org/x/oauth2/google imports
        google.golang.org/appengine imports
        google.golang.org/appengine/internal imports
        google.golang.org/appengine/internal/log loaded from google.golang.org/[email protected],
        but go 1.16 would select v1.6.7
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/jaegerexporter imports
        go.opentelemetry.io/collector/config/configgrpc imports
        go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc tested by
        go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc.test imports
        google.golang.org/grpc/interop imports
        golang.org/x/oauth2/google imports
        google.golang.org/appengine imports
        google.golang.org/appengine/internal imports
        google.golang.org/appengine/internal/remote_api loaded from google.golang.org/[email protected],
        but go 1.16 would select v1.6.7

To upgrade to the versions selected by go 1.16:
        go mod tidy -go=1.16 && go mod tidy -go=1.17
If reproducibility with go 1.16 is not needed:
        go mod tidy -compat=1.17
For other options, see:
        https://golang.org/doc/modules/pruning

exit status 1
make: *** [Makefile:302: multimod-prerelease] Error 1

It would be nice if multimod could handle that for me automatically.

@bogdandrutu
Copy link
Member

/cc @alolita @bryan-aguilar @Aneurysm9 since you were pinged on the duplicate issue.

@Aneurysm9
Copy link
Member

This is complicated by the fact that the Go SDK still requires 1.16 support. Perhaps we can add some configuration to allow specifying Go version compatibility in versions.yaml or determining it from go.mod files it encounters.

@mx-psi
Copy link
Member

mx-psi commented Jun 8, 2022

For future reference, since I forgot this from one release to the next one, the current workaround is to do make multimod-prerelease, followed by make gotidy and commit the result manually

@bogdandrutu
Copy link
Member

I think we are good to fix this now correct? @bryan-aguilar is this already done?

@bryan-aguilar
Copy link
Contributor

I haven't taken a look into this yet. Is this still an issue in the release process? Or has it been side stepped since go mod tidy is usually ran with a compat flag?

@mx-psi
Copy link
Member

mx-psi commented Oct 10, 2022

@codeboten, did you run into this for 0.61.0? I did for 0.60.0

@bryan-aguilar
Copy link
Contributor

bryan-aguilar commented Oct 10, 2022

As suggested by @Aneurysm9 would it make sense to add a compat field in the configuration? This will be used when multimod runs go mod tidy.

module-sets:
  tools:
    compat: 1.18
    version: v0.1.0
    modules:
      - go.opentelemetry.io/build-tools
      - go.opentelemetry.io/build-tools/checkdoc
      - go.opentelemetry.io/build-tools/chloggen
      - go.opentelemetry.io/build-tools/crosslink
      - go.opentelemetry.io/build-tools/dbotconf
      - go.opentelemetry.io/build-tools/issuegenerator
      - go.opentelemetry.io/build-tools/multimod
      - go.opentelemetry.io/build-tools/semconvgen

excluded-modules:
  - go.opentelemetry.io/build-tools/internal/tools

Does it make sense to put it in the specific module set?

@Aneurysm9
Copy link
Member

I think putting it in the module set offers the most flexibility, but I'm assuming that 99.9% of the time the same value will be used for all module sets in a project. Maybe we can put it at the top level for now and then add it as an option to module set definitions if/when we find the need?

@bryan-aguilar
Copy link
Contributor

I think that could be an acceptable compromise.

@jpkrohling
Copy link
Member Author

This is likely not relevant anymore, closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants