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
build: support RHEL/CentOS 6 #13102
build: support RHEL/CentOS 6 #13102
Conversation
Nice that you got this working, though I'm mildly anxious about merging this. We have a significant body of C++ code that uses libc/libpthread that I worry this will introduce instability. I'm open to hearing the other side if you think this concern is misplaced. I think we should run a musl-based build on one or more of the test clusters for a decent amount of time. Can you pull out the non-contentious parts of this change into a separate PR? |
So would this effectively switch all our release builds to use musl? Like @petermattis, I'm very wary of switching over to musl for any sort of wide usage. Being able to support it is great, but how many other widely used projects default to it? We'll at the very least get a handful of questions about DNS resolver behavior, and likely more issues that'll take up our time. Perhaps we should talk about this tomorrow. |
I'm also wary of switching to musl all at once, although if we try to offer the two builds in parallel will we get a meaningful amount of testing of the musl build? At a minimum a change like this should be sequenced after the rocksdb 5.0/DeleteRange upgrade.
I think that if we get even a handful of questions about DNS then we should stick with a glibc build as our primary offering and offer a musl build only as an alternative for rhel/centos/alpine users. The theory behind switching is that musl has caught up with glibc's resolver in the ways that matter (the specific issue that caused problems for us last time we tried this, gliderlabs/docker-alpine#8, has been fixed) and deployments that need other glibc-specific features are rare enough that we can ask those users to build from source (note that this is speculation with no real data behind it. I'm much more concerned about RHEL users than users of alpine or other musl-based distros, so I'd be most comfortable with an outcome in which we ship builds for an old version of glibc instead of static musl-based builds. However, getting the combination of an old version of glibc with new versions of compilers and other dependencies appears to require quite a lot of yak shaving). Reviewed 4 of 4 files at r3, 1 of 1 files at r4, 1 of 1 files at r5, 13 of 13 files at r6. Makefile, line 67 at r6 (raw file):
Those quotes don't do anything, do they? build/Dockerfile, line 20 at r6 (raw file):
While you're adding comments, why do we need scripts/gceworker.sh, line 25 at r6 (raw file):
Both Comments from Reviewable |
Review status: all files reviewed at latest revision, 3 unresolved discussions, some commit checks failed. Makefile, line 67 at r6 (raw file): Previously, bdarnell (Ben Darnell) wrote…
Probably not; removed. build/Dockerfile, line 20 at r6 (raw file):
scripts/gceworker.sh, line 25 at r6 (raw file): Previously, bdarnell (Ben Darnell) wrote…
Instead, could we just bake everything we need into the builder image? Unlike before, the builder now has a go toolchain which includes the parallel-build patches. Comments from Reviewable |
Review status: 10 of 11 files reviewed at latest revision, 4 unresolved discussions, some commit checks failed. build/Dockerfile, line 1 at r7 (raw file):
Perhaps this should be a scripts/gceworker.sh, line 25 at r6 (raw file): Previously, tamird (Tamir Duberstein) wrote…
And use the builder image on the Comments from Reviewable |
Review status: 10 of 11 files reviewed at latest revision, 4 unresolved discussions, some commit checks failed. build/Dockerfile, line 1 at r7 (raw file): Previously, petermattis (Peter Mattis) wrote…
Yeah, I can do that. I'd rather not, but I will. scripts/gceworker.sh, line 25 at r6 (raw file): Previously, petermattis (Peter Mattis) wrote…
We definitely have docker on the workers; see bootstrap-debian. I used that workflow heavily in preparing this PR. Comments from Reviewable |
Review status: 10 of 11 files reviewed at latest revision, 4 unresolved discussions, some commit checks failed. build/Dockerfile, line 1 at r7 (raw file): Previously, tamird (Tamir Duberstein) wrote…
Well, the alternative is to hold off on merging this PR for a while. Comments from Reviewable |
This has run into an unexpected snag; because TC workers have some cached build artifacts that have been linked against debian:jessie's glibc, building CR with this new image causes missing symbol errors when those artifacts are linked with ubuntu:xenial's glibc. Normally, the solution to this would be to use a new installsuffix, but our TC workers are also currently suffering from disk space issues which would be exacerbated by the addition of a new installsuffix. Also, we still need a reasonable way of toggling between musl and glibc distributions. |
This PR needs a new title and description, but is otherwise ready to be re-reviewed. The new approach produces binaries dynamically linked to glibc (but otherwise static), with a separate |
Reviewed 2 of 13 files at r6, 2 of 15 files at r8, 2 of 9 files at r9, 19 of 19 files at r10. Makefile, line 23 at r10 (raw file):
Comment that both RELEASE and STATIC builds only work within the builder image. Comments about why these particular versions were chosen (even if it's just "these are the oldest versions available with the tools we're using") would probably be helpful the next time we change any of this. Nit: I slightly prefer lowercase names for the values of TYPE. Makefile, line 66 at r10 (raw file):
We should probably also set a Makefile, line 67 at r10 (raw file):
Nit: build/builder.sh, line 115 at r10 (raw file):
Is build/Dockerfile, line 78 at r10 (raw file):
Yay! build/Dockerfile, line 98 at r10 (raw file):
Why make a new user just for this part? build/Dockerfile, line 110 at r10 (raw file):
Why do we need this? build/Dockerfile, line 118 at r10 (raw file):
build/Dockerfile, line 123 at r10 (raw file):
Mention the upgrade to Go 1.7.5 in the commit message. scripts/azworker.sh, line 14 at r10 (raw file):
Remove the scripts/with-msan, line 9 at r10 (raw file):
Change this comment to say that it assumes it's running in the builder container. scripts/with-msan, line 12 at r10 (raw file):
With these lines gone, isn't it using gcc instead of clang? Comments from Reviewable |
Review status: all files reviewed at latest revision, 14 unresolved discussions, all commit checks successful. Makefile, line 23 at r10 (raw file): Previously, bdarnell (Ben Darnell) wrote…
Done. Makefile, line 66 at r10 (raw file): Previously, bdarnell (Ben Darnell) wrote…
Done. Makefile, line 67 at r10 (raw file): Previously, bdarnell (Ben Darnell) wrote…
Done. build/builder.sh, line 115 at r10 (raw file): Previously, bdarnell (Ben Darnell) wrote…
Done. build/Dockerfile, line 98 at r10 (raw file): Previously, bdarnell (Ben Darnell) wrote…
crosstool-ng/crosstool-ng@1cabb74 Added a comment. build/Dockerfile, line 110 at r10 (raw file): Previously, bdarnell (Ben Darnell) wrote…
To avoid having two toolchains (clang is also present). As mentioned in the mega comment above, g++ is for bootstrapping the cross compilation toolchains. build/Dockerfile, line 118 at r10 (raw file): Previously, bdarnell (Ben Darnell) wrote…
Done. build/Dockerfile, line 123 at r10 (raw file): Previously, bdarnell (Ben Darnell) wrote…
Done (will squash it into the resulting commit). scripts/azworker.sh, line 14 at r10 (raw file): Previously, bdarnell (Ben Darnell) wrote…
Done. scripts/with-msan, line 9 at r10 (raw file): Previously, bdarnell (Ben Darnell) wrote…
Done. scripts/with-msan, line 12 at r10 (raw file): Previously, bdarnell (Ben Darnell) wrote…
gcc is no longer available in the build container, so clang is used instead. I'd consider going the other way - restoring these lines and defaulting the build container to target glibc 2.12, but the cross toolchain is terribly slow for some reason. Defaulting to the glibc 2.12 toolchain also has the benefit of producing correct Comments from Reviewable |
Reviewed 2 of 13 files at r6, 1 of 9 files at r9, 2 of 19 files at r10, 1 of 19 files at r11, 2 of 7 files at r12, 9 of 17 files at r13, 15 of 15 files at r14. build/Dockerfile, line 110 at r10 (raw file): Previously, tamird (Tamir Duberstein) wrote…
Oh, I see. So release/musl builds differ from the default configuration in which compiler they use, not just which version of libc they target. I'm wary of switching the default from gcc to clang like this. scripts/with-msan, line 12 at r10 (raw file): Previously, tamird (Tamir Duberstein) wrote…
Ah. Probably still good to be explicit about the compiler, though. How slow is "terribly slow"? We go out of our way to speed up the builds for Comments from Reviewable |
Review status: all files reviewed at latest revision, 5 unresolved discussions, some commit checks failed. build/Dockerfile, line 110 at r10 (raw file): Previously, bdarnell (Ben Darnell) wrote…
What's the concern? We're already shipping OSX binaries with clang. scripts/with-msan, line 12 at r10 (raw file):
Sure, done.
Well, it is available (though it's currently clang, not gcc), but the question is should we use it by default in the build container; doing so requires special handling for default builds; not doing so requires special handling for dependency upgrades. Comments from Reviewable |
Review status: 23 of 24 files reviewed at latest revision, 4 unresolved discussions, some commit checks failed. build/Dockerfile, line 110 at r10 (raw file): Previously, tamird (Tamir Duberstein) wrote…
Just fear of change, and of differences between regular and release builds. The fact that jemalloc has options referring to "libgcc" and "gcc intrinsics" give me pause (both of these options at least compile with clang, but do they work? I don't think we've tried heap profiling on a clang/linux build). scripts/with-msan, line 12 at r10 (raw file): Previously, tamird (Tamir Duberstein) wrote…
What do you mean by special handling here? I'd prefer to minimize the difference between the default and release builds (ideally, the only difference would be the use of static vs dynamic linking) Comments from Reviewable |
Review status: 20 of 25 files reviewed at latest revision, 5 unresolved discussions, all commit checks successful. build/x86-linux-gnu.config, line 385 at r15 (raw file):
Wait, so this is using gcc 4.9.3? How does that work? Our contributing.md file says that we don't support gcc (more specifically, g++) prior to 6.0. Comments from Reviewable |
Review status: 20 of 25 files reviewed at latest revision, 5 unresolved discussions, all commit checks successful. build/Dockerfile, line 110 at r10 (raw file): Previously, bdarnell (Ben Darnell) wrote…
OK; I think we agree that clang should be for msan only, and we should use the release toolchain in all other cases. build/x86-linux-gnu.config, line 385 at r15 (raw file): Previously, bdarnell (Ben Darnell) wrote…
4.9.3 is "known good" - see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48891 scripts/with-msan, line 12 at r10 (raw file): Previously, bdarnell (Ben Darnell) wrote…
Yeah, I agree. The only problem is that the cross toolchain is terrible (empirically) slow. Perhaps I'm building an unoptimized gcc? Ideas welcome, but I'll dig more this afternoon. Comments from Reviewable |
FYI the builder image is now |
Set `GOCACHEPATH` to mount somewhere other than GOPATH.
- cockroachdb/builder is now based on ubuntu xenial - cockroachdb/builder targets RHEL/CentOS 6 versions of linux and glibc - cockroachdb/builder is upgraded to Go 1.7.5 - bootstrap-debian is mostly absorbed into cockroachdb/builder - STATIC=1 is replaced with TYPE=release - a new Makefile option (type=static) produces fully static binaries by linking to musl instead of glibc - `cockroach version` now reports the build type (release/static)
Still looking for an LGTM here. @bdarnell? |
Review status: 0 of 28 files reviewed at latest revision, 2 unresolved discussions, all commit checks successful. build/Dockerfile, line 1 at r7 (raw file): Previously, petermattis (Peter Mattis) wrote…
By the way, this is now implemented. Comments from Reviewable |
Reviewed 2 of 13 files at r6, 1 of 9 files at r9, 2 of 19 files at r10, 1 of 7 files at r12, 2 of 17 files at r13, 5 of 5 files at r15, 1 of 1 files at r16, 3 of 3 files at r17, 1 of 1 files at r18, 31 of 31 files at r20. Comments from Reviewable |
linking to musl instead of glibc
cockroach version
now reports the build type (release/static)This change is