Skip to content

Go SDK: split out from Engine - #3425

Merged
aluzzardi merged 4 commits into
dagger:mainfrom
aluzzardi:repo-restructuring
Oct 20, 2022
Merged

aluzzardi merged 4 commits into
dagger:mainfrom
aluzzardi:repo-restructuring

Conversation

@aluzzardi

@aluzzardi aluzzardi commented Oct 18, 2022 •

Copy link
Copy Markdown
Contributor
  • Split Go SDK into its own module
    • Using the dagger.io/dagger vanity URL
    • Will be tagged independently as go/sdk/v0.1.*
  • Change root module to use github.com/dagger/dagger
    • Will be tagged as v0.3.*
  • Various fixes to make this happen (CI, etc)

@aluzzardi
aluzzardi force-pushed the repo-restructuring branch 8 times, most recently from 71db401 to 60babf2 Compare October 20, 2022 17:21
@aluzzardi
aluzzardi marked this pull request as ready for review October 20, 2022 17:21
@aluzzardi
aluzzardi force-pushed the repo-restructuring branch 2 times, most recently from 30860e3 to e3b41bb Compare October 20, 2022 18:10
Signed-off-by: Andrea Luzzardi <[email protected]>
Signed-off-by: Andrea Luzzardi <[email protected]>
@aluzzardi
aluzzardi force-pushed the repo-restructuring branch 2 times, most recently from 0b6402d to d2a2fd6 Compare October 20, 2022 19:03

@vito vito left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Comment thread sdk/go/client.go Outdated

@vito vito Oct 20, 2022 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guessing this had to change because go run doesn't work across module boundaries?

Is this the new flow for regenerating the SDK?

go install ./cmd/dagger
go generate ./...

If so that's fine (I assumed it already worked that way). Or does go generate similarly not traverse across module boundaries?

Side note: since we have replace github.com/dagger/dagger => ../ in the SDK go.mod, I wonder if this works?:

//go:generate go run github.com/dagger/dagger/cmd/dagger ...

If the steps are anything more complicated than above I humbly request a script. :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guessing this had to change because go run doesn't work across module boundaries?

Correct

Is this the new flow for regenerating the SDK?

Worse.

cd sdk/go
go generate ./...

./.. doesn't cross the go.mod boundary

Side note: since we have replace github.com/dagger/dagger => ../ in the SDK go.mod, I wonder if this works?:

Ah! Perhaps! Let me try

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the steps are anything more complicated than above I humbly request a script. :)

Yes. Right now it looks silly, but go generate wasn't going to work with the Python and Node SDK anyway, so we needed a script anyway.

There's still time to back down from this sub-module if it becomes too annoying :)

@aluzzardi

Copy link
Copy Markdown
Contributor Author

/cc @kpenfound @vikram-dagger

This effectively changes the import path from go.dagger.io/dagger/sdk/go/dagger to dagger.io/dagger

@aluzzardi
aluzzardi merged commit 04ba837 into dagger:main Oct 20, 2022
@aluzzardi
aluzzardi deleted the repo-restructuring branch October 20, 2022 19:55
@dolanor

dolanor commented Oct 20, 2022

Copy link
Copy Markdown
Contributor

I'm gonna try some go modules versionning and go.work, see how it could work for us.

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

Successfully merging this pull request may close these issues.

3 participants