public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Kacper Kowalik" <xarthisius@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: app-emulation/docker/, app-emulation/docker/files/
Date: Thu, 27 Aug 2015 15:42:52 +0000 (UTC)	[thread overview]
Message-ID: <1440690158.ebf518399f1b302b738d6da9afa0351f4035384a.xarthisius@gentoo> (raw)

commit:     ebf518399f1b302b738d6da9afa0351f4035384a
Author:     Kacper Kowalik <xarthisius <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 27 15:42:07 2015 +0000
Commit:     Kacper Kowalik <xarthisius <AT> gentoo <DOT> org>
CommitDate: Thu Aug 27 15:42:38 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ebf51839

Apply upstream patch fixing issue with go>=1.4. Fixes #558344

Package-Manager: portage-2.2.20

 app-emulation/docker/docker-1.8.1.ebuild           |  3 +-
 app-emulation/docker/files/15404-fix-go14_15.patch | 85 ++++++++++++++++++++++
 2 files changed, 87 insertions(+), 1 deletion(-)

diff --git a/app-emulation/docker/docker-1.8.1.ebuild b/app-emulation/docker/docker-1.8.1.ebuild
index 0fea9a3..73cc01d 100644
--- a/app-emulation/docker/docker-1.8.1.ebuild
+++ b/app-emulation/docker/docker-1.8.1.ebuild
@@ -20,7 +20,7 @@ else
 	[ "$DOCKER_GITCOMMIT" ] || die "DOCKER_GITCOMMIT must be added manually for each bump!"
 	inherit golang-vcs-snapshot
 fi
-inherit bash-completion-r1 linux-info multilib systemd udev user
+inherit eutils bash-completion-r1 linux-info multilib systemd udev user
 
 DESCRIPTION="Docker complements kernel namespacing with a high-level API which operates at the process level"
 HOMEPAGE="https://dockerproject.org"
@@ -170,6 +170,7 @@ pkg_setup() {
 
 src_prepare() {
 	cd "src/${EGO_PN}" || die
+	epatch "${FILESDIR}"/15404-fix-go14_15.patch
 	# allow user patches (use sparingly - upstream won't support them)
 	epatch_user
 }

diff --git a/app-emulation/docker/files/15404-fix-go14_15.patch b/app-emulation/docker/files/15404-fix-go14_15.patch
new file mode 100644
index 0000000..7cda1f9
--- /dev/null
+++ b/app-emulation/docker/files/15404-fix-go14_15.patch
@@ -0,0 +1,85 @@
+From f83d05c3be3c3bcc84f6fa229504848ee8078321 Mon Sep 17 00:00:00 2001
+From: Vincent Batts <vbatts@redhat.com>
+Date: Fri, 7 Aug 2015 10:18:20 -0400
+Subject: [PATCH] devicemapper: fix zero-sized field access
+
+Fixes: #15279
+
+Due to
+https://github.com/golang/go/commit/7904946eeb35faece61bbf6f5b3cc8be2f519c17
+the devices field is dropped.
+
+This solution works on go1.4 and go1.5
+
+Signed-off-by: Vincent Batts <vbatts@redhat.com>
+---
+ daemon/graphdriver/devmapper/deviceset.go | 14 +++++++++-----
+ pkg/devicemapper/devmapper_wrapper.go     | 18 +++++++++++++++---
+ 2 files changed, 24 insertions(+), 8 deletions(-)
+
+diff --git a/daemon/graphdriver/devmapper/deviceset.go b/daemon/graphdriver/devmapper/deviceset.go
+index 6dddeb1..97e2032 100644
+--- a/daemon/graphdriver/devmapper/deviceset.go
++++ b/daemon/graphdriver/devmapper/deviceset.go
+@@ -1509,12 +1509,16 @@ func (devices *DeviceSet) deactivatePool() error {
+ 	if err != nil {
+ 		return err
+ 	}
+-	if d, err := devicemapper.GetDeps(devname); err == nil {
+-		// Access to more Debug output
+-		logrus.Debugf("[devmapper] devicemapper.GetDeps() %s: %#v", devname, d)
++
++	if devinfo.Exists == 0 {
++		return nil
+ 	}
+-	if devinfo.Exists != 0 {
+-		return devicemapper.RemoveDevice(devname)
++	if err := devicemapper.RemoveDevice(devname); err != nil {
++		return err
++	}
++
++	if d, err := devicemapper.GetDeps(devname); err == nil {
++		logrus.Warnf("[devmapper] device %s still has %d active dependents", devname, d.Count)
+ 	}
+ 
+ 	return nil
+diff --git a/pkg/devicemapper/devmapper_wrapper.go b/pkg/devicemapper/devmapper_wrapper.go
+index 87c2003..44ca772 100644
+--- a/pkg/devicemapper/devmapper_wrapper.go
++++ b/pkg/devicemapper/devmapper_wrapper.go
+@@ -38,7 +38,10 @@ static void	log_with_errno_init()
+ */
+ import "C"
+ 
+-import "unsafe"
++import (
++	"reflect"
++	"unsafe"
++)
+ 
+ type (
+ 	CDmTask C.struct_dm_task
+@@ -184,12 +187,21 @@ func dmTaskGetDepsFct(task *CDmTask) *Deps {
+ 	if Cdeps == nil {
+ 		return nil
+ 	}
++
++	// golang issue: https://github.com/golang/go/issues/11925
++	hdr := reflect.SliceHeader{
++		Data: uintptr(unsafe.Pointer(uintptr(unsafe.Pointer(Cdeps)) + unsafe.Sizeof(*Cdeps))),
++		Len:  int(Cdeps.count),
++		Cap:  int(Cdeps.count),
++	}
++	devices := *(*[]C.uint64_t)(unsafe.Pointer(&hdr))
++
+ 	deps := &Deps{
+ 		Count:  uint32(Cdeps.count),
+ 		Filler: uint32(Cdeps.filler),
+ 	}
+-	for _, device := range Cdeps.device {
+-		deps.Device = append(deps.Device, (uint64)(device))
++	for _, device := range devices {
++		deps.Device = append(deps.Device, uint64(device))
+ 	}
+ 	return deps
+ }


             reply	other threads:[~2015-08-27 15:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-27 15:42 Kacper Kowalik [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-04-20 17:06 [gentoo-commits] repo/gentoo:master commit in: app-emulation/docker/, app-emulation/docker/files/ William Hubbs
2017-02-27 21:17 William Hubbs
2018-04-06 22:03 Manuel Rüger
2018-10-28 17:30 Manuel Rüger
2021-04-22  7:48 Georgy Yakovlev
2021-04-22 16:42 Georgy Yakovlev
2021-06-10 23:27 Georgy Yakovlev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1440690158.ebf518399f1b302b738d6da9afa0351f4035384a.xarthisius@gentoo \
    --to=xarthisius@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox