-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 workspaces to simplify dependency versioning #5991
Comments
I was able to positively confirm that all modules had some effect when added to the go.work. For instance: ``` $ make install-tools cd ./internal/tools && go install github.com/client9/misspell/cmd/misspell cd ./internal/tools && go install github.com/golangci/golangci-lint/cmd/golangci-lint no required module provides package github.com/golangci/golangci-lint/cmd/golangci-lint; to add it: go get github.com/golangci/golangci-lint/cmd/golangci-lint make: *** [Makefile:130: install-tools] Error 1 $ go work use internal/tools/ $ make install-tools 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/ory/go-acc 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 github.com/wadey/gocovmerge cd ./internal/tools && go install go.opentelemetry.io/build-tools/checkdoc cd ./internal/tools && go install go.opentelemetry.io/build-tools/semconvgen cd ./internal/tools && go install golang.org/x/exp/cmd/apidiff cd ./internal/tools && go install golang.org/x/tools/cmd/goimports cd ./internal/tools && go install github.com/jcchavezs/porto/cmd/porto cd ./internal/tools && go install go.opentelemetry.io/build-tools/multimod ``` Fixes open-telemetry#5991 Signed-off-by: Juraci Paixão Kröhling <[email protected]>
I'll rebase the go-work PR today and figure out what else is needed (build, release, ...). @bryan-aguilar, could you help me with this by assessing what needs to change regarding tooling? @codeboten, any hints you can give me as part of a similar PR you have for the contrib? |
I created an issue against |
@jpkrohling here's what i've done so far in my pr open-telemetry/opentelemetry-collector-contrib#10904:
One thing I've noticed is that the It's unclear to me whether this is a problem or not. I tested making a change locally to a component used by another module, and building the module picked up the local change, which is what we want. Some of the things I have left to check on my list:
|
Other question:
|
Thanks, @codeboten. That's almost verbatim what I did, including the manual test to validate that changes in one module are visible in another. I'll check dependabot, and I have not found evidence that I remember seeing that there's something special about releasing modules that are part of workspaces, but I'll read the docs again and summarize my understanding. |
Based on what I'm reading here, it seems that in order for us to make use of go workspaces, we would have to release any modules that have dependencies before being able to update the dependencies themselves to that version. If so this seems like it will complicate the process quite a bit. |
I was able to positively confirm that all modules had some effect when added to the go.work. For instance: ``` $ make install-tools cd ./internal/tools && go install github.com/client9/misspell/cmd/misspell cd ./internal/tools && go install github.com/golangci/golangci-lint/cmd/golangci-lint no required module provides package github.com/golangci/golangci-lint/cmd/golangci-lint; to add it: go get github.com/golangci/golangci-lint/cmd/golangci-lint make: *** [Makefile:130: install-tools] Error 1 $ go work use internal/tools/ $ make install-tools 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/ory/go-acc 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 github.com/wadey/gocovmerge cd ./internal/tools && go install go.opentelemetry.io/build-tools/checkdoc cd ./internal/tools && go install go.opentelemetry.io/build-tools/semconvgen cd ./internal/tools && go install golang.org/x/exp/cmd/apidiff cd ./internal/tools && go install golang.org/x/tools/cmd/goimports cd ./internal/tools && go install github.com/jcchavezs/porto/cmd/porto cd ./internal/tools && go install go.opentelemetry.io/build-tools/multimod ``` Fixes open-telemetry#5991 Signed-off-by: Juraci Paixão Kröhling <[email protected]>
I ran a few experiments, and here's what I have to share at this point:
I'm now at a point where I'm doubting we will be gaining any improvements by using go.work, given that our main goal was to indeed reduce the replace statements across modules. I'm stopping the experiment here so that we can regroup and discuss what we want to do next. |
I'm at the same point in the contrib repo. Until we decide to automate the release of individual components (if we decide to do so), there seems to be very little to gain from workspaces if we end up having to use these replace statements anyways. |
I think this was worth the experiment, but it's clear by now that we aren't gaining much from using go workspaces. |
During the SIG meeting on August 10, we agreed that we'd do a proof-of-concept of Go Workspaces to simplify the management of versions (especially replaces statements) in the Go modules for a repository.
I'll work on the PoC, while @bryan-aguilar was requested to help with the tooling, given Bryan's experience with similar tools.
The text was updated successfully, but these errors were encountered: