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

build: migrate to go modules #35426

Closed
lopezator opened this issue Mar 5, 2019 · 12 comments
Closed

build: migrate to go modules #35426

lopezator opened this issue Mar 5, 2019 · 12 comments
Assignees
Labels
A-build-system C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)

Comments

@lopezator
Copy link
Contributor

lopezator commented Mar 5, 2019

Now that #34919 #33709 and cockroachdb/apd#83 got merged, it will be technically possible to replace dep in favor of modules, so that tools vendorizing cockroachdb/cockroachdb-gen (and using modules), could do this seemlessly.

I got it working in:

https:/lopezator/sqlfmt/blob/master/go.mod

By forking cockroach-gen, and adding:

https:/lopezator/cockroach/blob/master/go.mod

But it's an ugly hack that could be avoided if cockroach && cockroach-gen switches to go modules.

@awoods187 awoods187 added the C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) label Mar 6, 2019
@knz knz changed the title Migrate to go modules build: migrate to go modules Mar 13, 2019
@knz
Copy link
Contributor

knz commented Mar 13, 2019

Thanks for your report! IT's a bit late to do this in the 19.1 release cycle, but we'll seriously consider this for 19.2 (the next one).

@akshayjshah
Copy link
Contributor

I'd also love this - I'm trying to use github.com/cockroach/cockroachdb/pkg/sql/parser to test that my migrations are idempotent, but it's difficult to install using modules.

@lopezator
Copy link
Contributor Author

lopezator commented Mar 3, 2020

Now that modules is considered stable on 1.14 maybe it's time to reactivate this.

@AndreySerebrovC2M
Copy link

Can I help to migrate to go modules?

@knz
Copy link
Contributor

knz commented Mar 11, 2020

You can certainly help! Just be aware that it's likely a relatively complex task.

@AndreySerebrovC2M
Copy link

You can certainly help! Just be aware that it's likely a relatively complex task.

I want to. But I don't fill the power to lead this process)

@knz
Copy link
Contributor

knz commented Mar 11, 2020

FYI the entire crdb team is currently busy with the upcoming 20.1 release and we won't be leading this either for a month or two.

@AndreySerebrovC2M
Copy link

FYI the entire crdb team is currently busy with the upcoming 20.1 release and we won't be leading this either for a month or two.

Ok! I'm ready to take part in this process

@IliaRusin
Copy link

I'd love to help you with this task!

@alexander-manley
Copy link

CRDB version 20.1 has been released. Adding go.mod and go.sum files to the root of the repository would be a good initial step. Google senior engineer Jean de Klerk, has authored a starting reference on how to approach the move to the official/standard approach to modularizing an existing codebase: https://blog.golang.org/migrating-to-go-modules

@knz knz removed this from the 19.2 milestone May 18, 2020
@knz
Copy link
Contributor

knz commented May 18, 2020

At this time there is still a lot of work to be done due to the following:

  • a lot of code is auto-generated, with complex, relatively deep build pipelines that are incompatible with "go generate". It might be possible to work around this by mirroring the tree into a separate tree with only generated files, for example this: http:/cockroachdb/cockroach-gen

  • a number of vendored dependencies are currently incompatible with go modules. These will need to be selectively upgraded, and the code in cockroachdb adapted to use their new APIs (and tested).

@bobvawter bobvawter removed their assignment May 27, 2020
@otan
Copy link
Contributor

otan commented Jun 25, 2020

image

@otan otan closed this as completed Jun 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-build-system C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)
Projects
None yet
Development

No branches or pull requests

9 participants