-
Notifications
You must be signed in to change notification settings - Fork 56
Building CockroachDB
The DRAFT instructions provided below specify the steps to build CockroachDB version 20.1.3 on Linux on IBM Z for the following distributions:
- Ubuntu 18.04
General Notes:
- When following the steps below please use a standard permission user unless otherwise specified.
- A directory
/<source_root>/will be referred to in these instructions, this is a temporary writable directory anywhere you'd like to place it.
If you'd like to build CockroachDB using the manual steps, please go to STEP 1.2.
Use the following commands to build CockroachDB using the build script. Please make sure you have wget installed.
wget -q https://raw.githubusercontent.com/linux-on-ibm-z/scripts/master/CockroachDB/20.1.3/build_crdb.sh
# Build CockroachDB
bash build_crdb.sh [Provide -t option for executing build with tests]
In case of any errors, check logs for more details or go to STEP 1.2 to follow the manual build steps.
export SOURCE_ROOT=/<source_root>/- Ubuntu 18.04
sudo apt-get update && sudo apt-get -y install g++ autoconf automake cmake wget libncurses5-dev bison xz-utils patch git curlcd $SOURCE_ROOT
wget https://storage.googleapis.com/golang/go1.13.11.linux-s390x.tar.gz
sudo tar -C /usr/local -xzf go1.13.11.linux-s390x.tar.gz
export PATH=/usr/local/go/bin:$PATHcd $SOURCE_ROOT
wget https://nodejs.org/dist/v12.18.2/node-v12.18.2-linux-s390x.tar.xz
chmod ugo+r node-v12.18.2-linux-s390x.tar.xz
sudo tar -C /usr/local -xf node-v12.18.2-linux-s390x.tar.xz
export PATH=$PATH:/usr/local/node-v12.18.2-linux-s390x/bin
node -v
# For Ubuntu
sudo env PATH=$PATH npm install -g yarncd
sudo chown -R $(whoami):$(whoami) .config -
Download source code
export GOPATH=$SOURCE_ROOT cd $SOURCE_ROOT mkdir -p $(go env GOPATH)/src/github.com/cockroachdb cd $(go env GOPATH)/src/github.com/cockroachdb git clone https://github.com/cockroachdb/cockroach cd cockroach git checkout v20.1.3 git submodule update --init --recursive # Fetch the submodules
-
Apply patches to vendor files using below command:
cd $SOURCE_ROOT/src/github.com/cockroachdb/cockroach/vendor curl -sSL https://raw.githubusercontent.com/linux-on-ibm-z/scripts/master/CockroachDB/20.1.3/patch/vendor.diff | git apply
-
Build and install
cd $(go env GOPATH)/src/github.com/cockroachdb/cockroach make build sudo env GOPATH=$GOPATH PATH=$PATH make install
cd $(go env GOPATH)/src/github.com/cockroachdb/cockroach
make testNote:
1. There are some test failures observed which are mentioned below and they are currently being investigated.
github.com/cockroachdb/cockroach/pkg/ccl/workloadccl/allccl
github.com/cockroachdb/cockroach/pkg/server
github.com/cockroachdb/cockroach/pkg/sql/logictest
github.com/cockroachdb/cockroach/pkg/sql/opt/memo
github.com/cockroachdb/cockroach/pkg/sql/opt/xform
github.com/cockroachdb/cockroach/pkg/sql/colexec
github.com/cockroachdb/cockroach/pkg/storage
cockroach versionOutput should look like:
Build Tag: v20.1.3-dirty
Build Time: 2020/08/26 21:52:19
Distribution: CCL
Platform: linux s390x (s390x-linux-gnu)
Go Version: go1.13.11
C Compiler: gcc 7.5.0
Build SHA-1: 7fd454f880f386cdd0eda6b21b12f6532c14f0db
Build Type: developmentPlease visit this link to start a local cluster and CockroachDB SQL.
https://www.cockroachlabs.com/docs
https://www.cockroachlabs.com/docs/stable/learn-cockroachdb-sql.html#before-you-begin
https://github.com/cockroachdb/cockroach
https://wiki.crdb.io/wiki/spaces/CRDB/pages/181338446/Getting+and+building+from+source
The information provided in this article is accurate at the time of writing, but on-going development in the open-source projects involved may make the information incorrect or obsolete. Please open issue or contact us on IBM Z Community if you have any questions or feedback.