Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

Makefile: release static binaries #415

Merged
merged 1 commit into from
Nov 16, 2017

Conversation

jessfraz
Copy link
Contributor

Was installing this on a minimal host and this would be superrrrr helpful!

Thanks!

@Random-Liu
Copy link
Member

@jessfraz Thanks!

But I don't think other things containerd, runc and cni in the tarball are statically built. Does that matter?

@jessfraz
Copy link
Contributor Author

jessfraz commented Nov 15, 2017 via email

@jessfraz jessfraz force-pushed the release-static-binaries branch from e49127e to c8584f2 Compare November 15, 2017 08:30
@Random-Liu
Copy link
Member

@jessfraz I saw following warnings:

W1115 08:32:02.910] # github.com/kubernetes-incubator/cri-containerd/cmd/cri-containerd
W1115 08:32:02.910] /tmp/go-link-943302640/000004.o: In function `pluginOpen':
W1115 08:32:02.911] /tmp/workdir/go/src/plugin/plugin_dlopen.go:19: warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
W1115 08:32:02.911] /tmp/go-link-943302640/000002.o: In function `mygetgrouplist':
W1115 08:32:02.911] /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
W1115 08:32:02.911] /tmp/go-link-943302640/000002.o: In function `mygetgrgid_r':
W1115 08:32:02.912] /tmp/workdir/go/src/os/user/cgo_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
W1115 08:32:02.912] /tmp/go-link-943302640/000002.o: In function `mygetgrnam_r':
W1115 08:32:02.912] /tmp/workdir/go/src/os/user/cgo_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
W1115 08:32:02.912] /tmp/go-link-943302640/000002.o: In function `mygetpwnam_r':
W1115 08:32:02.913] /tmp/workdir/go/src/os/user/cgo_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
W1115 08:32:02.913] /tmp/go-link-943302640/000002.o: In function `mygetpwuid_r':
W1115 08:32:02.913] /tmp/workdir/go/src/os/user/cgo_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
W1115 08:32:02.913] /tmp/go-link-943302640/000000.o: In function `_cgo_b0c710f30cfd_C2func_getaddrinfo':
W1115 08:32:02.914] /tmp/go-build/net/_obj/cgo-gcc-prolog:46: warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking

It seems that golang 1.9 start to report this warning. golang/go#21421
Will this cause any problem? It seems that cri-containerd still could not run without glibc?

LGTM other than this.

@Random-Liu Random-Liu self-assigned this Nov 16, 2017
@jessfraz
Copy link
Contributor Author

jessfraz commented Nov 16, 2017 via email

@Random-Liu
Copy link
Member

Random-Liu commented Nov 16, 2017

@jessfraz OK. SGTM. I think @ijc is also using the static binary in Linuxkit now.

And actually the static binary is smaller:

$ # statically linked binary
$ ls -al _output/cri-containerd 
-rwxrwxr-x 1 lantaol lantaol 53067112 Nov 16 01:48 _output/cri-containerd
$ # dynamically linked binary
$ ls -al /usr/local/bin/cri-containerd 
-rwxr-xr-x 1 lantaol lantaol 60593328 Nov 15 02:17 /usr/local/bin/cri-containerd

@Random-Liu Random-Liu merged commit 2143959 into containerd:master Nov 16, 2017
@jessfraz jessfraz deleted the release-static-binaries branch November 16, 2017 02:18
@Random-Liu
Copy link
Member

@jessfraz Thanks!

@ijc
Copy link
Contributor

ijc commented Nov 16, 2017

I think @ijc is also using the static binary in Linuxkit now.

Correct, FWIW I'm using an alpine based build env with musl which has no warnings of that sort. Not sure how (or if it is possible) to suppress that glibc warning if you know you don't care about those features, AFAIK glibc has basically decided that full static linking is not really supported...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants