ipfs / ipfs/kubo

Fails to build offline with vendored dependencies (building package on Linux / openSUSE)

Open
#7,881 13 comments 0 reactions 1 assignee Claimed by @Stebalien View on GitHub
kind/bug need/analysis
Dominant language
Go
Stars
17.1k
Forks
3.2k
Avg merge
3d 18h
Merged PRs (30d)
11

Description

#### Version information:
0.7.0 tarball

When trying to build package for openSUSE/Factory (complete build instructions are [available](https://build.opensuse.org/package/view_file/home:mcepl:work/go-ipfs/go-ipfs.spec?expand=1)), which is basically:
```sh
export GOCACHE=$(readlink -f vendor/)
BUILDMOD="-buildmode=pie -trimpath -modcacherw"
export CFLAGS="%{optflags}"
make GOFLAGS="-buildmode=pie -trimpath -modcacherw" nofuse
```
build fails in the openSUSE build system, because it tries to access network (but all build systems of all major Linux distributions don’t have network access, because of security reasons):
```
[ 8s] + make 'GOFLAGS=-buildmode=pie -trimpath -modcacherw' nofuse
[ 8s] go: bazil.org/fuse@v0.0.0-20200117225306-7b5117fecadc: Get "https://proxy.golang.org/bazil.org/fuse/@v/v0.0.0-20200117225306-7b5117fecadc.mod": dial tcp: lookup proxy.golang.org on [::1]:53: read udp [::1]:56410->[::1]:53: read: connection refused
[ 8s] go version go1.14.13 linux/amd64
[ 8s] bin/check_go_version 1.14.4
[ 8s] plugin/loader/preload.sh > plugin/loader/preload.go
[ 8s] go fmt plugin/loader/preload.go >/dev/null
[ 8s] go: bazil.org/fuse@v0.0.0-20200117225306-7b5117fecadc: Get "https://proxy.golang.org/bazil.org/fuse/@v/v0.0.0-20200117225306-7b5117fecadc.mod": dial tcp: lookup proxy.golang.org on [::1]:53: read udp [::1]:44033->[::1]:53: read: connection refused
[ 8s] make: *** [plugin/loader/Rules.mk:9: plugin/loader/preload.go] Error 1
[ 8s] error: Bad exit status from /var/tmp/rpm-tmp.zpp5aA (%build)
[ 8s]
```
How can I make ``go-ipfs`` build even in the environment without the network access?

(Vendoring was done by running ``make build && go mod vendor`` in the unpacked tarball.)

[Complete build log](https://github.com/ipfs/go-ipfs/files/5876818/_log.txt) with all details of package versions etc.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.