Skip to content

Commit

Permalink
Merge #56143 #56150
Browse files Browse the repository at this point in the history
56143: bazel: pin go1.13.14, fix rules_foreign_cc to latest version r=irfansharif,jlinder a=otan

Resolves #56060 

Release note: None

56150: bazel: fix build on ubuntu machines r=irfansharif,jlinder a=otan

Requires a downgrade to bazel-3.6.0.

In combination with #56142, this will compile cockroach-short correctly
on linux machines.

However, there is a drawback -- /usr/lib/include is needed for linux to
work. As such, MacOS users who have proj_api.h will need to use
--sandbox_block_path (you cannot sandbox_block_path a path that does
not exist due to bazelbuild/bazel#4963. I will
send an email out shortly afterwards.

Release note: None

Co-authored-by: Oliver Tan <otan@cockroachlabs.com>
  • Loading branch information
craig[bot] and otan committed Nov 2, 2020
3 parents 9ec0151 + 5714bc4 + 83c0097 commit 6debfee
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 28 deletions.
9 changes: 0 additions & 9 deletions .bazelrc

This file was deleted.

4 changes: 2 additions & 2 deletions WORKSPACE
Expand Up @@ -19,7 +19,7 @@ http_archive(
# Load the go dependencies and invoke them.
load("@io_bazel_rules_go//go:deps.bzl", "go_rules_dependencies", "go_register_toolchains")
go_rules_dependencies()
go_register_toolchains()
go_register_toolchains(go_version="1.13.14")

# Load gazelle. This lets us auto-generate BUILD.bazel files throughout the
# repo.
Expand Down Expand Up @@ -66,7 +66,7 @@ go_deps()
# that add autoconf support.
git_repository(
name = "rules_foreign_cc",
commit = "f6a15abd55be915b914aa618b50831bf5981340f",
commit = "605c77171f20840464301d7d01d6cd9e3a982888",
remote = "https://github.com/otan-cockroach/rules_foreign_cc",
)
load("@rules_foreign_cc//:workspace_definitions.bzl", "rules_foreign_cc_dependencies")
Expand Down
2 changes: 1 addition & 1 deletion build/builder.sh
Expand Up @@ -3,7 +3,7 @@
set -euo pipefail

image=cockroachdb/builder
version=20201023-201405
version=20201030-112714

function init() {
docker build --tag="${image}" "$(dirname "${0}")/builder"
Expand Down
29 changes: 14 additions & 15 deletions build/builder/Dockerfile
Expand Up @@ -216,18 +216,6 @@ RUN chmod -R a+w $(go env GOTOOLDIR)
# Allow Go support files in gdb.
RUN echo "add-auto-load-safe-path $(go env GOROOT)/src/runtime/runtime-gdb.py" > ~/.gdbinit

RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \
&& echo 'deb https://deb.nodesource.com/node_12.x xenial main' | tee /etc/apt/sources.list.d/nodesource.list \
&& curl -fsSL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& echo 'deb https://dl.yarnpkg.com/debian/ stable main' | tee /etc/apt/sources.list.d/yarn.list \
&& curl -fsSL https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - \
&& echo 'deb https://packages.cloud.google.com/apt cloud-sdk-xenial main' | tee /etc/apt/sources.list.d/gcloud.list \
&& curl -fsSL https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& echo "deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main" | tee /etc/apt/sources.list.d/google.list \
&& echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list \
&& curl https://bazel.build/bazel-release.pub.gpg | apt-key add - \
&& apt-get update

# bazel - build system
# ccache - speed up C and C++ compilation
# lsof - roachprod monitor
Expand All @@ -239,8 +227,19 @@ RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key ad
# yarn - ui
# chrome - ui
# unzip - for installing awscli
RUN apt-get install -y --no-install-recommends \
bazel-3.7.0 \
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \
&& echo 'deb https://deb.nodesource.com/node_12.x xenial main' | tee /etc/apt/sources.list.d/nodesource.list \
&& curl -fsSL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& echo 'deb https://dl.yarnpkg.com/debian/ stable main' | tee /etc/apt/sources.list.d/yarn.list \
&& curl -fsSL https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - \
&& echo 'deb https://packages.cloud.google.com/apt cloud-sdk-xenial main' | tee /etc/apt/sources.list.d/gcloud.list \
&& curl -fsSL https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& echo "deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main" | tee /etc/apt/sources.list.d/google.list \
&& echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list \
&& curl https://bazel.build/bazel-release.pub.gpg | apt-key add - \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
bazel-3.6.0 \
ccache \
google-cloud-sdk \
lsof \
Expand Down Expand Up @@ -288,7 +287,7 @@ RUN apt-get purge -y \
RUN rm -rf /tmp/* /var/lib/apt/lists/*

RUN ln -s /go/src/github.com/cockroachdb/cockroach/build/builder/mkrelease.sh /usr/local/bin/mkrelease \
&& ln -s /usr/bin/bazel-3.7.0 /usr/bin/bazel
&& ln -s /usr/bin/bazel-3.6.0 /usr/bin/bazel

RUN curl -fsSL https://github.com/benesch/autouseradd/releases/download/1.2.0/autouseradd-1.2.0-amd64.tar.gz \
| tar xz -C / --strip-components 1
Expand Down
2 changes: 1 addition & 1 deletion pkg/sql/parser/sql-gen.sh
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

# This is used through bazel when generating sql.go. Look at BUILD.bazel for
# usage.
Expand Down

0 comments on commit 6debfee

Please sign in to comment.