├── .gitignore ├── LICENSE ├── Makefile ├── README.md ├── all.nix ├── daily.nix ├── generate-jobs ├── Makefile ├── metajob.json └── release.nix ├── lib ├── build.nix ├── fattenArchives.sh ├── package.nix ├── prelude.nix ├── source.nix └── test.nix ├── patch └── debdeps.patch ├── release.nix └── test-commit.nix /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | result 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016, Etienne Laurin 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | 1. Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | 11 | 2. Redistributions in binary form must reproduce the above copyright 12 | notice, this list of conditions and the following disclaimer in the 13 | documentation and/or other materials provided with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 16 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 17 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | check: 2 | nix-instantiate --show-trace --option restrict-eval true -I .. all.nix -K 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Continuous integration for RethinkDB 2 | 3 | These scripts run on my [Thanos](https://thanos.atnnn.com) build 4 | server, allowing us to build [RethinkDB](http://github.com/rethinkdb/rethinkdb), run the tests and build 5 | packages. 6 | 7 | To add your own server to the build farm contact me at 8 | etienne@atnnn.com. I need macOS, Windows and Linux (PC and ARM) 9 | machines to extend the test coverage and add packages for Windows, for 10 | macOS and for other Linux distributions. I would also like to run the 11 | performance tests. 12 | 13 | ## Download Packages 14 | 15 | Thanos currently builds packages for Ubuntu and Centos. I will try to 16 | add more packages if there is any demand. 17 | 18 | Build artifacts and packages haven't been organised yet, but they are available: 19 | 20 | * Open the RethinkDB project page at 21 | https://thanos.atnnn.com/project/rethinkdb 22 | 23 | * Click on the branch you want to download, and locate the *Jobs* 24 | tab. For example, the `next` branch: 25 | https://thanos.atnnn.com/jobset/rethinkdb/next#tabs-jobs 26 | 27 | * Click the green checkbox next to the package you want 28 | 29 | * Locate the download links in the Build Products section 30 | 31 | # Contributing 32 | 33 | ## Local Setup 34 | 35 | Running these scripts locally requires [Nix](http://nixos.org/nix/). 36 | 37 | Checkout RethinkDB and RethinkDB-Nix side-by-side: 38 | 39 | ``` 40 | git clone https://github.com/rethinkdb/rethinkdb 41 | git clone https://github.com/rethinkdb/rethinkdb-nix 42 | ``` 43 | 44 | Syntax-check the scripts: 45 | 46 | ``` 47 | make check 48 | ``` 49 | 50 | Build a RethinkDB source tarball: 51 | 52 | ``` 53 | nix-build -I .. all.nix -A sourceTgz 54 | ``` 55 | 56 | `nix-build` parameters that can help debug errors are: 57 | 58 | * `-K` - keep the build folder on failure 59 | * `-v`, `-vv`, ... - be more verbose 60 | * `--show-trace` - stack traces for nix errors 61 | 62 | -------------------------------------------------------------------------------- /all.nix: -------------------------------------------------------------------------------- 1 | { debug ? false }: 2 | let lib = import lib/prelude.nix {}; in 3 | with lib; 4 | 5 | let 6 | inputs.rethinkdb = ; 7 | 8 | source = loadModule lib/source.nix inputs; 9 | build = loadModule lib/build.nix (inputs // source); 10 | package = loadModule lib/package.nix source; 11 | test = loadModule lib/test.nix (inputs // source // build); 12 | in 13 | 14 | package.debs // package.rpms // build.matrixBuilds // test.reqlTests // { 15 | inherit (source) sourcePrep fetchDependencies sourceTgz; 16 | inherit (test) unitTests checkStyle unitTestsBroken integrationTests; 17 | inherit (build) buildDeps debugBuild; 18 | } // (if !debug then {} else { 19 | inherit source build package test; 20 | }) 21 | -------------------------------------------------------------------------------- /daily.nix: -------------------------------------------------------------------------------- 1 | import ./all.nix {} 2 | -------------------------------------------------------------------------------- /generate-jobs/Makefile: -------------------------------------------------------------------------------- 1 | check: 2 | F=`mktemp`; \ 3 | curl "https://api.github.com/repos/rethinkdb/rethinkdb/pulls" > "$$F"; \ 4 | nix-instantiate -I rethinkdb-nix=.. --arg pullRequests "$$F" release.nix --show-trace 5 | -------------------------------------------------------------------------------- /generate-jobs/metajob.json: -------------------------------------------------------------------------------- 1 | { 2 | "enabled": 1, 3 | "hidden": true, 4 | "description": "Meta-job v8", 5 | "nixexprinput": "rethinkdb-nix", 6 | "nixexprpath": "generate-jobs/release.nix", 7 | "checkinterval": 0, 8 | "schedulingshares": 100, 9 | "enableemail": true, 10 | "emailoverride": "", 11 | "keepnr": 3, 12 | "inputs": { 13 | "nixpkgs": { "type": "git", "value": "https://github.com/atnnn/nixpkgs", "emailresponsible": false }, 14 | "rethinkdb-nix": { "type": "git", "value": "https://github.com/rethinkdb/rethinkdb-nix", "emailresponsible": false }, 15 | "pull-requests": { "type": "path", "value": "https://api.github.com/repos/rethinkdb/rethinkdb/pulls", "emailresponsible": false } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /generate-jobs/release.nix: -------------------------------------------------------------------------------- 1 | { pkgs ? import {}, 2 | pullRequests ? }: 3 | let 4 | schedulingLow = 10; 5 | schedulingDefault = 100; 6 | schedulingHigh = 1000; 7 | 8 | jobset = { branch, job ? "test-commit", attrs ? {}, repo ? "rethinkdb/rethinkdb", checkinterval ? 0 }: { 9 | enabled = 1; 10 | hidden = false; 11 | description = "Build and test ${branch}"; 12 | nixexprinput = "rethinkdb-nix"; 13 | nixexprpath = "${job}.nix"; 14 | checkinterval = checkinterval; 15 | schedulingshares = schedulingDefault; 16 | enableemail = true; 17 | emailoverride = ""; 18 | keepnr = 10; 19 | inputs = { 20 | rethinkdb = { 21 | type = "git"; 22 | value = "git://github.com/${repo} ${branch} 1"; 23 | emailresponsible = false; 24 | }; 25 | rethinkdb-nix = metajob.inputs.rethinkdb-nix; 26 | nixpkgs = metajob.inputs.nixpkgs; 27 | }; 28 | } // attrs; 29 | 30 | metajob = builtins.fromJSON (builtins.readFile ); 31 | mainBranches = ["next" "v2.3.x" "v2.4.x"]; 32 | 33 | releases = [ 34 | { name = "v2.3.7"; branch = "v2.3.x"; type = "RC"; enabled = true; } 35 | { name = "v2.4.0"; branch = "v2.4.x"; type = "beta"; enabled = true; } 36 | { name = "v2.5.0"; branch = "next"; type = "alpha"; enabled = true; } 37 | ]; 38 | 39 | mainSpecs = builtins.foldl' (a: b: a // b) {} (map (branch: { 40 | "${branch}" = jobset { 41 | inherit branch; 42 | # checkinterval = 600; 43 | }; 44 | "daily-${branch}" = jobset { 45 | inherit branch; 46 | job = "daily"; 47 | # checkinterval = 86400; # 1 day 48 | attrs = { 49 | description = "Daily build of ${branch}"; 50 | schedulingshares = schedulingLow; 51 | keepnr = 30; 52 | }; 53 | }; 54 | } ) mainBranches); 55 | 56 | releaseSpecs = builtins.foldl' (a: b: a // b) {} (map (info: { 57 | "release-${info.name}" = jobset { 58 | branch = info.branch; 59 | # checkinterval = 600; 60 | job = "release"; 61 | attrs = { 62 | description = "Release ${info.name} ${info.type}"; 63 | keepnr = 100; 64 | schedulingshares = schedulingHigh; 65 | enabled = if info.enabled then 1 else 0; 66 | }; 67 | }; 68 | } ) releases); 69 | 70 | prSpecs = builtins.listToAttrs (map (pr: { 71 | name = "${toString pr.number}-${pr.user.login}"; 72 | value = jobset { 73 | repo = pr.head.repo.full_name or "${pr.user.login}/rethinkdb"; 74 | branch = pr.head.ref; 75 | # checkinterval = 600; 76 | attrs = { 77 | description = "[${pr.milestone.title or "unassigned"}] ${pr.title}"; 78 | 79 | # TODO: doesn't work. Maybe use 0 or 1 instead of true/false? 80 | # enabled = if pr.head == null then false else true; 81 | }; 82 | }; 83 | }) (builtins.fromJSON (builtins.unsafeDiscardStringContext (builtins.readFile pullRequests)))); 84 | 85 | specs = mainSpecs // prSpecs // releaseSpecs // { ".jobsets" = metajob; }; 86 | 87 | in { 88 | jobsets = pkgs.writeText "jobsets.json" (builtins.toJSON specs); 89 | } 90 | -------------------------------------------------------------------------------- /lib/build.nix: -------------------------------------------------------------------------------- 1 | { lib, sourcePrep, fetchList, fetchDependencies, fetchInfos, alwaysFetch, rethinkdbBuildInputsCC, rethinkdbBuildInputs, rawSource }: 2 | with lib; 3 | 4 | rec { 5 | buildDeps = buildDepsWith reCC builtins.currentSystem; 6 | buildDepsWith = cc: system: let 7 | rethinkdb = unsafeDiscardStringContext (toString rawSource); # TODO remove dependency on specific version 8 | in mkSimpleDerivation (rec { 9 | name = "rethinkdb-deps-${cc.name}-${system}"; 10 | inherit system; 11 | buildInputs = rethinkdbBuildInputsCC cc ++ [ cc pkgs.nodejs ]; 12 | buildCommand = '' 13 | cp -r ${rethinkdb}/* . 14 | chmod -R u+w . 15 | # sed -i "s/GYPFLAGS=/GYPFLAGS='-Dstandalone_static_library=1 '/" mk/support/pkg/v8.sh 16 | for x in $deps; do 17 | cp -r ''${!x}/* . 18 | chmod -R u+w . 19 | done 20 | patchShebangs . > /dev/null 21 | ./configure ${alwaysFetch} 22 | ${make} fetch 23 | patchShebangs external > /dev/null 24 | ${make} support VERBOSE=1 25 | 26 | bash $fattenArchives build/external/v8_*/lib/*.a 27 | 28 | mkdir -p $out/build/ 29 | cp -r build/external $out/build/ 30 | ''; 31 | env = { 32 | deps = map (info: info.varName) fetchInfos; 33 | fattenArchives = ./fattenArchives.sh; 34 | 35 | # TODO: should eventually not need this 36 | __noChroot = true; 37 | } // listToAttrs (for fetchInfos (depInfo: 38 | { name = depInfo.varName; value = getAttr depInfo.varName fetchDependencies; })); 39 | }); 40 | 41 | debugBuild = debugBuildWith reCC builtins.currentSystem; 42 | debugBuildWith = cc: system: mkSimpleDerivation rec { 43 | name = "rethinkdb-${env.src.version}-build-debug-${cc.name}-${system}"; 44 | inherit system; 45 | env = { 46 | src = sourcePrep; 47 | deps = buildDepsWith cc system; 48 | }; 49 | buildInputs = rethinkdbBuildInputsCC cc ++ [ cc ]; 50 | buildCommand = '' 51 | cp -r $src/* . 52 | chmod -R u+w . 53 | patchShebangs . > /dev/null 54 | ./configure --fetch jemalloc 55 | cp -r $deps/* . 56 | chmod -R u+w . 57 | ${make} DEBUG=1 58 | mkdir -p $out/build/debug 59 | cp build/debug/rethinkdb{,-unittest} $out/build/debug 60 | ''; 61 | }; 62 | 63 | matrixBuilds = listToAttrs (concatLists ( 64 | (flip mapAttrsToList) { inherit (pkgs) 65 | gcc48 gcc49 gcc5 gcc6 gcc7 66 | clang_34 clang_35 clang_37 clang_38 clang_39 clang_4 clang_5; 67 | } (ccName: cc: for [ "x86_64" "i686" ] (arch: 68 | { name = "${ccName}-${arch}"; 69 | value = debugBuildWith cc "${arch}-linux"; })))); 70 | } 71 | -------------------------------------------------------------------------------- /lib/fattenArchives.sh: -------------------------------------------------------------------------------- 1 | for archive in "$@"; do 2 | echo Fattening archive $archive 3 | cat << EOF > .fattenArchives.ar 4 | create $archive.fat 5 | addlib $archive 6 | save 7 | end 8 | EOF 9 | ar -M < .fattenArchives.ar 10 | mv $archive.fat $archive 11 | done 12 | -------------------------------------------------------------------------------- /lib/package.nix: -------------------------------------------------------------------------------- 1 | { lib, sourcePrep, mkFetch }: 2 | with lib; 3 | 4 | rec { 5 | debBuildDeps = [ 6 | "build-essential" "protobuf-compiler" "python" 7 | "libprotobuf-dev" "libcurl4-openssl-dev" 8 | "libboost-dev" "libncurses5-dev" 9 | "libjemalloc-dev" "wget" "m4" 10 | "libssl-dev" 11 | "devscripts" "debhelper" "fakeroot" 12 | ]; 13 | 14 | rpmExtraRepos = { 15 | centos6 = arch: { 16 | url = "http://linuxsoft.cern.ch/cern/devtoolset/slc6X/${arch}/yum/devtoolset/repodata/primary.xml.gz"; 17 | prefix = "http://linuxsoft.cern.ch/cern/devtoolset/slc6X/${arch}/yum/devtoolset"; 18 | hash = getAttr arch { 19 | i686 = "0m6wkm96435j4226cgf3x0p7z6gmdjgw3mrd2ybd4s5v3w648sgx"; 20 | x86_64 = "0zp7q8aayjk677d40hxby0lz2zwd2jwifz8jca4pli2k5gv4mbj5"; 21 | }; 22 | }; 23 | centos7 = { 24 | url = "https://dl.fedoraproject.org/pub/epel/7/x86_64/repodata/8b36e7f48bd4a63b0b5a4be88c0202a35d2092a753ac887035c47aa5769317ad-primary.xml.gz"; 25 | prefix = "https://dl.fedoraproject.org/pub/epel/7/x86_64"; 26 | hash = "1b8pjdvaayn46mq8ib2kly920pd30818rs2bb85kp9nligsffdlb"; 27 | }; 28 | }; 29 | 30 | rpmBuildDeps = rec { 31 | common = [ "tar" "which" "m4" ]; 32 | centos6 = common ++ [ "devtoolset-2" ]; 33 | centos7 = common ++ [ 34 | # centos 35 | "git" "gcc-c++" "ncurses-devel" "make" "ncurses-static" "zlib-devel" "zlib-static" "boost-static" 36 | # epel 37 | "protobuf-devel" "protobuf-static" "jemalloc-devel" 38 | ]; 39 | }; 40 | 41 | vmBuild = { diskImage, name, build, attrs ? {}, ncpu ? 6, memSize ? 4096 }: 42 | pkgs.vmTools.runInLinuxImage ((derivation (rec { 43 | inherit name memSize; 44 | builder = "${pkgs.bash}/bin/bash"; 45 | system = builtins.currentSystem; 46 | args = [ (toFile "builder.sh" ('' 47 | set -ex 48 | PATH=/usr/bin:/bin:/usr/sbin:/sbin 49 | '' + build)) ]; 50 | QEMU_OPTS = "-smp ${toString ncpu}"; 51 | } // attrs)) // { 52 | inherit diskImage; 53 | }); 54 | 55 | # TODO: remove when accepted upstream: https://github.com/NixOS/nixpkgs/pull/22009 56 | customDebDistros = with pkgs; with vmTools; with debDistros; debDistros // { 57 | ubuntu1610i386 = { 58 | name = "ubuntu-16.10-yakkety-i386"; 59 | fullName = "Ubuntu 16.10 Yakkety (i386)"; 60 | packagesLists = [ 61 | (fetchurl { 62 | url = mirror://ubuntu/dists/yakkety/main/binary-i386/Packages.xz; 63 | sha256 = "13r75sp4slqy8w32y5dnr7pp7p3cfvavyr1g7gwnlkyrq4zx4ahy"; 64 | }) 65 | (fetchurl { 66 | url = mirror://ubuntu/dists/yakkety/universe/binary-i386/Packages.xz; 67 | sha256 = "14fid1rqm3sc0wlygcvn0yx5aljf51c2jpd4x0zxij4019316hsh"; 68 | }) 69 | ]; 70 | urlPrefix = mirror://ubuntu; 71 | packages = commonDebPackages ++ [ "diffutils" "libc-bin" ]; 72 | }; 73 | ubuntu1610x86_64 = { 74 | name = "ubuntu-16.10-yakkety-amd64"; 75 | fullName = "Ubuntu 16.10 Yakkety (amd64)"; 76 | packagesList = [ 77 | (fetchurl { 78 | url = mirror://ubuntu/dists/yakkety/main/binary-amd64/Packages.xz; 79 | sha256 = "1lg3s8fhip14k423k5scn9iqya775sr7ikbkqisppxypn3x4qv1m"; 80 | }) 81 | (fetchurl { 82 | url = mirror://ubuntu/dists/yakkety/universe/binary-amd64/Packages.xz; 83 | sha256 = "1rjpa3miq28p9ag05l9k9w5sr1skkcjwca4k7f79gmpzzvw609m7"; 84 | }) 85 | ]; 86 | urlPrefix = mirror://ubuntu; 87 | packages = commonDebPackages ++ [ "diffutils" "libc-bin" ]; 88 | }; 89 | ubuntu1704i386 = { 90 | name = "ubuntu-17.04-zesty-i386"; 91 | fullName = "Ubuntu 17.04 Zesty (i386)"; 92 | packagesLists = 93 | [ (fetchurl { 94 | url = mirror://ubuntu/dists/zesty/main/binary-i386/Packages.xz; 95 | sha256 = "1794y32k29p9w6cyg6nvyz7yyxbyd2az31zxxvg1pjn5n244vbhk"; 96 | }) 97 | (fetchurl { 98 | url = mirror://ubuntu/dists/zesty/universe/binary-i386/Packages.xz; 99 | sha256 = "0lw1rrjfladxxarffmhkqigd126736iw6i4kxkdbxqp0sj5x6gw8"; 100 | }) 101 | ]; 102 | urlPrefix = mirror://ubuntu; 103 | packages = commonDebPackages ++ [ "diffutils" "libc-bin" ]; 104 | }; 105 | ubuntu1704x86_64 = { 106 | name = "ubuntu-17.04-zesty-amd64"; 107 | fullName = "Ubuntu 17.04 Zesty (amd64)"; 108 | packagesList = 109 | [ (fetchurl { 110 | url = mirror://ubuntu/dists/zesty/main/binary-amd64/Packages.xz; 111 | sha256 = "1fs0v6w831hlizzcri6dd08dbbrq7nmhzbw0a699ypdyy72cglk6"; 112 | }) 113 | (fetchurl { 114 | url = mirror://ubuntu/dists/zesty/universe/binary-amd64/Packages.xz; 115 | sha256 = "10rwysnwpz225xxjkl58maflqgykqi1rlrm0h0w5bis86jwp59ph"; 116 | }) 117 | ]; 118 | urlPrefix = mirror://ubuntu; 119 | packages = commonDebPackages ++ [ "diffutils" "libc-bin" ]; 120 | }; 121 | ubuntu1710i386 = { 122 | name = "ubuntu-17.10-artful-i386"; 123 | fullName = "Ubuntu 17.10 Artful (i386)"; 124 | packagesLists = 125 | [ (fetchurl { 126 | url = mirror://ubuntu/dists/artful/main/binary-i386/Packages.xz; 127 | sha256 = "1794y32k29p9w6cyg6nvyz7yyxbyd2az31zxxvg1pjn5n244vbhk"; 128 | }) 129 | (fetchurl { 130 | url = mirror://ubuntu/dists/artful/universe/binary-i386/Packages.xz; 131 | sha256 = "0lw1rrjfladxxarffmhkqigd126736iw6i4kxkdbxqp0sj5x6gw8"; 132 | }) 133 | ]; 134 | urlPrefix = mirror://ubuntu; 135 | packages = commonDebPackages ++ [ "diffutils" "libc-bin" ]; 136 | }; 137 | ubuntu1710x86_64 = { 138 | name = "ubuntu-17.10-artful-amd64"; 139 | fullName = "Ubuntu 17.10 Artful (amd64)"; 140 | packagesList = 141 | [ (fetchurl { 142 | url = mirror://ubuntu/dists/artful/main/binary-amd64/Packages.xz; 143 | sha256 = "1fs0v6w831hlizzcri6dd08dbbrq7nmhzbw0a699ypdyy72cglk6"; 144 | }) 145 | (fetchurl { 146 | url = mirror://ubuntu/dists/artful/universe/binary-amd64/Packages.xz; 147 | sha256 = "10rwysnwpz225xxjkl58maflqgykqi1rlrm0h0w5bis86jwp59ph"; 148 | }) 149 | ]; 150 | urlPrefix = mirror://ubuntu; 151 | packages = commonDebPackages ++ [ "diffutils" "libc-bin" ]; 152 | }; 153 | debian8i386 = debian8i386 // { 154 | packagesList = fetchurl { 155 | url = "mirror://debian/dists/jessie/main/binary-i386/Packages.xz"; 156 | sha256 = "1s1z7dp93lz8gxzfrvc7avczhv43r75mq8gdlmkjxay49n9wpjki"; 157 | }; 158 | }; 159 | debian8x86_64 = debian8x86_64 // { 160 | packagesList = fetchurl { 161 | url = "mirror://debian/dists/jessie/main/binary-amd64/Packages.xz"; 162 | sha256 = "1wqp9a44i65434ik04r536lk6vsv7wbhl3yh4qbww18zyfpbmkxl"; 163 | }; 164 | }; 165 | debian9x86_64 = { 166 | name = "debian-stretch-amd64"; 167 | fullName = "Debian Stretch (amd64)"; 168 | packagesList = fetchurl { 169 | url = mirror://debian/dists/stretch/main/binary-amd64/Packages.xz; 170 | sha256 = "1ihfcrrjz2nwh5wxa8b90m24b5z7q5p1h2ydfg9f1b6pdk81f6ji"; 171 | }; 172 | urlPrefix = mirror://debian; 173 | packages = commonDebianPackages; 174 | }; 175 | debian9i386 = { 176 | name = "debian-stretch-i386"; 177 | fullName = "Debian Stretch (i386)"; 178 | packagesList = fetchurl { 179 | url = mirror://debian/dists/stretch/main/binary-i386/Packages.xz; 180 | sha256 = "08gikw2pfm76fdl14b6sjx07dwp70ycgdj3zir296b7xrwiymima"; 181 | }; 182 | urlPrefix = mirror://debian; 183 | packages = commonDebianPackages; 184 | }; 185 | }; 186 | 187 | addRPMRepo = repo: distro: distro // { 188 | packagesLists = (distro.packagesLists or [ distro.packagesList ]) ++ [ ( 189 | pkgs.fetchurl { 190 | url = repo.url; 191 | sha256 = repo.hash; 192 | } 193 | ) ]; 194 | urlPrefixes = (distro.urlPrefixes or [ distro.urlPrefix ]) ++ [ repo.prefix ]; 195 | }; 196 | customRpmDistros = with pkgs; with vmTools; with rpmDistros; rpmDistros // { 197 | centos65i386 = addRPMRepo (rpmExtraRepos.centos6 "i686") centos65i386; 198 | centos65x86_64 = addRPMRepo (rpmExtraRepos.centos6 "x86_64") centos65x86_64; 199 | centos71x86_64 = addRPMRepo rpmExtraRepos.centos7 centos71x86_64; 200 | }; 201 | 202 | # copied from nixpkgs 203 | diskImageFuns = 204 | (pkgs.lib.mapAttrs (name: as: as2: pkgs.vmTools.makeImageFromDebDist (as // as2)) customDebDistros) 205 | // (pkgs.lib.mapAttrs (name: as: as2: pkgs.vmTools.makeImageFromRPMDist (as // as2)) customRpmDistros); 206 | 207 | debs = with diskImageFuns; 208 | listToAttrs (concatLists (for [ 209 | { name = "artful"; 210 | b64 = ubuntu1710x86_64; 211 | b32 = ubuntu1710i386; 212 | extra = [ "clang" "libssl1.0-dev" ]; } 213 | { name = "xenial"; 214 | b64 = ubuntu1604x86_64; 215 | b32 = ubuntu1604i386; } 216 | { name = "trusty"; 217 | b64 = ubuntu1404x86_64; 218 | b32 = ubuntu1404i386; } 219 | { name = "jessie"; 220 | b64 = debian8x86_64; 221 | b32 = debian8i386; } 222 | { name = "stretch"; 223 | b64 = debian9x86_64; 224 | b32 = debian9i386; } 225 | ] ({ name, b64, b32, extra ? [] }: let 226 | dsc = vmBuild { 227 | name = "rethinkdb-${sourcePrep.version}-${name}-src"; 228 | attrs = { src = sourcePrep; }; 229 | build = '' 230 | cp -r $src rethinkdb 231 | cd rethinkdb 232 | ./configure 233 | 234 | make -j 6 build-deb-src UBUNTU_RELEASE=${name} SIGN_PACKAGE=0 235 | cp build/packages/*.{dsc,build,changes,tar.?z} $out 236 | mkdir $out/nix-support 237 | for p in $out/*.*; do 238 | echo file deb-source "$p" >> $out/nix-support/hydra-build-products 239 | done 240 | ''; 241 | memSize = 4096; 242 | diskImage = b64 { extraPackages = debBuildDeps ++ extra; }; 243 | }; 244 | deb = arch: diskImage: vmBuild { 245 | name = replace "-src$" "-${arch}" dsc.name; 246 | attrs = { src = dsc; }; 247 | build = '' 248 | PATH=/usr/bin:/bin:/usr/sbin:/sbin 249 | mkdir /build 250 | dpkg-source -x $src/*.dsc /build/source 251 | cd /build/source 252 | debuild -b -us -uc -j6 253 | cp ../*.deb $out 254 | mkdir $out/nix-support 255 | for deb in $out/*.deb; do 256 | echo file deb "$deb" >> $out/nix-support/hydra-build-products 257 | done 258 | ''; 259 | memSize = 8192; 260 | diskImage = diskImage {extraPackages = debBuildDeps ++ extra; }; 261 | }; 262 | in [ 263 | { name = "${name}-src"; value = dsc; } 264 | { name = "${name}-i386"; value = deb "i386" b32; } 265 | { name = "${name}-amd64"; value = deb "amd64" b64; } 266 | ]))); 267 | 268 | rpms = with diskImageFuns; 269 | listToAttrs (for [ 270 | { name = "centos7"; 271 | arch = "x86_64"; 272 | image = centos71x86_64; } 273 | { name = "centos6"; 274 | arch = "x86_64"; 275 | image = centos65x86_64; 276 | extraFetch = ["protobuf" "jemalloc" "boost"]; } 277 | # TODO: build fails with "package bzip2 doesn't exist" 278 | # { name = "centos6"; 279 | # arch = "i386"; 280 | # image = centos65i386; } 281 | ] ({ name, arch, image, extraFetch ? [] }: let 282 | fetchList = [ "openssl" "curl" "libidn" "zlib" ] ++ extraFetch; 283 | rpm = vmBuild { 284 | name = "rethinkdb-${sourcePrep.version}-${name}-${arch}"; 285 | attrs = { 286 | src = sourcePrep; 287 | fpm = pkgs.fpm; 288 | fetched = mkFetch fetchList; 289 | }; 290 | build = '' 291 | PATH=$fpm/bin:/usr/bin:/bin:/usr/sbin:/sbin 292 | ${if name == "centos6" then "source /opt/rh/devtoolset-2/enable" else ""} 293 | cp -r $src /build 294 | cp -r $fetched/* /build/ 295 | cd /build 296 | 297 | # TODO: conditionally `--fetch all' upstream 298 | # TODO: centos is missing krb5-static: https://bugzilla.redhat.com/show_bug.cgi?id=838782 299 | ./configure --static all --prefix=/usr --sysconfdir=/etc --localstatedir=/var \ 300 | ${concatStringsSep " " (map (d: "--fetch ${d}") fetchList)} 301 | export NOCONFIGURE=1 302 | 303 | scripts/build-rpm.sh 304 | cp build/release/rethinkdb.debug build/packages/rethinkdb*.rpm $out 305 | mkdir $out/nix-support 306 | echo file debug-symbols $out/rethinkdb.debug >> $out/nix-support/hydra-build-products 307 | for rpm in $out/*.rpm; do 308 | echo file rpm "$rpm" >> $out/nix-support/hydra-build-products 309 | done 310 | ''; 311 | memSize = 8192; 312 | diskImage = image { extraPackages = getAttr name rpmBuildDeps; size = 8192; }; 313 | }; 314 | in { name = "${name}-${arch}"; value = rpm; })); 315 | 316 | } 317 | -------------------------------------------------------------------------------- /lib/prelude.nix: -------------------------------------------------------------------------------- 1 | { pkgs ? import {} }: 2 | 3 | let lib = rec { 4 | inherit (builtins) 5 | toFile readFile concatStringsSep unsafeDiscardStringContext 6 | listToAttrs match head tail toJSON toPath elemAt getAttr length 7 | trace genList isString fromJSON getEnv concatLists toString 8 | isAttrs hasAttr attrNames intersectAttrs functionArgs replaceStrings; 9 | 10 | inherit pkgs; 11 | inherit (pkgs.lib) mapAttrs mapAttrsToList flip callPackageWith; 12 | 13 | loadModule = path: attrs: 14 | let fn = import path; in 15 | fn ({ inherit lib; } // intersectAttrs (functionArgs fn) attrs); 16 | 17 | foldl = builtins.foldl'; #' 18 | tracing = x: trace x x; 19 | for = xs: f: map f xs; 20 | 21 | forAttrs = obj: f: mapAttrs f obj; 22 | 23 | replace = pattern: replacement: string: 24 | let group = match "(.*)(${pattern})(.*)" string; 25 | in if group == null then string else 26 | replace pattern replacement (elemAt group 0) 27 | + (if isString replacement then replacement 28 | else replacement (genList (i: elemAt group (i + 2)) (length group - 3))) 29 | + elemAt group (length group - 1); 30 | 31 | split = string: 32 | if string == "" then [] else 33 | let group = tracing (match "([^ ]*) +(.*)" string); 34 | in if group == null then [string] 35 | else [(head group)] ++ split (elemAt group 1); 36 | 37 | make = "make -j $NIX_BUILD_CORES -l $NIX_BUILD_CORES"; 38 | 39 | mkStdBuilder = script: toFile "builder.sh" ("source $stdenv/setup\n" + script); 40 | 41 | reCC = pkgs.gcc5; 42 | reCC_broken = pkgs.ccacheWrapper.override { 43 | extraConfig = '' 44 | export CCACHE_COMPRESS=1 45 | export CCACHE_DIR=/home/nix/ccache # chown root:build, chmod 770 46 | export CCACHE_UMASK=007 47 | export CCACHE_COMPILERCHECK=none 48 | export CCACHE_MAXSIZE=100G 49 | ''; 50 | }; 51 | 52 | mkSimpleDerivation = { 53 | name, 54 | buildCommand, 55 | system ? builtins.currentSystem, 56 | env ? {}, 57 | buildInputs ? [], 58 | useDefaultBuildInputs ? true 59 | }: derivation (env // { 60 | inherit system name; 61 | builder = "${pkgs.bash}/bin/bash"; 62 | buildInputs = buildInputs ++ (if useDefaultBuildInputs 63 | then with pkgs; [ 64 | coreutils findutils gnugrep gnused bash patchShebangs gnumake 65 | gnutar bzip2 binutils gawk gzip patch 66 | ] 67 | else []); 68 | args = [ (toFile "builder.sh" (unsafeDiscardStringContext '' 69 | set -eu 70 | for pkg in $buildInputs; do 71 | test ! -d $pkg/bin || export PATH="$pkg/bin:$PATH" 72 | test ! -d $pkg/lib || export LIBRARY_PATH="$pkg/lib:''${LIBRARY_PATH:-}" 73 | test ! -d $pkg/include || export C_INCLUDE_PATH="$pkg/include:''${C_INCLUDE_PATH:-}" 74 | test ! -d $pkg/include || export CPLUS_INCLUDE_PATH="$pkg/include:''${CPLUS_INCLUDE_PATH:-}" 75 | done 76 | test ! -v LIBRARY_PATH || export LIBRARY_PATH=''${LIBRARY_PATH%:} 77 | test ! -v INCLUDE_PATH || export C_INCLUDE_PATH=''${C_INCLUDE_PATH%:} 78 | test ! -v INCLUDE_PATH || export CPLUS_INCLUDE_PATH=''${CPLUS_INCLUDE_PATH%:} 79 | export hardeningDisable=all 80 | ${buildCommand} 81 | '')) ]; 82 | }); 83 | 84 | patchShebangs = mkSimpleDerivation { 85 | useDefaultBuildInputs = false; 86 | buildInputs = with pkgs; [coreutils findutils gnugrep gnused bash]; 87 | name = "patch-shebangs"; 88 | buildCommand = '' 89 | mkdir -p $out/bin 90 | cat > $out/bin/patchShebangs << EOF 91 | #!$bash/bin/bash 92 | echo "ARGS: \$*" 93 | set -e 94 | header() { echo "\$@"; } 95 | stopNest() { :; } 96 | PATH="$findutils/bin:\$PATH" 97 | . $patchShebangs 98 | fixupOutputHooks= 99 | patchShebangs "\$@" 100 | EOF 101 | chmod +x $out/bin/patchShebangs 102 | ''; 103 | env = { 104 | patchShebangs = ; 105 | bash = pkgs.bash; 106 | findutils = pkgs.findutils; 107 | }; 108 | }; 109 | }; 110 | in lib 111 | -------------------------------------------------------------------------------- /lib/source.nix: -------------------------------------------------------------------------------- 1 | { lib, rethinkdb }: 2 | with lib; 3 | 4 | rec { 5 | rawSource = rethinkdb; 6 | 7 | rethinkdbBuildInputsCC = cc: with pkgs; let 8 | protobuf' = protobuf.override { stdenv = overrideCC stdenv cc; }; in [ 9 | protobuf' # protobuf'.lib 10 | python27Full 11 | zlib zlib.dev 12 | openssl.dev openssl.out 13 | boost.dev 14 | curl curl.out curl.dev 15 | binutils binutils-unwrapped 16 | ]; 17 | rethinkdbBuildInputs = rethinkdbBuildInputsCC pkgs.stdenv.cc; 18 | 19 | scripts = concatStringsSep " " [ 20 | "configure" "drivers/convert_protofile" "scripts/gen-version.sh" 21 | "mk/support/pkg/pkg.sh" "test/run" "external/v8_*/build/gyp/gyp" 22 | ]; 23 | patchScripts = '' 24 | for script in ${scripts}; do 25 | if [[ -e $script ]]; then 26 | cp $script $script.orig 27 | patchShebangs $script 28 | fi 29 | done 30 | ''; 31 | unpatchScripts = dest: '' 32 | for script in ${scripts}; do 33 | test ! -e $script.orig || cp $script.orig ${dest}/$script 34 | done 35 | ''; 36 | 37 | versionFile = mkSimpleDerivation { 38 | name = "rethinkdb-version"; 39 | env.src = rethinkdb; 40 | buildInputs = [ pkgs.git ]; 41 | buildCommand = '' 42 | cd $src 43 | echo -n $(bash scripts/gen-version.sh) > $out 44 | ''; 45 | }; 46 | 47 | depInfo = dep: let 48 | source = readFile (toPath "${rawSource}/mk/support/pkg/${dep}.sh"); 49 | find = var: let go = source: val: 50 | let group = match "(.*?)\n *${var}=\"?([^\"\n]*)\"?\n.*" source; 51 | in if group == null then val else go (head group) (elemAt group 1); 52 | in go source null; 53 | rawUrl = find "src_url"; 54 | substVersion = version: groups: replaceStrings [(elemAt groups 0)] [(elemAt groups 1)] version; 55 | in rec { 56 | version = replace "/-patched.*/" "" (find "version"); 57 | url = if rawUrl == null then null 58 | else replace "\\$\\{?version([^}]*})?" version 59 | (replace "\\$\\{version//([^/]+)/([^}]*)}" (substVersion version) rawUrl); 60 | sha1 = find "src_url_sha1"; 61 | varName = replace "-" "_" dep; 62 | name = dep; 63 | }; 64 | 65 | alwaysFetch = "--fetch jemalloc --fetch coffee-script --fetch browserify"; 66 | 67 | mkFetch = fetch_list: let 68 | depInfos = map (dep: depInfo dep) fetch_list; 69 | in mkSimpleDerivation (rec { 70 | name = "rethinkdb-dependencies-src"; 71 | buildCommand = "set -x\n mkdir $out\n" + 72 | concatStringsSep "\n" 73 | (map (info: "cp -r --no-preserve=all ${"$"}${info.varName}/* $out/") depInfos); 74 | buildInputs = [ rawSource ]; 75 | env = listToAttrs (concatLists (map (info: let 76 | dep = info.name; 77 | bothNames = val: [ { name = dep; value = val; } { name = info.varName; value = val; } ]; 78 | in bothNames (if info.url != null 79 | then mkSimpleDerivation { 80 | name = "rethinkdb-fetch-${dep}-${info.version}"; 81 | # TODO: doesn't work on hydra? 82 | # src = pkgs.fetchurl { 83 | # url = info.url; 84 | # sha1 = info.sha1; 85 | # }; 86 | buildInputs = [ pkgs.curl pkgs.coreutils ]; 87 | buildCommand = '' 88 | mkdir -p $out/external/.cache 89 | # TODO: ln -s $src $out/external/.cache/''${src#*-} 90 | src="${info.url}" 91 | curl -L "$src" > $out/external/.cache/''${src##*/} 92 | # TODO: check sha1 93 | ''; 94 | env.__noChroot = true; 95 | } else mkSimpleDerivation { 96 | name = "rethinkdb-fetch-${dep}-${info.version}"; 97 | buildCommand = '' 98 | cp -r $rethinkdb/* . 99 | chmod -R u+w . 100 | ./configure --fetch ${dep} ${alwaysFetch} 101 | make fetch-${dep} 102 | mkdir -p $out/external 103 | cp -r external/${dep}_* $out/external/ 104 | ''; 105 | buildInputs = rethinkdbBuildInputs ++ [ reCC pkgs.nodejs ]; 106 | env = { 107 | __noChroot = true; 108 | rethinkdb = unsafeDiscardStringContext (toString rawSource); 109 | }; 110 | }) 111 | ) depInfos)); 112 | }); 113 | 114 | fetchList = [ "v8" "jemalloc" "admin-deps" "browserify" "coffee-script" "bluebird" ]; 115 | fetchInfos = map (dep: depInfo dep) fetchList; 116 | 117 | fetchDependencies = mkFetch fetchList; 118 | 119 | sourcePrep = mkSimpleDerivation rec { 120 | name = "rethinkdb-${env.version}"; 121 | buildCommand = '' 122 | export HOME=$TEMP # needed by gulp dependency v8-flags 123 | 124 | # TODO: https://github.com/NixOS/nixpkgs/issues/13744 125 | export SSL_CERT_FILE=$cacert/etc/ssl/certs/ca-bundle.crt 126 | 127 | mkdir rethinkdb 128 | cp -r $src/* rethinkdb/ 129 | chmod -R u+w rethinkdb 130 | cd rethinkdb 131 | 132 | # TODO: move upstream 133 | sed -i 's/reset-dist-dir: FORCE | web-assets/reset-dist-dir: FORCE/' mk/packaging.mk 134 | sed -i 's/install: build/install:/' packaging/debian/rules 135 | patch -p1 < "${../patch/debdeps.patch}" 136 | 137 | echo "${env.version}" > VERSION.OVERRIDE 138 | cp -r --no-preserve=all $fetchDependencies/* . 139 | ${patchScripts} 140 | ./configure ${alwaysFetch} 141 | ${make} dist-dir DIST_DIR=$out 142 | ${unpatchScripts "$out"} 143 | ''; 144 | env = { 145 | version = unsafeDiscardStringContext (readFile versionFile); 146 | __noChroot = true; 147 | src = rawSource; 148 | inherit fetchDependencies; 149 | cacert = pkgs.cacert; 150 | }; 151 | buildInputs = with pkgs; rethinkdbBuildInputs ++ [ git nix unzip reCC nodejs ]; 152 | }; 153 | 154 | sourceTgz = mkSimpleDerivation rec { 155 | name = "rethinkdb-${env.src.version}-source"; 156 | env.src = sourcePrep; 157 | buildInputs = [ pkgs.gnutar ]; 158 | buildCommand = '' 159 | mkdir $out 160 | cd $src 161 | tar --transform 's|^.|rethinkdb-${env.src.version}|' --owner rethinkdb --group rethinkdb --mode ug+w -zcf $out/rethinkdb-${env.src.version}.tgz ./ 162 | mkdir $out/nix-support 163 | echo file source-dist $out/rethinkdb-${env.src.version}.tgz > $out/nix-support/hydra-build-products 164 | ''; 165 | }; 166 | } 167 | -------------------------------------------------------------------------------- /lib/test.nix: -------------------------------------------------------------------------------- 1 | { lib, sourcePrep, alwaysFetch, fetchDependencies, debugBuild, rethinkdbBuildInputs, rawSource }: 2 | with lib; 3 | 4 | rec { 5 | 6 | # TODO: add job to run known failures 7 | known_failures = [ 8 | # known failures (TODO: fix upstream) 9 | "unit.UtilsTest" 10 | "unit.TimerTest" 11 | 12 | # Heavy tests that may sometimes fail 13 | "unit.RDBProtocol" # .SindexFuzzCreateDrop 14 | "unit.RDBBtree" # .SindexPostConstruct 15 | "unit.RDBInterrupt" 16 | "unit.ClusteringRaft" 17 | ]; 18 | skipTests = tests: 19 | concatStringsSep " " (map (t: "'!" + t + "'") tests); 20 | 21 | runTests = { testName, testsPattern, neverFail ? false, setup ? "", additionalInputs ? [], jobs ? null, verbose ? false }: mkSimpleDerivation rec { 22 | name = "rethinkdb-${testName}-results-${env.rethinkdb.version}"; 23 | env = { 24 | rethinkdb = sourcePrep; 25 | inherit debugBuild; 26 | }; 27 | buildInputs = rethinkdbBuildInputs ++ [ pkgs.git ] ++ additionalInputs; 28 | buildCommand = '' 29 | cp -r $rethinkdb/* . 30 | cp -r $debugBuild/* . 31 | chmod -R u+w . 32 | patchShebangs . 33 | 34 | ${setup} 35 | 36 | # TODO upstream remove dependency on git 37 | git init 38 | git config user.email joe@example.com 39 | git config user.name Joe 40 | git commit --allow-empty -m "empty" 41 | 42 | mkdir -p $out/nix-support 43 | test/run -H -j ${if jobs == null then "$((NIX_BUILD_CORES / 2))" else toString jobs} ${testsPattern} ${if verbose then "-v" else ""} || ${if neverFail then "true" else "touch $out/nix-support/failed"} 44 | test -e test/results/*/test_results.html 45 | cp -r test/results/* $out 46 | echo report html $out/*/test_results.html > $out/nix-support/hydra-build-products 47 | ''; 48 | }; 49 | 50 | unitTests = runTests { 51 | testName = "unit"; 52 | testsPattern = "unit ${skipTests known_failures}"; 53 | }; 54 | 55 | unitTestsBroken = runTests { 56 | testName = "unit-broken"; 57 | testsPattern = concatStringsSep " " known_failures; 58 | neverFail = true; 59 | }; 60 | 61 | checkStyle = mkSimpleDerivation { 62 | name = "check-style"; 63 | buildInputs = with pkgs; [ python ]; 64 | env.rethinkdb = rawSource; 65 | buildCommand = '' 66 | sed 's|^DIR=.*|DIR=$rethinkdb/scripts|; s|"$DIR"/cpplint|python "$DIR"/cpplint|' \ 67 | $rethinkdb/scripts/check_style.sh > check_style.sh 68 | bash check_style.sh | tee $out 69 | ''; 70 | }; 71 | 72 | integrationTests = runTests { 73 | testName = "integration"; 74 | testsPattern = "all '!unit' '!cpplint' ${skipTests known_failures}"; 75 | additionalInputs = [ reCC pkgs.procps ] ++ rethinkdbBuildInputs; 76 | setup = '' 77 | ./configure --allow-fetch 78 | make py-driver 79 | ''; 80 | }; 81 | 82 | testLang = { args, python ? pkgs.python, ruby ? pkgs.ruby, javascript ? pkgs.nodejs }: let 83 | hasGevent = builtins.elem python.pythonVersion [ "2.7" ]; # TODO: python 3 84 | in mkSimpleDerivation rec { 85 | name = "test-reql"; 86 | buildInputs = rethinkdbBuildInputs ++ [ reCC env.python env.ruby env.javascript ] ++ (with pkgs; [ procps utillinux iproute ]); 87 | env = { 88 | rethinkdb = sourcePrep; 89 | inherit debugBuild fetchDependencies; 90 | python = python.withPackages (p: with p; [ tornado twisted pyopenssl ] ++ (if hasGevent then [ gevent ] else [])); 91 | inherit ruby javascript; 92 | runTests = toFile "run-reql-tests.sh" '' 93 | ip link set dev lo up 94 | ./resunder.py start 95 | trap "./resunder.py stop" EXIT 96 | test/rql_test/test-runner -j 1 ${args} 97 | ''; 98 | }; 99 | buildCommand = '' 100 | cp -r $rethinkdb/* . 101 | cp -r $debugBuild/* . 102 | chmod u+w build external 103 | cp -r $fetchDependencies/* . 104 | chmod -R u+w . 105 | patchShebangs . > /dev/null 106 | 107 | # TODO: running tests shouldn't require building more than necessary 108 | ./configure ${alwaysFetch} 109 | ${make} build-coffee-script build-browserify 110 | patchShebangs build/external > /dev/null 111 | ${make} drivers 112 | 113 | mkdir -p $out/nix-support 114 | sed 's|/var/log/resunder.log|resunder.log|' test/common/resunder.py > resunder.py 115 | chmod u+x resunder.py 116 | unshare --net --map-root-user bash $runTests 117 | ''; 118 | }; 119 | 120 | reqlTests = mapAttrs (k: v: testLang v) rec { 121 | # TODO: test more interpreters 122 | testPython27 = { args = "-i py2.7 polyglot"; python = pkgs.python27Full; }; 123 | testPython35 = { args = "-i py3.5 polyglot"; python = pkgs.python35; }; 124 | # testJavascript = { args = "-i js polyglot"; javascript = pkgs.nodejs; }; 125 | testRuby22 = { args = "-i rb2.2 polyglot"; ruby = pkgs.ruby_2_2; }; 126 | otherTests = { args = "-i rb2.2 -i py backup changefeeds connections interface stream"; ruby = pkgs.ruby_2_2; }; # TODO: js 127 | }; 128 | } 129 | -------------------------------------------------------------------------------- /patch/debdeps.patch: -------------------------------------------------------------------------------- 1 | diff --git a/mk/packaging.mk b/mk/packaging.mk 2 | index 436e933227..24106bb711 100644 3 | --- a/mk/packaging.mk 4 | +++ b/mk/packaging.mk 5 | @@ -45,26 +45,21 @@ DIST_SUPPORT = $(foreach pkg, $(DIST_SUPPORT_PACKAGES), $(SUPPORT_SRC_DIR)/$(pkg 6 | DEB_BUILD_DEPENDS := libboost-dev, curl, m4, debhelper 7 | DEB_BUILD_DEPENDS += , fakeroot, python, libncurses5-dev, libcurl4-openssl-dev 8 | 9 | -ifneq ($(UBUNTU_RELEASE),) 10 | - ifneq ($(filter $(UBUNTU_RELEASE), trusty xenial),) 11 | - # RethinkDB fails to compile with GCC 6 (#5757) 12 | - DEB_BUILD_DEPENDS += , g++-5, libssl-dev 13 | - DSC_CONFIGURE_DEFAULT += CXX=g++-5 14 | - else 15 | - # RethinkDB fails to compile with GCC 6 (#5757) -- and there is 16 | - # no GCC 5 in later Ubuntus. We need to use libssl1.0-dev to be 17 | - # compatible with libcurl when linking. 18 | - DEB_BUILD_DEPENDS += , clang, libssl1.0-dev 19 | - DSC_CONFIGURE_DEFAULT += CXX=clang++ 20 | - endif 21 | -else ifneq ($(DEB_RELEASE),) 22 | - ifneq ($(filter $(DEB_RELEASE), jessie),) 23 | - DEB_BUILD_DEPENDS += , g++, libssl-dev 24 | - else 25 | - # As with Ubuntus. 26 | - DEB_BUILD_DEPENDS += , clang, libssl1.0-dev 27 | - DSC_CONFIGURE_DEFAULT += CXX=clang++ 28 | - endif 29 | +# RethinkDB fails to compile with GCC 6 (#5757) 30 | +ifneq (,$(findstring $(UBUNTU_RELEASE)$(DEB_RELEASE), artful xenial trusty)) 31 | + DEB_BUILD_DEPENDS += , g++-5 32 | + DSC_CONFIGURE_DEFAULT += CXX=g++-5 33 | +else ifneq (,$(findstring $(UBUNTU_RELEASE)$(DEB_RELEASE), clang)) 34 | + DEB_BUILD_DEPENDS += , clang 35 | +else 36 | + DEB_BUILD_DEPENDS += , g++ 37 | +endif 38 | + 39 | +# Pick the appropriate version of libssl 40 | +ifneq (,$(findstring $(UBUNTU_RELEASE)$(DEB_RELEASE), artful trusty xenial jessie)) 41 | + DEB_BUILD_DEPENDS += , libssl-dev 42 | +else 43 | + DEB_BUILD_DEPENDS += , libssl1.0-dev 44 | endif 45 | 46 | ifneq (1,$(BUILD_PORTABLE)) 47 | -------------------------------------------------------------------------------- /release.nix: -------------------------------------------------------------------------------- 1 | { inherit (import ./all.nix {}) 2 | 3 | # source 4 | fetchDependencies sourcePrep sourceTgz 5 | 6 | # tests 7 | unitTests checkStyle 8 | testPython35 testRuby22 otherTests integrationTests 9 | 10 | # packages 11 | jessie-amd64 jessie-i386 jessie-src 12 | stretch-amd64 stretch-i386 stretch-src 13 | trusty-amd64 trusty-i386 trusty-src 14 | xenial-amd64 xenial-i386 xenial-src 15 | artful-amd64 artful-i386 artful-src 16 | centos6-x86_64 centos7-x86_64 17 | ; 18 | } 19 | -------------------------------------------------------------------------------- /test-commit.nix: -------------------------------------------------------------------------------- 1 | { inherit (import ./all.nix {}) 2 | fetchDependencies sourcePrep unitTests checkStyle 3 | # TODO: re-enable PR tests when they pass reliably 4 | # testPython35 testRuby22 otherTests 5 | ; } 6 | 7 | 8 | 9 | --------------------------------------------------------------------------------