Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux amd64 build could potentially be fully static #2555

Closed
johnjelinek opened this issue Dec 6, 2015 · 10 comments
Closed

Linux amd64 build could potentially be fully static #2555

johnjelinek opened this issue Dec 6, 2015 · 10 comments
Labels
build Issues caused by or requiring changes to the build system (scripts or Docker image) frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion

Comments

@johnjelinek
Copy link

I'm not sure what dependency I'm missing, but it doesn't on alpine 3.2 for me.

@AudriusButkevicius
Copy link
Member

whats alpine, also define doesn't run.

@calmh
Copy link
Member

calmh commented Dec 6, 2015

I'm guessing this:

Since alpine linux [...] use musl instead of gnu libc your golang binaries will not work inside alpine.

(http://www.blang.io/posts/2015-04_golang-alpine-build-golang-binaries-for-alpine-linux/)

I see that as a quirk in Alpine; someone who uses it needs to create a build for it.

@calmh calmh closed this as completed Dec 6, 2015
@johnjelinek
Copy link
Author

Huh? Build a static binary like in your link: CGO_ENABLED=0 go build -a -installsuffix cgo and then deploy everywhere.
On Dec 6, 2015 3:58 AM, "Jakob Borg" notifications@github.com wrote:

Closed #2555 #2555.


Reply to this email directly or view it on GitHub
#2555 (comment).

@johnjelinek
Copy link
Author

@calmh: I think the quote you're referencing won't matter if you build a static binary to deployed everywhere.

@AudriusButkevicius
Copy link
Member

Well I think there are reasons why we don't build a static binary.

@johnjelinek
Copy link
Author

Can you please elaborate?

On Sun, Dec 6, 2015 at 3:03 PM, Audrius Butkevicius <
notifications@github.com> wrote:

Well there are reason why we dont build a static binary.


Reply to this email directly or view it on GitHub
#2555 (comment)
.

@AudriusButkevicius
Copy link
Member

I think if we provide a fully static build, that potentially raises the bar of what's the minimum requirements required to run it (I think it's something todo with SSE instructions, but not sure how that fits into the static build question), but @calmh knows better.

@calmh
Copy link
Member

calmh commented Dec 8, 2015

So my reaction was the same, and I've been doing a bit of digging. The main thing we lose with a static build is access to the OS resolver library. This is an issue on Windows and Mac where somewhat exotic name lookup techniques are commonplace. On Mac we also lose access to the certificate store, which is critical. This is why we have native builders there.

However it doesn't seem like we lose anything relevant on Linux so we could potentially go fully static there. The 32 bit build already is, because it wants to run on peoples crappy NAS distributions that have libc from the 19th century or thereabout.

@calmh calmh changed the title syncthing doesn't run on alpine Linux amd64 build could potentially by fully static Dec 8, 2015
@calmh calmh added the build Issues caused by or requiring changes to the build system (scripts or Docker image) label Dec 8, 2015
@calmh calmh reopened this Dec 8, 2015
@johnjelinek
Copy link
Author

Ya, I was meaning static just for the linux binaries, not for all
builds/platforms.
On Dec 8, 2015 1:16 AM, "Jakob Borg" notifications@github.com wrote:

So my reaction was the same, and I've been doing a bit of digging. The
main thing we lose with a static build is access to the OS resolver
library. This is an issue on Windows and Mac where somewhat exotic name
lookup techniques are commonplace. On Mac we also lose access to the
certificate store, which is critical. This is why we have native builders
there.

However it doesn't seem like we lose anything relevant on Linux so we
could potentially go fully static there. The 32 bit build already is,
because it wants to run on peoples crappy NAS distributions that have libc
from the 19th century or thereabout.


Reply to this email directly or view it on GitHub
#2555 (comment)
.

@canton7 canton7 changed the title Linux amd64 build could potentially by fully static Linux amd64 build could potentially be fully static Dec 8, 2015
@calmh
Copy link
Member

calmh commented Dec 9, 2015

The linux builder now builds statics. Lets see how that works out.

@calmh calmh closed this as completed Dec 9, 2015
@st-review st-review added the frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion label Jun 16, 2017
@syncthing syncthing locked and limited conversation to collaborators Jun 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
build Issues caused by or requiring changes to the build system (scripts or Docker image) frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion
Projects
None yet
Development

No branches or pull requests

4 participants