Skip to content

Commit c378054

Browse files
committed
Fix cross compilation issues
- Fix circle-ci-cross target - Remove unsupported os/arch targets - Fix dnet build for windows/amd64 - Fix a solaris build breakage Signed-off-by: Alessandro Boch <aboch@docker.com>
1 parent b8f3e4a commit c378054

5 files changed

Lines changed: 53 additions & 16 deletions

File tree

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ dockerargs = --privileged -v $(shell pwd):/go/src/github.com/docker/libnetwork -
55
container_env = -e "INSIDECONTAINER=-incontainer=true"
66
docker = docker run --rm -it ${dockerargs} $$EXTRA_ARGS ${container_env} ${build_image}
77
ciargs = -e CIRCLECI -e "COVERALLS_TOKEN=$$COVERALLS_TOKEN" -e "INSIDECONTAINER=-incontainer=true"
8-
cidocker = docker run ${dockerargs} ${ciargs} ${container_env} ${build_image}
9-
CROSS_PLATFORMS = linux/amd64 linux/386 linux/arm windows/amd64 windows/386 solaris/amd64 solaris/386
8+
cidocker = docker run ${dockerargs} ${ciargs} $$EXTRA_ARGS ${container_env} ${build_image}
9+
CROSS_PLATFORMS = linux/amd64 linux/386 linux/arm windows/amd64
1010

1111
all: ${build_image}.created build check integration-tests clean
1212

cmd/dnet/dnet.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import (
2222
"github.com/docker/docker/pkg/reexec"
2323

2424
"github.com/Sirupsen/logrus"
25-
psignal "github.com/docker/docker/pkg/signal"
2625
"github.com/docker/docker/pkg/term"
2726
"github.com/docker/libnetwork"
2827
"github.com/docker/libnetwork/api"
@@ -263,16 +262,6 @@ func (d *dnetConnection) dnetDaemon(cfgFile string) error {
263262
return http.ListenAndServe(d.addr, r)
264263
}
265264

266-
func setupDumpStackTrap() {
267-
c := make(chan os.Signal, 1)
268-
signal.Notify(c, syscall.SIGUSR1)
269-
go func() {
270-
for range c {
271-
psignal.DumpStacks()
272-
}
273-
}()
274-
}
275-
276265
func handleSignals(controller libnetwork.NetworkController) {
277266
c := make(chan os.Signal, 1)
278267
signals := []os.Signal{os.Interrupt, syscall.SIGTERM, syscall.SIGQUIT}

cmd/dnet/dnet_linux.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package main
2+
3+
import (
4+
"os"
5+
"os/signal"
6+
"syscall"
7+
8+
psignal "github.com/docker/docker/pkg/signal"
9+
)
10+
11+
func setupDumpStackTrap() {
12+
c := make(chan os.Signal, 1)
13+
signal.Notify(c, syscall.SIGUSR1)
14+
go func() {
15+
for range c {
16+
psignal.DumpStacks()
17+
}
18+
}()
19+
}

cmd/dnet/dnet_windows.go

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package main
2+
3+
import (
4+
"fmt"
5+
"os"
6+
"syscall"
7+
8+
"github.com/Sirupsen/logrus"
9+
"github.com/docker/docker/pkg/signal"
10+
"github.com/docker/docker/pkg/system"
11+
)
12+
13+
// Copied over from docker/daemon/debugtrap_windows.go
14+
func setupDumpStackTrap() {
15+
go func() {
16+
sa := syscall.SecurityAttributes{
17+
Length: 0,
18+
}
19+
ev := "Global\\docker-daemon-" + fmt.Sprint(os.Getpid())
20+
if h, _ := system.CreateEvent(&sa, false, false, ev); h != 0 {
21+
logrus.Debugf("Stackdump - waiting signal at %s", ev)
22+
for {
23+
syscall.WaitForSingleObject(h, syscall.INFINITE)
24+
signal.DumpStacks()
25+
}
26+
}
27+
}()
28+
}
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
// Package ipamutils provides utililty functions for ipam management
2-
package ipamutils
1+
package netutils
32

43
// Solaris: TODO
54

65
import (
76
"net"
7+
8+
"github.com/docker/libnetwork/ipamutils"
89
)
910

1011
// ElectInterfaceAddresses looks for an interface on the OS with the specified name
@@ -17,7 +18,7 @@ func ElectInterfaceAddresses(name string) (*net.IPNet, []*net.IPNet, error) {
1718
err error
1819
)
1920

20-
v4Net, err = FindAvailableNetwork(PredefinedBroadNetworks)
21+
v4Net, err = FindAvailableNetwork(ipamutils.PredefinedBroadNetworks)
2122
if err != nil {
2223
return nil, nil, err
2324
}

0 commit comments

Comments
 (0)