Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
49685: build: remove muslc from the building process r=otan a=otan

This commit removes building muslc from the release process. It is
causing issues with the GEOS build, and we're not confident it is worth
spending the time to debug it.

* Delete mentions of muslc from publishing artifacts / provisional artifacts.
* Delete muslc from the Docker image.
* Remove Makefile items that are musl-c related.
* Unfortunately, I am not able to push the Docker image to
  cockroachdb/builder. I'm not sure that's important atm.

Release note (general change): Removed the publication of muslc
CockroachDB builds.

Co-authored-by: Oliver Tan <[email protected]>
  • Loading branch information
craig[bot] and otan committed May 29, 2020
2 parents b6d9f9f + 4a307bc commit 569d277
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 134 deletions.
5 changes: 1 addition & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -609,10 +609,7 @@ $(JEMALLOC_DIR)/Makefile: $(C_DEPS_DIR)/jemalloc-rebuild $(JEMALLOC_SRC_DIR)/con
mkdir -p $(JEMALLOC_DIR)
@# NOTE: If you change the configure flags below, bump the version in
@# $(C_DEPS_DIR)/jemalloc-rebuild. See above for rationale.
@#
@# jemalloc profiling deadlocks when built against musl. See
@# https://github.com/jemalloc/jemalloc/issues/585.
cd $(JEMALLOC_DIR) && $(JEMALLOC_SRC_DIR)/configure $(xconfigure-flags) $(if $(findstring musl,$(TARGET_TRIPLE)),,--enable-prof)
cd $(JEMALLOC_DIR) && $(JEMALLOC_SRC_DIR)/configure $(xconfigure-flags) --enable-prof

$(KRB5_SRC_DIR)/src/configure.in: | bin/.submodules-initialized

Expand Down
15 changes: 2 additions & 13 deletions build/builder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,25 +53,22 @@ RUN mkdir crosstool-ng \
&& cd .. \
&& rm -rf crosstool-ng

COPY x86_64-unknown-linux-gnu.defconfig x86_64-unknown-linux-musl.defconfig x86_64-w64-mingw.defconfig aarch64-unknown-linux-gnueabi.defconfig ./
COPY x86_64-unknown-linux-gnu.defconfig x86_64-w64-mingw.defconfig aarch64-unknown-linux-gnueabi.defconfig ./
RUN mkdir src \
&& mkdir build && (cd build && DEFCONFIG=../x86_64-unknown-linux-gnu.defconfig /usr/local/ct-ng/bin/ct-ng defconfig && /usr/local/ct-ng/bin/ct-ng build) && rm -rf build \
&& mkdir build && (cd build && DEFCONFIG=../x86_64-unknown-linux-musl.defconfig /usr/local/ct-ng/bin/ct-ng defconfig && /usr/local/ct-ng/bin/ct-ng build) && rm -rf build \
&& mkdir build && (cd build && DEFCONFIG=../x86_64-w64-mingw.defconfig /usr/local/ct-ng/bin/ct-ng defconfig && /usr/local/ct-ng/bin/ct-ng build) && rm -rf build \
&& mkdir build && (cd build && DEFCONFIG=../aarch64-unknown-linux-gnueabi.defconfig /usr/local/ct-ng/bin/ct-ng defconfig && /usr/local/ct-ng/bin/ct-ng build) && rm -rf build \
&& rm -rf src

RUN mkdir -p /usr/local/lib/ccache \
&& ln -s /usr/bin/ccache /usr/local/lib/ccache/x86_64-unknown-linux-gnu-cc \
&& ln -s /usr/bin/ccache /usr/local/lib/ccache/x86_64-unknown-linux-gnu-c++ \
&& ln -s /usr/bin/ccache /usr/local/lib/ccache/x86_64-unknown-linux-musl-cc \
&& ln -s /usr/bin/ccache /usr/local/lib/ccache/x86_64-unknown-linux-musl-c++ \
&& ln -s /usr/bin/ccache /usr/local/lib/ccache/x86_64-w64-mingw32-cc \
&& ln -s /usr/bin/ccache /usr/local/lib/ccache/x86_64-w64-mingw32-c++ \
&& ln -s /usr/bin/ccache /usr/local/lib/ccache/aarch64-unknown-linux-gnueabi-cc \
&& ln -s /usr/bin/ccache /usr/local/lib/ccache/aarch64-unknown-linux-gnueabi-c++

ENV PATH $PATH:/x-tools/x86_64-unknown-linux-gnu/bin:/x-tools/x86_64-unknown-linux-musl/bin:/x-tools/x86_64-w64-mingw32/bin:/x-tools/aarch64-unknown-linux-gnueabi/bin
ENV PATH $PATH:/x-tools/x86_64-unknown-linux-gnu/bin:/x-tools/x86_64-w64-mingw32/bin:/x-tools/aarch64-unknown-linux-gnueabi/bin

# Build & install the terminfo lib (incl. in ncurses) for the linux targets (x86 and arm).
# (on BSD or BSD-derived like macOS it's already built-in; on windows we don't need it.)
Expand All @@ -96,14 +93,6 @@ RUN mkdir ncurses \
&& patch -p0 <../ncurses.patch \
&& export cf_cv_type_of_bool='unsigned char' \
&& export cf_cv_working_poll=yes \
&& mkdir build-x86_64-unknown-linux-musl \
&& (cd build-x86_64-unknown-linux-musl \
&& CC=/x-tools/x86_64-unknown-linux-musl/bin/x86_64-unknown-linux-musl-cc \
CXX=/x-tools/x86_64-unknown-linux-musl/bin/x86_64-unknown-linux-musl-c++ \
../configure --prefix=/x-tools/x86_64-unknown-linux-musl/x86_64-unknown-linux-musl/sysroot/usr \
--host=x86_64-unknown-linux-musl \
$(cat /ncurses.conf) \
&& make install.libs) \
&& mkdir build-x86_64-unknown-linux-gnu \
&& (cd build-x86_64-unknown-linux-gnu \
&& CC=/x-tools/x86_64-unknown-linux-gnu/bin/x86_64-unknown-linux-gnu-cc \
Expand Down
11 changes: 0 additions & 11 deletions build/builder/mkrelease.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
# Possible configurations:
#
# - amd64-linux-gnu: amd64, Linux 2.6.32, dynamically link glibc 2.12.2
# - amd64-linux-musl: amd64, Linux 2.6.32, statically link musl 1.1.16
# - amd64-linux-msan: amd64, recent Linux, enable Clang's memory sanitizer
# - arm64-linux-gnueabi: arm64, Linux 3.7.10, dynamically link glibc 2.12.2
# - amd64-darwin: amd64, macOS 10.9
Expand Down Expand Up @@ -45,16 +44,6 @@ case "${1-}" in
SUFFIX=-linux-2.6.32-gnu-amd64
) ;;

?(amd64-)linux-musl)
args=(
XGOOS=linux
XGOARCH=amd64
XCMAKE_SYSTEM_NAME=Linux
TARGET_TRIPLE=x86_64-unknown-linux-musl
LDFLAGS=-static
SUFFIX=-linux-2.6.32-musl-amd64
) ;;

?(arm64-)linux?(-gnueabi))
# Manually set the correct values for configure checks that libkrb5 won't be
# able to perform because we're cross-compiling.
Expand Down
18 changes: 0 additions & 18 deletions build/builder/x86_64-unknown-linux-musl.defconfig

This file was deleted.

2 changes: 1 addition & 1 deletion pkg/build/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ var (
platform = fmt.Sprintf("%s %s", runtime.GOOS, runtime.GOARCH)
// Distribution is changed by the CCL init-time hook in non-APL builds.
Distribution = "OSS"
typ string // Type of this build: <empty>, "development", or "release[-gnu|-musl]"
typ string // Type of this build: <empty>, "development", or "release"
channel = "unknown"
envChannel = envutil.EnvOrDefaultString("COCKROACH_CHANNEL", "unknown")
)
Expand Down
42 changes: 14 additions & 28 deletions pkg/cmd/publish-artifacts/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ func main() {
// of a given triple.
{buildType: "darwin", suffix: ".darwin-10.9-amd64"},
{buildType: "linux-gnu", suffix: ".linux-2.6.32-gnu-amd64"},
{buildType: "linux-musl", suffix: ".linux-2.6.32-musl-amd64"},
{buildType: "windows", suffix: ".windows-6.2-amd64.exe"},
} {
for i, extraArgs := range []struct {
Expand Down Expand Up @@ -201,12 +200,6 @@ func main() {
log.Printf("skipping auxiliary build")
continue
}
// race doesn't work without glibc on Linux. See
// https://github.com/golang/go/issues/14481.
if strings.HasSuffix(o.BuildType, "linux-musl") && strings.Contains(o.GoFlags, "-race") {
log.Printf("skipping race build for this configuration")
continue
}

buildOneCockroach(svc, o)
}
Expand Down Expand Up @@ -299,29 +292,22 @@ func buildOneCockroach(svc s3putter, o opts) {
log.Fatalf("%s %s: %s", cmd.Env, cmd.Args, err)
}

// ldd only works on binaries built for the host. "linux-musl"
// produces fully static binaries, which cause ldd to exit
// non-zero.
//
// TODO(tamird): implement this for all targets.
if !strings.HasSuffix(o.BuildType, "linux-musl") {
cmd := exec.Command("ldd", binaryName)
cmd.Dir = o.PkgDir
log.Printf("%s %s", cmd.Env, cmd.Args)
out, err := cmd.Output()
if err != nil {
log.Fatalf("%s: out=%q err=%s", cmd.Args, out, err)
}
scanner := bufio.NewScanner(bytes.NewReader(out))
for scanner.Scan() {
if line := scanner.Text(); !libsRe.MatchString(line) {
log.Fatalf("%s is not properly statically linked:\n%s", binaryName, out)
}
}
if err := scanner.Err(); err != nil {
log.Fatal(err)
cmd = exec.Command("ldd", binaryName)
cmd.Dir = o.PkgDir
log.Printf("%s %s", cmd.Env, cmd.Args)
out, err := cmd.Output()
if err != nil {
log.Fatalf("%s: out=%q err=%s", cmd.Args, out, err)
}
scanner := bufio.NewScanner(bytes.NewReader(out))
for scanner.Scan() {
if line := scanner.Text(); !libsRe.MatchString(line) {
log.Fatalf("%s is not properly statically linked:\n%s", binaryName, out)
}
}
if err := scanner.Err(); err != nil {
log.Fatal(err)
}
}

o.Base = "cockroach" + o.Suffix
Expand Down
20 changes: 0 additions & 20 deletions pkg/cmd/publish-artifacts/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,17 +99,6 @@ func TestMain(t *testing.T) {
Key: "cockroach/cockroach.race.linux-gnu-amd64.LATEST",
WebsiteRedirectLocation: "/cockroach/cockroach.race.linux-gnu-amd64." + shaStub,
},
{
Bucket: "cockroach",
ContentDisposition: "attachment; filename=cockroach.linux-musl-amd64." + shaStub,
Key: "/cockroach/cockroach.linux-musl-amd64." + shaStub,
},
{
Bucket: "cockroach",
CacheControl: "no-cache",
Key: "cockroach/cockroach.linux-musl-amd64.LATEST",
WebsiteRedirectLocation: "/cockroach/cockroach.linux-musl-amd64." + shaStub,
},
{
Bucket: "cockroach",
ContentDisposition: "attachment; filename=cockroach.windows-amd64." + shaStub + ".exe",
Expand Down Expand Up @@ -159,15 +148,6 @@ func TestMain(t *testing.T) {
CacheControl: "no-cache",
Key: "cockroach-latest.linux-amd64.tgz",
},
{
Bucket: "binaries.cockroachdb.com",
Key: "cockroach-v42.42.42.linux-musl-amd64.tgz",
},
{
Bucket: "binaries.cockroachdb.com",
CacheControl: "no-cache",
Key: "cockroach-latest.linux-musl-amd64.tgz",
},
{
Bucket: "binaries.cockroachdb.com",
Key: "cockroach-v42.42.42.windows-6.2-amd64.zip",
Expand Down
42 changes: 14 additions & 28 deletions pkg/cmd/publish-provisional-artifacts/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ func run(svc s3I, execFn execRunner, flags runFlags) {
// of a given triple.
{buildType: "darwin", suffix: ".darwin-10.9-amd64"},
{buildType: "linux-gnu", suffix: ".linux-2.6.32-gnu-amd64"},
{buildType: "linux-musl", suffix: ".linux-2.6.32-musl-amd64"},
{buildType: "windows", suffix: ".windows-6.2-amd64.exe"},
} {
for i, extraArgs := range []struct {
Expand Down Expand Up @@ -241,12 +240,6 @@ func run(svc s3I, execFn execRunner, flags runFlags) {
log.Printf("skipping auxiliary build: %s", pretty.Sprint(o))
continue
}
// race doesn't work without glibc on Linux. See
// https://github.com/golang/go/issues/14481.
if strings.HasSuffix(o.BuildType, "linux-musl") && strings.Contains(o.GoFlags, "-race") {
log.Printf("skipping race build for this configuration")
continue
}

cockroachBuildOpts = append(cockroachBuildOpts, o)
}
Expand Down Expand Up @@ -369,29 +362,22 @@ func buildCockroach(svc s3I, execFn execRunner, flags runFlags, o opts) {
log.Fatalf("%s %s: %s\n\n%s", cmd.Env, cmd.Args, err, out)
}

// ldd only works on binaries built for the host. "linux-musl"
// produces fully static binaries, which cause ldd to exit
// non-zero.
//
// TODO(tamird): implement this for all targets.
if !strings.HasSuffix(o.BuildType, "linux-musl") {
cmd := exec.Command("ldd", binaryName)
cmd.Dir = o.PkgDir
log.Printf("%s %s", cmd.Env, cmd.Args)
out, err := execFn(cmd)
if err != nil {
log.Fatalf("%s: out=%q err=%s", cmd.Args, out, err)
}
scanner := bufio.NewScanner(bytes.NewReader(out))
for scanner.Scan() {
if line := scanner.Text(); !libsRe.MatchString(line) {
log.Fatalf("%s is not properly statically linked:\n%s", binaryName, out)
}
}
if err := scanner.Err(); err != nil {
log.Fatal(err)
cmd = exec.Command("ldd", binaryName)
cmd.Dir = o.PkgDir
log.Printf("%s %s", cmd.Env, cmd.Args)
out, err := execFn(cmd)
if err != nil {
log.Fatalf("%s: out=%q err=%s", cmd.Args, out, err)
}
scanner := bufio.NewScanner(bytes.NewReader(out))
for scanner.Scan() {
if line := scanner.Text(); !libsRe.MatchString(line) {
log.Fatalf("%s is not properly statically linked:\n%s", binaryName, out)
}
}
if err := scanner.Err(); err != nil {
log.Fatal(err)
}
}
}

Expand Down
11 changes: 0 additions & 11 deletions pkg/cmd/publish-provisional-artifacts/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ func TestProvisional(t *testing.T) {
expectedCmds: []string{
"env=[] args=[mkrelease darwin GOFLAGS= SUFFIX=.darwin-10.9-amd64 TAGS= BUILDCHANNEL=official-binary BUILDINFO_TAG=v0.0.1-alpha BUILD_TAGGED_RELEASE=true]",
"env=[] args=[mkrelease linux-gnu GOFLAGS= SUFFIX=.linux-2.6.32-gnu-amd64 TAGS= BUILDCHANNEL=official-binary BUILDINFO_TAG=v0.0.1-alpha BUILD_TAGGED_RELEASE=true]",
"env=[] args=[mkrelease linux-musl GOFLAGS= SUFFIX=.linux-2.6.32-musl-amd64 TAGS= BUILDCHANNEL=official-binary BUILDINFO_TAG=v0.0.1-alpha BUILD_TAGGED_RELEASE=true]",
"env=[] args=[mkrelease windows GOFLAGS= SUFFIX=.windows-6.2-amd64.exe TAGS= BUILDCHANNEL=official-binary BUILDINFO_TAG=v0.0.1-alpha BUILD_TAGGED_RELEASE=true]",
"env=[] args=[make archive ARCHIVE_BASE=cockroach-v0.0.1-alpha ARCHIVE=cockroach-v0.0.1-alpha.src.tgz BUILDINFO_TAG=v0.0.1-alpha]",
},
Expand All @@ -129,8 +128,6 @@ func TestProvisional(t *testing.T) {
"CONTENTS <binary stuff>",
"s3://binaries.cockroachdb.com/cockroach-v0.0.1-alpha.linux-amd64.tgz " +
"CONTENTS <binary stuff>",
"s3://binaries.cockroachdb.com/cockroach-v0.0.1-alpha.linux-musl-amd64.tgz " +
"CONTENTS <binary stuff>",
"s3://binaries.cockroachdb.com/cockroach-v0.0.1-alpha.windows-6.2-amd64.zip " +
"CONTENTS <binary stuff>",
"s3://binaries.cockroachdb.com/cockroach-v0.0.1-alpha.src.tgz " +
Expand All @@ -148,7 +145,6 @@ func TestProvisional(t *testing.T) {
expectedCmds: []string{
"env=[] args=[mkrelease darwin GOFLAGS= SUFFIX=.darwin-10.9-amd64 TAGS= BUILDCHANNEL=official-binary]",
"env=[] args=[mkrelease linux-gnu GOFLAGS= SUFFIX=.linux-2.6.32-gnu-amd64 TAGS= BUILDCHANNEL=official-binary]",
"env=[] args=[mkrelease linux-musl GOFLAGS= SUFFIX=.linux-2.6.32-musl-amd64 TAGS= BUILDCHANNEL=official-binary]",
"env=[] args=[mkrelease windows GOFLAGS= SUFFIX=.windows-6.2-amd64.exe TAGS= BUILDCHANNEL=official-binary]",
},
expectedGets: nil,
Expand All @@ -161,10 +157,6 @@ func TestProvisional(t *testing.T) {
"CONTENTS env=[] args=[mkrelease linux-gnu GOFLAGS= SUFFIX=.linux-2.6.32-gnu-amd64 TAGS= BUILDCHANNEL=official-binary]",
"s3://cockroach/cockroach/cockroach.linux-gnu-amd64.LATEST/no-cache " +
"REDIRECT /cockroach/cockroach.linux-gnu-amd64.00SHA00",
"s3://cockroach//cockroach/cockroach.linux-musl-amd64.00SHA00 " +
"CONTENTS env=[] args=[mkrelease linux-musl GOFLAGS= SUFFIX=.linux-2.6.32-musl-amd64 TAGS= BUILDCHANNEL=official-binary]",
"s3://cockroach/cockroach/cockroach.linux-musl-amd64.LATEST/no-cache " +
"REDIRECT /cockroach/cockroach.linux-musl-amd64.00SHA00",
"s3://cockroach//cockroach/cockroach.windows-amd64.00SHA00.exe " +
"CONTENTS env=[] args=[mkrelease windows GOFLAGS= SUFFIX=.windows-6.2-amd64.exe TAGS= BUILDCHANNEL=official-binary]",
"s3://cockroach/cockroach/cockroach.windows-amd64.LATEST/no-cache " +
Expand Down Expand Up @@ -216,7 +208,6 @@ func TestBless(t *testing.T) {
expectedGets: []string{
"s3://binaries.cockroachdb.com/cockroach-v0.0.1.darwin-10.9-amd64.tgz",
"s3://binaries.cockroachdb.com/cockroach-v0.0.1.linux-amd64.tgz",
"s3://binaries.cockroachdb.com/cockroach-v0.0.1.linux-musl-amd64.tgz",
"s3://binaries.cockroachdb.com/cockroach-v0.0.1.windows-6.2-amd64.zip",
"s3://binaries.cockroachdb.com/cockroach-v0.0.1.src.tgz",
},
Expand All @@ -225,8 +216,6 @@ func TestBless(t *testing.T) {
"CONTENTS s3://binaries.cockroachdb.com/cockroach-v0.0.1.darwin-10.9-amd64.tgz",
"s3://binaries.cockroachdb.com/cockroach-latest.linux-amd64.tgz/no-cache " +
"CONTENTS s3://binaries.cockroachdb.com/cockroach-v0.0.1.linux-amd64.tgz",
"s3://binaries.cockroachdb.com/cockroach-latest.linux-musl-amd64.tgz/no-cache " +
"CONTENTS s3://binaries.cockroachdb.com/cockroach-v0.0.1.linux-musl-amd64.tgz",
"s3://binaries.cockroachdb.com/cockroach-latest.windows-6.2-amd64.zip/no-cache " +
"CONTENTS s3://binaries.cockroachdb.com/cockroach-v0.0.1.windows-6.2-amd64.zip",
"s3://binaries.cockroachdb.com/cockroach-latest.src.tgz/no-cache " +
Expand Down

0 comments on commit 569d277

Please sign in to comment.