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

Cant build from a go workspace #970

Open
gedw99 opened this issue Dec 22, 2024 · 7 comments
Open

Cant build from a go workspace #970

gedw99 opened this issue Dec 22, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@gedw99
Copy link

gedw99 commented Dec 22, 2024

Describe the bug

Cant build Flowpipe from a go workspace. The others build fine.

cd flowpipe && make build
cd ui/form && corepack enable && yarn install && yarn build
➤ YN0000: · Yarn 4.5.0
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed
➤ YN0000: ┌ Post-resolution validation
➤ YN0086: │ Some peer dependencies are incorrectly met by dependencies; run yarn explain peer-requirements for details.
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed
➤ YN0000: ┌ Link step
➤ YN0007: │ esbuild@npm:0.21.5 must be built because it never has been before or the last one failed
➤ YN0000: └ Completed in 3s 705ms
➤ YN0000: · Done with warnings in 3s 949ms
vite v5.4.6 building for production...
✓ 305 modules transformed.
dist/index.html                   0.92 kB │ gzip:   0.38 kB
dist/assets/index-DWk11KcD.css   11.35 kB │ gzip:   2.93 kB
dist/assets/index-9Z-GHPyy.js   392.95 kB │ gzip: 133.54 kB
✓ built in 1.00s
go build .
# github.com/turbot/flowpipe/internal/docker
internal/docker/docker.go:99:10: undefined: client.WithHostFromEnv
internal/docker/docker.go:100:10: undefined: client.WithVersionFromEnv
internal/docker/docker.go:101:10: undefined: client.WithTLSClientConfigFromEnv
internal/docker/docker.go:140:57: undefined: image.PullOptions
internal/docker/docker.go:171:60: undefined: container.ListOptions
internal/docker/docker.go:178:59: undefined: container.RemoveOptions
internal/docker/docker.go:193:48: undefined: image.ListOptions
internal/docker/docker.go:201:27: undefined: image.RemoveOptions
internal/docker/docker.go:264:27: undefined: container.ListOptions
internal/docker/docker.go:282:52: undefined: container.StopOptions
internal/docker/docker.go:282:52: too many errors

Flowpipe version (flowpipe -v)

v1.0.2

Use this as a full reproduction...

# https://github.com/turbot/steampipe/releases/tag/v1.0.1
git clone https://github.com/turbot/steampipe -b v1.0.1

# https://github.com/turbot/pipe-fittings
# needed by the others below.
# https://github.com/turbot/pipe-fittings/releases/tag/v1.6.6
git clone https://github.com/turbot/pipe-fittings -b v1.6.6

# https://github.com/turbot/flowpipe/releases/tag/v1.0.2
git clone https://github.com/turbot/flowpipe -b v1.0.2

# https://github.com/turbot/powerpipe/releases/tag/v1.0.1
git clone https://github.com/turbot/powerpipe -b v1.0.1

touch go.work
go work use steampipe
go work use pipe-fittings
go work use flowpipe
go work use powerpipe
cd steampipe && go install .
# brew install turbot/tap/flowpipe
cd flowpipe && $(MAKE) build
cd flowpipe && go install .
cd powerpipe && go install .

To reproduce

All above...

Expected behavior

flow pipe builds. powerpipe and steam pipe builds fine.

Additional context

Mac m2.

I checked and the brew install version is the same version of the tag I am using.

@gedw99 gedw99 added the bug Something isn't working label Dec 22, 2024
@gedw99 gedw99 changed the title Cant bulild wishing a go workspace Cant build from a go workspace Dec 22, 2024
@vhadianto
Copy link
Contributor

Hi @gedw99 thanks for the report however I'm unable to reproduce this.

I get the v1.0.2 tag (faa04419) and ran the build target in the Makefile:

flowpipe (faa04419) $ make build
cd ui/form && corepack enable && yarn install && yarn build
➤ YN0088: A new stable version of Yarn is available: 4.5.3!
➤ YN0088: Upgrade now by running yarn set version 4.5.3

➤ YN0000: · Yarn 4.5.0
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed
➤ YN0000: ┌ Post-resolution validation
➤ YN0086: │ Some peer dependencies are incorrectly met by dependencies; run yarn explain peer-requirements for details.
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0013: │ 3 packages were added to the project (+ 4.51 MiB).
➤ YN0000: └ Completed in 0s 462ms
➤ YN0000: ┌ Link step
➤ YN0007: │ esbuild@npm:0.21.5 must be built because it never has been before or the last one failed
➤ YN0000: └ Completed in 4s 466ms
➤ YN0000: · Done with warnings in 5s 39ms
vite v5.4.6 building for production...
✓ 305 modules transformed.
dist/index.html                   0.92 kB │ gzip:   0.38 kB
dist/assets/index-DWk11KcD.css   11.35 kB │ gzip:   2.92 kB
dist/assets/index-9Z-GHPyy.js   392.95 kB │ gzip: 134.23 kB
✓ built in 1.23s
go build .
flowpipe (faa04419) $ 

The error message that you get: client.WithHostFromEnv definitely exist in Docker v27.1.2 which is referenced in Flowpipe's go.mod.

Can you please run go mod tidy in Flowpipe directory please? And if does change something can you let me know what's changed?

Thanks

@gedw99
Copy link
Author

gedw99 commented Dec 23, 2024

Thanks

Did you do it inside a golang workspace with go work ?

I deliberately put that in the reproduction ..

@vhadianto
Copy link
Contributor

I see, yes apology I missed the go workspace bit.

Confirmed that I can reproduce the error, the exact same error message. There must be something in Go workspace and the build order that is causing this issue.

I'll have a look.

@vhadianto
Copy link
Contributor

I think this is because Steampipe has this replace directive in its go.mod file:

replace (
	github.com/c-bata/go-prompt => github.com/turbot/go-prompt v0.2.6-steampipe.0.0.20221028122246-eb118ec58d50
	github.com/docker/distribution => github.com/distribution/distribution v2.7.1+incompatible
	github.com/docker/docker => github.com/moby/moby v20.10.17+incompatible
<snip>

https://github.com/turbot/steampipe/blob/v1.0.1/go.mod#L8

It's replacing github.com/docker/docker with an old version of github.com/moby/moby. I don't know the motivation, or if it's still valid today. It was introduced over a year ago here: turbot/steampipe@1207998

Hopefully @kaidaguerre can weigh in here.

@gedw99
Copy link
Author

gedw99 commented Dec 23, 2024

ah I think thats where the issue is.

its why I use go.work. It forces isolation.

If you can let me know I would appreciate it.

@kaidaguerre
Copy link
Contributor

Hmm I'll have to have a dig to understand if that was a required change and if so, why. Let me get back to you

@pskrbasu
Copy link
Contributor

pskrbasu commented Jan 7, 2025

@gedw99 I took a look at the replaces that we have, and it seems like we require the github.com/c-bata/go-prompt replace, but we don't need the others anymore. I have made the changes in a branch and pushed a tag for you to verify if it builds in your setup now.
https://github.com/turbot/steampipe/releases/tag/v1.0.2-rc.0
Can you please try it out and let us know?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants