Skip to content

Building the gitlab image fails #172

Description

@RobinVanCauter

I've installed libgit2, I've setup LD_LIBRARY_PATH and running ld -v -lgit2 tells me the compiler is able to find it at /usr/local/lib/libgit2.so.

But when I run make build-gitlab or build/spread-linux-static gcc seems to fail.

I've not meddled around with Go before, so I might be missing something obvious here?

GOOS=linux go build -o build/spread-linux-static -i -v -ldflags "-X main.Version=v0.0.0 -extldflags "-static" --s -w" rsprd.com/spread/cmd/spread
rsprd.com/spread/cmd/spread
# rsprd.com/spread/cmd/spread
/usr/local/go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
/usr/bin/ld: cannot find -lgit2
/tmp/go-link-587612200/000003.o: In function `mygetgrouplist':
/tmp/workdir/go/src/os/user/getgrouplist_unix.go:15: warning: Using 'getgrouplist' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/tmp/go-link-587612200/000003.o: In function `mygetgrgid_r':
/tmp/workdir/go/src/os/user/lookup_unix.go:38: warning: Using 'getgrgid_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/tmp/go-link-587612200/000003.o: In function `mygetgrnam_r':
/tmp/workdir/go/src/os/user/lookup_unix.go:43: warning: Using 'getgrnam_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/tmp/go-link-587612200/000003.o: In function `mygetpwnam_r':
/tmp/workdir/go/src/os/user/lookup_unix.go:33: warning: Using 'getpwnam_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/tmp/go-link-587612200/000003.o: In function `mygetpwuid_r':
/tmp/workdir/go/src/os/user/lookup_unix.go:28: warning: Using 'getpwuid_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/tmp/go-link-587612200/000002.o: In function `_cgo_7a2d42f1a351_C2func_getaddrinfo':
/tmp/workdir/go/src/net/cgo_unix.go:66: warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
collect2: error: ld returned 1 exit status

Makefile:100: recipe for target 'build/spread-linux-static' failed
make: *** [build/spread-linux-static] Error 2

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions