Patch Go for issue #9102 in build env (fixes #1112)

This commit is contained in:
Jakob Borg 2014-12-13 10:38:05 +01:00
parent b2ed32b118
commit 1c43587d7d
3 changed files with 34 additions and 3 deletions

View File

@ -2,7 +2,7 @@
set -euo pipefail set -euo pipefail
IFS=$'\n\t' IFS=$'\n\t'
DOCKERIMGV=1.4-3 DOCKERIMGV=1.4-4
case "${1:-default}" in case "${1:-default}" in
default) default)

View File

@ -6,7 +6,7 @@ ENV GOLANG_VERSION 1.4
# SCMs for "go get", gcc for cgo # SCMs for "go get", gcc for cgo
RUN apt-get update && apt-get install -y \ RUN apt-get update && apt-get install -y \
ca-certificates curl gcc libc6-dev make \ ca-certificates curl gcc libc6-dev make \
bzr git mercurial unzip \ bzr git mercurial unzip patch \
--no-install-recommends \ --no-install-recommends \
&& apt-get clean \ && apt-get clean \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
@ -29,7 +29,16 @@ RUN go get github.com/calmh/gonative \
&& rm -rf go \ && rm -rf go \
&& gonative -version $GOLANG_VERSION && gonative -version $GOLANG_VERSION
# Rebuild the special and missing versions # Rebuild the special and missing versions, using patches as appropriate
RUN mkdir /tmp/patches
ADD *.patch /tmp/patches/
RUN bash -xec '\
cd /usr/local/go ; \
for patch in /tmp/patches/*.patch ; do \
patch -p0 < "$patch" ; \
done \
'
RUN bash -xec '\ RUN bash -xec '\
cd /usr/local/go/src; \ cd /usr/local/go/src; \

22
docker/go-9102.patch Normal file
View File

@ -0,0 +1,22 @@
--- src/syscall/route_openbsd.go.orig Fri Jul 25 23:38:47 2014
+++ src/syscall/route_openbsd.go Fri Jul 25 23:39:20 2014
@@ -12,16 +12,16 @@ func (any *anyMessage) toRoutingMessage(b []byte) Rout
switch any.Type {
case RTM_ADD, RTM_DELETE, RTM_CHANGE, RTM_GET, RTM_LOSING, RTM_REDIRECT, RTM_MISS, RTM_LOCK, RTM_RESOLVE:
p := (*RouteMessage)(unsafe.Pointer(any))
- return &RouteMessage{Header: p.Header, Data: b[SizeofRtMsghdr:any.Msglen]}
+ return &RouteMessage{Header: p.Header, Data: b[p.Header.Hdrlen:any.Msglen]}
case RTM_IFINFO:
p := (*InterfaceMessage)(unsafe.Pointer(any))
- return &InterfaceMessage{Header: p.Header, Data: b[SizeofIfMsghdr:any.Msglen]}
+ return &InterfaceMessage{Header: p.Header, Data: b[p.Header.Hdrlen:any.Msglen]}
case RTM_IFANNOUNCE:
p := (*InterfaceAnnounceMessage)(unsafe.Pointer(any))
return &InterfaceAnnounceMessage{Header: p.Header}
case RTM_NEWADDR, RTM_DELADDR:
p := (*InterfaceAddrMessage)(unsafe.Pointer(any))
- return &InterfaceAddrMessage{Header: p.Header, Data: b[SizeofIfaMsghdr:any.Msglen]}
+ return &InterfaceAddrMessage{Header: p.Header, Data: b[p.Header.Hdrlen:any.Msglen]}
}
return nil
}