containers / buildah

A tool that facilitates building OCI images.
https://buildah.io
Apache License 2.0
7.41k stars 783 forks source link

Please avoid circular dependency on containers/libpod #1437

Closed siretart closed 5 years ago

siretart commented 5 years ago

I think this is a very similar issue to https://github.com/containers/storage/issues/293

I've tried to vendor in the projects docker/docker and containers/libpod, and I end up with build failures like this:

# github.com/containers/buildah/imagebuildah                                                                                                                                                                       
src/github.com/containers/buildah/imagebuildah/build.go:838:49: cannot use *"github.com/containers/buildah/vendor/github.com/docker/docker/builder/dockerfile/parser".Node literal (type *"github.com/containers/b\
uildah/vendor/github.com/docker/docker/builder/dockerfile/parser".Node) as type *"github.com/openshift/imagebuilder/dockerfile/parser".Node in argument to ib.RequiresStart                                        
src/github.com/containers/buildah/imagebuildah/build.go:838:50: cannot use node.Children[i + 1:] (type []*"github.com/openshift/imagebuilder/dockerfile/parser".Node) as type []*"github.com/containers/buildah/ve\
ndor/github.com/docker/docker/builder/dockerfile/parser".Node in field value                                                                                                                                       
src/github.com/containers/buildah/imagebuildah/build.go:877:32: cannot use node (type *"github.com/openshift/imagebuilder/dockerfile/parser".Node) as type *"github.com/containers/buildah/vendor/github.com/docke\
r/docker/builder/dockerfile/parser".Node in argument to b.layerExists                                                                                                                                              
src/github.com/containers/buildah/imagebuildah/build.go:877:52: cannot use children[:i] (type []*"github.com/openshift/imagebuilder/dockerfile/parser".Node) as type []*"github.com/containers/buildah/vendor/gith\
ub.com/docker/docker/builder/dockerfile/parser".Node in argument to b.layerExists                                                                                                                                  
src/github.com/containers/buildah/imagebuildah/build.go:908:50: cannot use node (type *"github.com/openshift/imagebuilder/dockerfile/parser".Node) as type *"github.com/containers/buildah/vendor/github.com/docke\
r/docker/builder/dockerfile/parser".Node in argument to getCreatedBy                                                                                                                                               

I notice at least some work towards that goal (e.g. https://github.com/containers/buildah/commit/e7e4122e1fa1ded68e37aa165e241917ed0d7020) Maybe there is an existing issue that this can be marked as duplicate with?

How far are we from reaching this goal?

siretart commented 5 years ago

@vrothberg what's your opinion on this one?

vrothberg commented 5 years ago

@siretart, thanks for the report.

It's not entirely clear to me which projects have been used in which versions, so I have a hard time brain parsing the error. To me, it looks like you tried to compile libpod with a more recent version of docker/docker which will not work if the remaining parts of libpod/vendor remain untouched.

The latest changes in imagebuilder still need to be vendored into buildah and then buildah along with the new version of imagebuilder into libpod. It's a bit of a manual work left. I had my deep into containers/image last week but will find some cycles next week to cut a new release of imagebuilder (or @rhatdan) and do the vendor dance afterward.

Regarding the circular dependencies between buildah and libpod, I don't know the latest status. @rhatdan, how is this fight going?

siretart commented 5 years ago

Thanks for the update, Valentin,

I don't think there is a rush here, we are waiting for ftp-master to ACCEPT a container/storage (and a few dependencies for container/image) anyways. I'm trying to get ahead of the game and identify the next steps. It seems to me that resolving this circular dependency would be in everyone's interest, so let's focus on that. Anything I can assist with here?

vrothberg commented 5 years ago

Anything I can assist with here?

Your reports are incredibly helpful to identify problems. Let's continue :) Having those tools in Debian would be amazing and I think we're already improving trying to get them there. Thanks!

vrothberg commented 5 years ago

Closing the issue as it has been fixed in the meantime. Thanks for bringing it up!