Skip to content

Commit

Permalink
treewide: Avoid go build -i
Browse files Browse the repository at this point in the history
Using `-i` in the "go build" arguments with Golang 1.10 on Ubuntu using
a snap package results in this error:

    $ make -C daemon
      CHECK contrib/scripts/bindata.sh
      GO    daemon/cilium-agent
    go build runtime/cgo: open /snap/go/2130/pkg/linux_amd64/runtime/cgo.a: read-only file system

According to the upstream issue, this is because it's attempting to rebuild
the core Golang packages on the system, and snap is preventing this via a
read-only file system to ensure consistency for the base Golang version.

The workaround suggested in the following issue is to remove `-i`.

golang/go#24674

Signed-off-by: Joe Stringer <joe@covalent.io>
  • Loading branch information
joestringer committed Jun 22, 2018
1 parent 6f9ab9a commit 0f52b53
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion bugtool/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ TARGET=cilium-bugtool
SOURCES := $(shell find ../common . -name '*.go')
$(TARGET): $(SOURCES)
@$(ECHO_GO)
$(GO) build -i $(GOBUILD) -o $(TARGET)
$(GO) build $(GOBUILD) -o $(TARGET)

all: $(TARGET)

Expand Down
2 changes: 1 addition & 1 deletion cilium-health/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ TARGET=cilium-health
SOURCES := $(shell find ../api/v1/health ../pkg/health cmd . \( -name '*.go' ! -name '*_test.go' \))
$(TARGET): $(SOURCES)
@$(ECHO_GO)
$(GO) build -i $(GOBUILD) -o $(TARGET)
$(GO) build $(GOBUILD) -o $(TARGET)

all: $(TARGET)

Expand Down
2 changes: 1 addition & 1 deletion cilium/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ TARGET=cilium
SOURCES := $(shell find ../api ../daemon ../common ../pkg cmd . \( -name '*.go' ! -name '*_test.go' \))
$(TARGET): $(SOURCES)
@$(ECHO_GO)
$(GO) build -i $(GOBUILD) -o $(TARGET)
$(GO) build $(GOBUILD) -o $(TARGET)

all: $(TARGET)

Expand Down
2 changes: 1 addition & 1 deletion daemon/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ TARGET=cilium-agent
SOURCES := $(shell find ../api ../common ../daemon ../pkg ../monitor . \( -name '*.go' ! -name '*_test.go' \))
$(TARGET): $(SOURCES) check-bindata
@$(ECHO_GO)
$(GO) build -i $(GOBUILD) -o $(TARGET)
$(GO) build $(GOBUILD) -o $(TARGET)

GO_BINDATA := $(QUIET) go-bindata -prefix ../ -mode 0640 -modtime 1450269211 \
-ignore Makefile -ignore bpf_features.h -ignore lxc_config.h \
Expand Down
2 changes: 1 addition & 1 deletion monitor/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ TARGET=cilium-node-monitor
SOURCES := $(shell find ../monitor ../common ../pkg ../api . \( -name '*.go' ! -name '*_test.go' \))
$(TARGET): $(SOURCES)
@$(ECHO_GO)
$(GO) build -i $(GOBUILD) -o $(TARGET)
$(GO) build $(GOBUILD) -o $(TARGET)

all: $(TARGET)

Expand Down
2 changes: 1 addition & 1 deletion plugins/cilium-cni/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ SOURCES := $(shell find ../../api/v1/models ../../common ../../pkg/client ../../

$(TARGET): $(SOURCES)
@$(ECHO_GO)
$(GO) build -i $(GOBUILD) -o $(TARGET) ./cilium-cni.go
$(GO) build $(GOBUILD) -o $(TARGET) ./cilium-cni.go

install:
$(INSTALL) -m 0755 -d $(DESTDIR)/etc/cni/net.d
Expand Down
2 changes: 1 addition & 1 deletion plugins/cilium-docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ SOURCES := $(shell find ../../api/v1 ../../common ../../pkg/client ../../pkg/end

$(TARGET): $(SOURCES)
@$(ECHO_GO)
$(GO) build -i $(GOBUILD) -o $(TARGET)
$(GO) build $(GOBUILD) -o $(TARGET)

run:
./cilium-docker -d
Expand Down
2 changes: 1 addition & 1 deletion test/bpf/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ all: $(TARGETS)

perf-event-test: perf-event-test.go
@$(ECHO_GO)
$(GO) build -i $(GOBUILD) -o $@ $<
$(GO) build $(GOBUILD) -o $@ $<

bpf-event-test.o: bpf-event-test.c
@$(ECHO_CC)
Expand Down

0 comments on commit 0f52b53

Please sign in to comment.