Bug#922842: ITP: golang-github-containers-image -- Work with containers' images

2019-04-30 Thread Cirujano Cuesta, Silvano
On Tue, 2019-04-30 at 07:20 -0400, Reinhard Tartler wrote:
> 
> I'm not familiar with building packages that way, please excuse my ignorance, 
> but I'd rather focus on tools that I can actually use for uploading packages 
> to Debian. I'm afraid that I'm probably
> unable to help you with this baseimage and/or approach to build packages.

I can understand that, but my problem is that I don't know 'sbuild' and while 
trying to set it up I'm facing too many unknown tools and proxy issues :-/

> 
> > I prefer not to use too much magic (although using containers involves 
> > per-se some magic) to better understand what's going on.
> 
> Same here. I took a look at 
> https://github.com/debuerreotype/docker-debian-artifacts/blob/064f343bfa6ebf043aac2bbd4c870256cfe82f5a/sid/slim/Dockerfile
>  and it does look pretty magical to me ;-)

How that root-filesystem is built is much magic, I agree with you.

But you end up with a Debian root-filesystem as small as ~60MB and very very 
few packages installed.
And once I have the container and I'm building in it, there's no much more 
magic involved anymore.

> 
> There is not much magic with sbuild, please see 
> https://wiki.debian.org/sbuild to get started. 

As mentioned above, setting up 'schroot', configuring the proxy, ... it's not 
that easy if you have never done it.

> 
> > I don't think that it's a language barrier.
> > But possibly an expertise barrier: my expertise on building Debian packages 
> > (specially for Go) is not as extensive as yours :-)
> 
> I don't claim extensive experience with Go, or Go packaging, but I think I do 
> have a reasonable grasp of Debian packaging tools.

It's good to have someone with your expertise working on it!

> 
> What I find puzzling in your buildlog is that while you do use 
> dpkg-buildpackage, it fails to apply the quilt patches.

'dpkg-buildpackage' doesn't patch for you, you have to do it on advance 
yourself.

> 
> Good luck!
> -rt

Even with a separate workflow, I'm still the opinion that the patch of 
'ostree/ostree_src.go' [1] results in invalid Go code.

Can you somehow see the intermediate files being created? Aren't you getting an 
empty 'ostree/ostree_src.go' file? That should make the Go compilation fail.
I wonder if some 'sbuild' magic is getting rid of the empty Go file before the 
compilation starts and therefore you don't face the issue...

Unfortunately I don't have that much time work on confirming the issue.
So if you can build it and provide the result via the repository mentioned in 
[2], then I suppose it's fine for me :-D

[2] https://github.com/containers/libpod/issues/1742#issuecomment-487910563

Cheers,
  Silvano

Bug#922842: ITP: golang-github-containers-image -- Work with containers' images

2019-04-30 Thread Reinhard Tartler



On 4/29/19 8:09 AM, Cirujano Cuesta, Silvano wrote:

> On Mon, 2019-04-29 at 07:29 -0400, Reinhard Tartler wrote:
>> I'm having a hard time understanding what issue you are facing with and what 
>> you mean fix "fix manually". How are you building the package? Are you using 
>> git-buildpackage, sbuild or pbuilder? I'd
>> strongly recommend to do so, because if you were, I cannot see how you 
>> possibly could run into such issues.
> 
> I'm using none of them, I'm building "the hard way": in a container (from 
> Docker base image debian:sid-slim) with a script that runs the individual 
> steps and builds with 'dpkg-buildpackage'.
> It should be possible to build these packages this way, right? It usually 
> works.

I'm not familiar with building packages that way, please excuse my ignorance, 
but I'd rather focus on tools that I can actually use for uploading packages to 
Debian. I'm afraid that I'm probably unable to help you with this baseimage 
and/or approach to build packages.

> I prefer not to use too much magic (although using containers involves per-se 
> some magic) to better understand what's going on.

Same here. I took a look at 
https://github.com/debuerreotype/docker-debian-artifacts/blob/064f343bfa6ebf043aac2bbd4c870256cfe82f5a/sid/slim/Dockerfile
 and it does look pretty magical to me ;-)

There is not much magic with sbuild, please see https://wiki.debian.org/sbuild 
to get started. 

> What I meant with "fix manually" is executing "rm ostree/ostree_src.go" right 
> after patching and before building.
> 
> I don't know if the 'magic' of any of the mentioned tools is just silently 
> fixing the issue for you and that's why you are not facing it...
> 
>> In any case, a full buildlog, similar to what I attached, could be helpful. 
>> If English is a language barrier, try explaining in German.
> 
> I don't think that it's a language barrier.
> But possibly an expertise barrier: my expertise on building Debian packages 
> (specially for Go) is not as extensive as yours :-)

I don't claim extensive experience with Go, or Go packaging, but I think I do 
have a reasonable grasp of Debian packaging tools.

What I find puzzling in your buildlog is that while you do use 
dpkg-buildpackage, it fails to apply the quilt patches.

Good luck!
-rt



Bug#922842: ITP: golang-github-containers-image -- Work with containers' images

2019-04-29 Thread Cirujano Cuesta, Silvano
Basically what happens is that the patch 'ostree-stub.patch' produces an empty 
file 'ostree_src.go' and the compiler doesn't accept an empty Go file.

My affirmation WRT the path can be confirmed by reading the patch itself [2] or 
just applying it.

[2] 
https://salsa.debian.org/go-team/packages/golang-github-containers-image/blob/master/debian/patches/ostree-stub.patch#L1104

The error reported by the compiler is (see full buildlog below):
can't load package: package github.com/containers/image/ostree: 

obj-x86_64-linux-gnu/src/github.com/containers/image/ostree/ostree_src.go:1:1: 
expected 'package', found 'EOF'

On Mon, 2019-04-29 at 07:29 -0400, Reinhard Tartler wrote:
> I'm having a hard time understanding what issue you are facing with and what 
> you mean fix "fix manually". How are you building the package? Are you using 
> git-buildpackage, sbuild or pbuilder? I'd
> strongly recommend to do so, because if you were, I cannot see how you 
> possibly could run into such issues.

I'm using none of them, I'm building "the hard way": in a container (from 
Docker base image debian:sid-slim) with a script that runs the individual steps 
and builds with 'dpkg-buildpackage'.
It should be possible to build these packages this way, right? It usually works.

I prefer not to use too much magic (although using containers involves per-se 
some magic) to better understand what's going on.

What I meant with "fix manually" is executing "rm ostree/ostree_src.go" right 
after patching and before building.

I don't know if the 'magic' of any of the mentioned tools is just silently 
fixing the issue for you and that's why you are not facing it...

> In any case, a full buildlog, similar to what I attached, could be helpful. 
> If English is a language barrier, try explaining in German.

I don't think that it's a language barrier.
But possibly an expertise barrier: my expertise on building Debian packages 
(specially for Go) is not as extensive as yours :-)

---

dpkg-buildpackage: info: source package golang-github-containers-image
dpkg-buildpackage: info: source version 1.5-1
dpkg-buildpackage: info: source distribution UNRELEASED
dpkg-buildpackage: info: source changed by Reinhard Tartler 

dpkg-buildpackage: info: host architecture amd64
 dpkg-source --before-build .
 debian/rules clean
dh clean --buildsystem=golang --with=golang
   dh_auto_clean -O--buildsystem=golang
   dh_autoreconf_clean -O--buildsystem=golang
   dh_clean -O--buildsystem=golang
 debian/rules build
dh build --buildsystem=golang --with=golang
   dh_update_autotools_config -O--buildsystem=golang
   dh_autoreconf -O--buildsystem=golang
   dh_auto_configure -O--buildsystem=golang
   debian/rules override_dh_auto_build
make[1]: Entering directory '/debian-packages/golang-github-containers-image'
dh_auto_build -O--buildsystem=golang -- -tags "containers_image_ostree_stub"
can't load package: package github.com/containers/image/ostree: 
obj-x86_64-linux-gnu/src/github.com/containers/image/ostree/ostree_src.go:1:1: 
expected 'package', found 'EOF'
cd obj-x86_64-linux-gnu && go install 
-gcflags=all=\"-trimpath=/debian-packages/golang-github-containers-image/obj-x86_64-linux-gnu/src\"
 
-asmflags=all=\"-trimpath=/debian-packages/golang-github-containers-image/obj-x86_64-linux-gnu/src\"
 -v -p 4 -tags containers_image_ostree_stub github.com/containers/image 
github.com/containers/image/copy github.com/containers/image/directory 
github.com/containers/image/directory/explicitfilepath 
github.com/containers/image/docker github.com/containers/image/docker/archive 
github.com/containers/image/docker/daemon 
github.com/containers/image/docker/policyconfiguration 
github.com/containers/image/docker/reference 
github.com/containers/image/docker/tarfile github.com/containers/image/image 
github.com/containers/image/internal/testing/explicitfilepath-tmpdir 
github.com/containers/image/internal/testing/mocks 
github.com/containers/image/internal/tmpdir 
github.com/containers/image/manifest github.com/containers/image/oci 
github.com/containers/image/oci/archive 
github.com/containers/image/oci/internal github.com/containers/image/oci/layout 
github.com/containers/image/pkg/blobinfocache 
github.com/containers/image/pkg/compression 
github.com/containers/image/pkg/docker/config 
github.com/containers/image/pkg/strslice 
github.com/containers/image/pkg/sysregistries 
github.com/containers/image/pkg/sysregistriesv2 
github.com/containers/image/pkg/tlsclientconfig 
github.com/containers/image/signature github.com/containers/image/storage 
github.com/containers/image/tarball github.com/containers/image/transports 
github.com/containers/image/transports/alltransports 
github.com/containers/image/types github.com/containers/image/version
github.com/containers/image
errors
internal/race
internal/cpu
runtime/internal/sys
runtime/internal/atomic
sync/atomic
unicode
unicode/utf8
internal/testlog
internal/bytealg
math
math/bits
encoding
unicode/utf16

Bug#922842: ITP: golang-github-containers-image -- Work with containers' images

2019-04-29 Thread Reinhard Tartler
I'm having a hard time understanding what issue you are facing with and what 
you mean fix "fix manually". How are you building the package? Are you using 
git-buildpackage, sbuild or pbuilder? I'd strongly recommend to do so, because 
if you were, I cannot see how you possibly could run into such issues.

In any case, a full buildlog, similar to what I attached, could be helpful. If 
English is a language barrier, try explaining in German.

Best,
Reinhard

On April 29, 2019 7:21:09 AM EDT, "Cirujano Cuesta, Silvano" 
 wrote:
>Commit c17b0346 is changing the patching of the 'ostree' directory in a
>way that generates an invalid Go package.
>
>Instead of removing 'ostree/ostree_src.go', it's replacing it with an
>empty file that breaks 'go build'.
>
>If I manually fix it, it builds successfully.
>
>Cheers,
>  Silvano
>
>[1]
>https://salsa.debian.org/go-team/packages/golang-github-containers-image/commit/c17b0346163f88028e5675600865ac2eb95e051d

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.



Bug#922842: ITP: golang-github-containers-image -- Work with containers' images

2019-04-29 Thread Cirujano Cuesta, Silvano
Commit c17b0346 is changing the patching of the 'ostree' directory in a way 
that generates an invalid Go package.

Instead of removing 'ostree/ostree_src.go', it's replacing it with an empty 
file that breaks 'go build'.

If I manually fix it, it builds successfully.

Cheers,
  Silvano

[1] 
https://salsa.debian.org/go-team/packages/golang-github-containers-image/commit/c17b0346163f88028e5675600865ac2eb95e051d

Bug#922842: ITP: golang-github-containers-image -- Work with containers' images

2019-04-29 Thread Cirujano Cuesta, Silvano
On Fri, 2019-04-26 at 21:50 -0400, Reinhard Tartler wrote:
> Are you sure that you applied the patches from 'debian/patches'?

Ups, no. That's probably the issue.

I'll let you know if it works or not, once I've tested it.
  Silvano

Bug#922842: ITP: golang-github-containers-image -- Work with containers' images

2019-04-26 Thread Cirujano Cuesta, Silvano
Build is failing. If I'm right, fetching the vendor components is missing. But 
I don't know how to get it in...

BTW, please make sure that your packaging is not affected by issue 620 [1] of 
containers/image. The environment where I'm testing is, on purpose, a pristine 
Debian installation where GOBIN is not part
of PATH.

[1] https://github.com/containers/image/issues/620

  Silvano

This is the error message:

dh_auto_build -O--buildsystem=golang -- -tags "containers_image_ostree_stub"
cd obj-x86_64-linux-gnu && go install 
-gcflags=all=\"-trimpath=/debian-packages/golang-github-containers-image/obj-x86_64-linux-gnu/src\"
 -asmflags=all=\"-trimpath=/debian-packages/golang-
github-containers-image/obj-x86_64-linux-gnu/src\" -v -p 4 -tags 
containers_image_ostree_stub github.com/containers/image 
github.com/containers/image/copy github.com/containers/image/directory
github.com/containers/image/directory/explicitfilepath 
github.com/containers/image/docker github.com/containers/image/docker/archive 
github.com/containers/image/docker/daemon
github.com/containers/image/docker/policyconfiguration 
github.com/containers/image/docker/reference 
github.com/containers/image/docker/tarfile github.com/containers/image/image
github.com/containers/image/internal/testing/explicitfilepath-tmpdir 
github.com/containers/image/internal/testing/mocks 
github.com/containers/image/internal/tmpdir github.com/containers/image/manifest
github.com/containers/image/oci github.com/containers/image/oci/archive 
github.com/containers/image/oci/internal github.com/containers/image/oci/layout 
github.com/containers/image/openshift
github.com/containers/image/ostree 
github.com/containers/image/pkg/blobinfocache 
github.com/containers/image/pkg/compression 
github.com/containers/image/pkg/docker/config
github.com/containers/image/pkg/strslice 
github.com/containers/image/pkg/sysregistries 
github.com/containers/image/pkg/sysregistriesv2 
github.com/containers/image/pkg/tlsclientconfig
github.com/containers/image/signature github.com/containers/image/storage 
github.com/containers/image/tarball github.com/containers/image/transports
github.com/containers/image/transports/alltransports 
github.com/containers/image/types github.com/containers/image/version
src/github.com/containers/image/signature/mechanism_gpgme.go:11:2: cannot find 
package "github.com/mtrmac/gpgme" in any of:
/usr/lib/go-1.11/src/github.com/mtrmac/gpgme (from $GOROOT)

/debian-packages/golang-github-containers-image/obj-x86_64-linux-gnu/src/github.com/mtrmac/gpgme
 (from $GOPATH)
src/github.com/containers/image/openshift/openshift-copies.go:23:2: cannot find 
package "k8s.io/client-go/util/homedir" in any of:
/usr/lib/go-1.11/src/k8s.io/client-go/util/homedir (from $GOROOT)

/debian-packages/golang-github-containers-image/obj-x86_64-linux-gnu/src/k8s.io/client-go/util/homedir
 (from $GOPATH)
dh_auto_build: cd obj-x86_64-linux-gnu && go install 
-gcflags=all=\"-trimpath=/debian-packages/golang-github-containers-image/obj-x86_64-linux-gnu/src\"
 -asmflags=all=\"-trimpath=/debian-
packages/golang-github-containers-image/obj-x86_64-linux-gnu/src\" -v -p 4 
-tags containers_image_ostree_stub github.com/containers/image 
github.com/containers/image/copy
github.com/containers/image/directory 
github.com/containers/image/directory/explicitfilepath 
github.com/containers/image/docker github.com/containers/image/docker/archive
github.com/containers/image/docker/daemon 
github.com/containers/image/docker/policyconfiguration 
github.com/containers/image/docker/reference 
github.com/containers/image/docker/tarfile
github.com/containers/image/image 
github.com/containers/image/internal/testing/explicitfilepath-tmpdir 
github.com/containers/image/internal/testing/mocks 
github.com/containers/image/internal/tmpdir
github.com/containers/image/manifest github.com/containers/image/oci 
github.com/containers/image/oci/archive 
github.com/containers/image/oci/internal github.com/containers/image/oci/layout
github.com/containers/image/openshift github.com/containers/image/ostree 
github.com/containers/image/pkg/blobinfocache 
github.com/containers/image/pkg/compression
github.com/containers/image/pkg/docker/config 
github.com/containers/image/pkg/strslice 
github.com/containers/image/pkg/sysregistries 
github.com/containers/image/pkg/sysregistriesv2
github.com/containers/image/pkg/tlsclientconfig 
github.com/containers/image/signature github.com/containers/image/storage 
github.com/containers/image/tarball github.com/containers/image/transports
github.com/containers/image/transports/alltransports 
github.com/containers/image/types github.com/containers/image/version returned 
exit code 1
make[1]: *** [debian/rules:11: override_dh_auto_build] Error 1

On Thu, 2019-02-21 at 06:49 -0500, Reinhard Tartler wrote:
> Package: wnpp
> Severity: wishlist
> Owner: Reinhard Tartler 
> 
> * Package name: golang-github-containers-image
>   Version : 

Bug#922842: ITP: golang-github-containers-image -- Work with containers' images

2019-02-21 Thread Reinhard Tartler
Package: wnpp
Severity: wishlist
Owner: Reinhard Tartler 

* Package name: golang-github-containers-image
  Version : 1.2+git20181221.f0cbc16-1
  Upstream Author : Antonio Murdaca 
Brandon Philips 
Miloslav Trmac 
Dan Walsh 
Nalin Dahyabhai 
* URL : https://github.com/containers/image
* License : Apache-2.0
  Programming Lang: Go
  Description : Work with containers' images

 This library is aimed at working in various way with containers' images
 and container image registries. Itallows application to pull and push
 images from container image registries, like the upstream docker
 registry, and also implements "simple image signing".

Please see
https://www.redhat.com/en/blog/working-container-storage-library-and-tools-red-hat-enterprise-linux
for some more background on this library. It is a dependency for
skopeo, podman and buildah.

This package is going to be maintained within the go team on salsa:
https://salsa.debian.org/go-team/packages/golang-github-containers-image