docker / libcompose

*Unmaintained/Deprecated* An experimental go library providing Compose-like functionality
https://godoc.org/github.com/docker/libcompose
Apache License 2.0
585 stars 191 forks source link

Build fails on a fresh checkout #503

Closed the-destro closed 6 years ago

the-destro commented 6 years ago

Feshly fetched via dep:


# amhappy2/vendor/github.com/docker/libcompose/config
config/schema_helpers.go:50:73: cannot use environmentFormatChecker literal (type environmentFormatChecker) as type gojsonschema.FormatChecker in argument to gojsonschema.FormatCheckers.Add:
    environmentFormatChecker does not implement gojsonschema.FormatChecker (wrong type for IsFormat method)
        have IsFormat(string) bool
        want IsFormat(interface {}) bool
config/schema_helpers.go:51:61: cannot use portsFormatChecker literal (type portsFormatChecker) as type gojsonschema.FormatChecker in argument to gojsonschema.FormatCheckers.Add:
    portsFormatChecker does not implement gojsonschema.FormatChecker (wrong type for IsFormat method)
        have IsFormat(string) bool
        want IsFormat(interface {}) bool
config/schema_helpers.go:52:62: cannot use portsFormatChecker literal (type portsFormatChecker) as type gojsonschema.FormatChecker in argument to gojsonschema.FormatCheckers.Add:
    portsFormatChecker does not implement gojsonschema.FormatChecker (wrong type for IsFormat method)
        have IsFormat(string) bool
        want IsFormat(interface {}) bool
# amhappy2/vendor/github.com/docker/libcompose/docker/builder
docker/builder/builder.go:99:12: cannot use d.BuildArgs (type map[string]string) as type map[string]*string in field value```
ryanmiville commented 6 years ago

@the-destro Not sure if you found a workaround, but in the meantime, I got around the issue by clearing out my vendor directory, running go get github.com/docker/libcompose and copying from my $GOPATH/src into my vendor directory. I'm very new to Go so there's probably a better answer.

ksinica commented 6 years ago

You can try to add the following constraint to Gopkg.toml (since you're using dep):

[[override]]
  name = "github.com/xeipuuv/gojsonschema"
  revision = "0c8571ac0ce161a5feb57375a9cdf148c98c0f70"

0c8571ac0ce161a5feb57375a9cdf148c98c0f70 is just before https://github.com/xeipuuv/gojsonschema/commit/90a5d0892ddc0fe47d6d68e7b93f0d67e18e6cbe which is a breaking change.

the-destro commented 6 years ago

Thanks!

Sent from my iPhone

On Feb 13, 2018, at 8:31 AM, Krzysztof Sinica notifications@github.com wrote:

You can try to add the following constraint to Gopkg.toml (since you're using dep):

[[constraint]] name = "github.com/xeipuuv/gojsonschema" revision = "0c8571ac0ce161a5feb57375a9cdf148c98c0f70" 0c8571ac0ce161a5feb57375a9cdf148c98c0f70 is just before xeipuuv/gojsonschema@90a5d08 which is a breaking change.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

SeriyBg commented 5 years ago

I'm trying to use libcompose v0.4.0 inside of a go module project and getting the same errors. To resolve the gojsonschema.FormatChecker error I have run go get -v github.com/xeipuuv/gojsonschema@0c8571a which set the right revision to my dependencies. But now I'm still having the following ones:

# github.com/docker/libcompose/docker/builder
../../../go/pkg/mod/github.com/docker/libcompose@v0.4.0/docker/builder/builder.go:99:3: cannot use d.BuildArgs (type map[string]string) as type map[string]*string in field value
# github.com/docker/libcompose/docker/volume
../../../go/pkg/mod/github.com/docker/libcompose@v0.4.0/docker/volume/volume.go:72:39: undefined: types.VolumeCreateRequest
# github.com/docker/libcompose/docker/container
../../../go/pkg/mod/github.com/docker/libcompose@v0.4.0/docker/container/functions.go:27:3: unknown field 'Filter' in struct literal of type types.ContainerListOptions

I cannot find which version of github.com/docker/docker should I use. Can somebody help me?

thecampagnards commented 5 years ago

Does anyone have an update?

Or can send me his Gopkg.toml Please

ajmoorexyz commented 4 years ago

https://github.com/docker/libcompose/commit/6cfd21b322e96c63cbd17153850cc626d8e2600b#diff-e07f928fd25386d109b941cd8412d2d2