Move build logic for the core hydra package into its own default.nix.

[?]
Apr 11, 2017, 5:07 PM
UBPWXGKFBD6VMQCCUE625I4NLLRNVD7BSJ6QD2XF7Z7A7T5BI5XAC

Dependencies

  • [2] HOMDMC3K Handle utf-8 properly
  • [3] F6IBTEIB Disable the S3 backup test
  • [4] RX5IIZMT Use Email::MIME instead of Email::Simple
  • [5] E4HX2C5Y Don't wrap hydra-queue-runner / hydra-eval-jobs
  • [6] 3QWDDLBR Add support for logging in via a Google account
  • [7] BAUP4PCK inNixShell considered harmful
  • [8] XCHVWNOO Don't wrap C++ programs
  • [9] J37GFZZZ Fix version
  • [10] GRRHPK5G release.nix: add missing dependency on nix
  • [11] GX5R7OKF Doh
  • [12] UKFZFDJO Remove the pretty-printed log
  • [13] IJCXGTEC Bump Nix dependency
  • [14] X4KYZJBQ Use latest nixUnstable
  • [15] GZFKERN3 Add dependency on nix-perl
  • [16] FGI75W53 move nix-prefetch-* into tarball
  • [17] VOPKXPFE Add OpenSSL as a dependency because Nix needs it
  • [18] X22X45IX Add Catalyst::DispatchType::Regex for forward compatibility
  • [19] FJAF7KWA Disable building the PDF manual
  • [20] Z5OWQ4KZ Check Nix version
  • [21] 3MDDGGSN * Install the manual.
  • [22] JTRG7RDQ add support for git as jobinput
  • [23] SAFVRDTK * Put Hydra's dependencies so that they can easily be installed in a
  • [24] PKTKSVTL Bump Nix
  • [25] OKEMZJLS Bump Nix
  • [26] VI32YSGA I should test first
  • [27] 4YCF3KBG Concurrent hydra-evaluator
  • [28] XCHBOA3S svn -> subversion
  • [29] RBZRCTAL hydra: fixed and re-enabled evaluation tests
  • [30] WSCHBYEN add topgit to hydra's path
  • [31] UQYHPQ6U Run PostgreSQL during "make check"
  • [32] T4LLYESZ * Nix expression for building Hydra.
  • [33] RJ5EREYU hydra: add bazaar to path
  • [34] XDKFASXT Add bzip2 to buildInputs.
  • [35] DFXIN6YW * Include jquery and tablesorter in the build.
  • [36] UHMUHQMU hydra: fix tarball build, add pre suffix to tarballs
  • [37] UGA45FNC Add a plugin for backing up builds in s3
  • [38] QUAK4CSF Use nixUnstable
  • [39] NRNR4QVJ Use stable Nix
  • [40] 7DEMMXE5 Bump Nix
  • [41] 6ID3AASF
  • [42] UMEQXUUH hydra: fix name of build jobset
  • [43] O25D52TA initial support for mercurial
  • [44] NLFVTH4Z
  • [45] NDJ6PZB7 * Fix symbol to look for.
  • [46] 3PNG7NIB Remove trailing whitespace
  • [47] 24BMQDZA Start of single-process hydra-queue-runner
  • [48] KVNTTRVT Enable debug info
  • [49] 5FSHNCJH Remove NetStatsd since it's also in Nixpkgs
  • [50] 4WWUVPOS * Urgh. Need some regression tests...
  • [51] X7IAG7JT Simplify running nix-shell
  • [52] DUUF3XJF Don't mess with $LOGNAME in nix-shell
  • [53] LOHWNXEJ Cleanup
  • [54] DODOGD7M Send queue runner stats to statsd
  • [55] 4VXOGC5P Remove Switch dependency, we're not using it
  • [56] DO432JDJ * Build Hydra with the Nix Perl bindings.
  • [57] WV7S66BI
  • [58] DN3VAAP4 hydra: remove HYDRA_HOME env var, not used
  • [59] 67QM2R5C Depend on Term::Size::Any
  • [60] KLUNCP6H Revert "Don't wrap hydra-queue-runner / hydra-eval-jobs"
  • [61] K4DKM74W release.nix use makeBinPath to construct PATH
  • [62] OKW75JT6
  • [63] 6K5PBUUN Use buildEnv to combine Hydra's Perl dependencies
  • [64] RTV57MPB if not linux, do not add rpm/dpkg/cdrkit to path
  • [65] YQWH4POV * Simplify.
  • [66] 66MEE6QG hydra-build: Don't send a giant query to the database
  • [67] IDP66ILE Use Google's verifier
  • [68] ZGBU7H7P * Pass nixUnstable to the tarball build.
  • [69] M3A5PZIH hydra: Clarify the dependency on BDW-GC.
  • [70] ZDEHAFHV Add a plugin for HipChat notification
  • [71] U2BNO3C5 hydra: fix build job
  • [72] M4JUF5V6 Drop obsolete graphviz dependency
  • [73] X5QBLQDG
  • [74] MC3YYO4V Use patched aws-sdk-cpp
  • [75] V2ALOFRR Fix the test
  • [76] HPIJ35SG
  • [77] GLHKDGJ4 hydra: revert 24180
  • [78] 5CNQUQ77 Bump Nix
  • [79] FSZJXAHR add sqlite to buildinputs
  • [80] 7I2VJDS6 Use pixz instead of bzip2 for compressing nars
  • [81] VM3TQZ65 * hydra: make manual.pdf
  • [82] HJECG75O hydrA: add some pkgs to buildinputs for tests
  • [83] TEGLW4X3 * hydra/release.nix: remove supportOldDBs
  • [84] WQ2VQ7H3 Use hydra-module.nix in the tests
  • [85] RRUSDIBL Add a job for the manual
  • [86] G3LEMSEQ Remove Term::Size::Any dependency
  • [87] F3GR3UC5 * Actually, include jquery and tablesorter in the source tarball.
  • [88] GTUZLZRH Add an S3-backed binary cache store
  • [89] WR22RPG2 Restore path in nix-shell
  • [90] 2554VN4T Fix ‘Unable to handle files with the extension 'conf'’
  • [91] IZYR3KTL release.nix: Get rid of the "system" argument
  • [92] LZVO64YG Merge in the first bits of the API work
  • [93] DWQCLOPQ Tweaks for nix-shell
  • [94] 34UH6B6L Build against the bleeding edge of Nix
  • [95] Y2BFYLLK * Install the SQL schemata in $out/share/hydra/sql.
  • [96] WTHZ4AGP hydra: remove some layout, test
  • [97] RYWAOMWA oops, should have added topgit to hydraPath
  • [98] L7RW467Z Add a test for darcs inputs.
  • [99] SWFCD4MW
  • [100] UQ6K57MS * Include nix-prefetch-svn in the Hydra binary distribution.
  • [101] KNLKTCDM Use pkgconfig to find Nix
  • [102] QK2OXCKP hydra/release.nix: move manual to tarball build, restore version in store path for tarball build
  • [*] CLXEECMF * Start putting build results in a database.

Change contents

  • file addition: default.nix (----------)
    [104.2]
    { stdenv
    , hydraSrc ? { outPath = ./.; revCount = 1234; rev = "abcdef"; }
    , version ? builtins.readFile ./version + "." + toString hydraSrc.revCount + "." + hydraSrc.rev
    , makeWrapper, libtool, unzip, nukeReferences, sqlite, libpqxx
    , guile ? null
    , perl, nix, postgresql92, perlPackages, openssh, buildEnv
    , autoreconfHook, pkgconfig, topGit, mercurial, darcs, subversion, bazaar
    , openssl, bzip2, libxslt, docbook_xsl, coreutils, findutils, pixz, gzip
    , lzma, gnutar, git, gnused, rpm, dpkg, cdrkit, boehmgc, aws-sdk-cpp
    }: assert builtins.compareVersions "6" stdenv.cc.cc.version < 1;
    let perlDeps = buildEnv {
    name = "hydra-perl-deps";
    paths = with perlPackages;
    [ ModulePluggable
    CatalystActionREST
    CatalystAuthenticationStoreDBIxClass
    CatalystDevel
    CatalystDispatchTypeRegex
    CatalystPluginAccessLog
    CatalystPluginAuthorizationRoles
    CatalystPluginCaptcha
    CatalystPluginSessionStateCookie
    CatalystPluginSessionStoreFastMmap
    CatalystPluginStackTrace
    CatalystPluginUnicodeEncoding
    CatalystTraitForRequestProxyBase
    CatalystViewDownload
    CatalystViewJSON
    CatalystViewTT
    CatalystXScriptServerStarman
    CryptRandPasswd
    DBDPg
    DBDSQLite
    DataDump
    DateTime
    DigestSHA1
    EmailMIME
    EmailSender
    FileSlurp
    IOCompress
    IPCRun
    JSONXS
    LWP
    LWPProtocolHttps
    NetAmazonS3
    NetStatsd
    PadWalker
    Readonly
    SQLSplitStatement
    SetScalar
    Starman
    SysHostnameLong
    TestMore
    TextDiff
    TextTable
    XMLSimple
    nix
    nix.perl-bindings
    git
    boehmgc
    aws-sdk-cpp
    ];
    };
    in stdenv.mkDerivation {
    name = "hydra-${version}";
    src = hydraSrc;
    buildInputs =
    [ makeWrapper autoreconfHook libtool unzip nukeReferences pkgconfig sqlite libpqxx
    topGit mercurial darcs subversion bazaar openssl bzip2 libxslt
    guile # optional, for Guile + Guix support
    perlDeps perl nix
    postgresql92 # for running the tests
    ];
    hydraPath = stdenv.lib.makeBinPath (
    [ sqlite subversion openssh nix coreutils findutils pixz
    gzip bzip2 lzma gnutar unzip git topGit mercurial darcs gnused bazaar
    ] ++ stdenv.lib.optionals stdenv.isLinux [ rpm dpkg cdrkit ] );
    configureFlags = [ "--with-docbook-xsl=${docbook_xsl}/xml/xsl/docbook" ];
    preHook = ''
    PATH=$(pwd)/src/hydra-evaluator:$(pwd)/src/script:$(pwd)/src/hydra-eval-jobs:$(pwd)/src/hydra-queue-runner:$PATH
    PERL5LIB=$(pwd)/src/lib:$PERL5LIB;
    '';
    preCheck = ''
    patchShebangs .
    export LOGNAME=${LOGNAME:-foo}
    '';
    postInstall = ''
    mkdir -p $out/nix-support
    for i in $out/bin/*; do #*/
    read -n 4 chars < $i
    if [[ $chars =~ ELF ]]; then continue; fi
    wrapProgram $i \
    --prefix PERL5LIB ':' $out/libexec/hydra/lib:$PERL5LIB \
    --prefix PATH ':' $out/bin:$hydraPath \
    --set HYDRA_RELEASE ${version} \
    --set HYDRA_HOME $out/libexec/hydra \
    --set NIX_RELEASE ${nix.name or "unknown"}
    done
    '';
    dontStrip = true;
    passthru.perlDeps = perlDeps;
    }
  • edit in release.nix at line 31
    [16.532][16.532:533](),[16.533][16.316:413]()
    version = builtins.readFile ./version + "." + toString hydraSrc.revCount + "." + hydraSrc.rev;
  • edit in release.nix at line 47
    [14.43][16.428:429](),[16.428][16.428:429](),[16.429][14.44:55](),[14.55][16.429:565](),[16.429][16.429:565](),[16.565][13.0:135](),[16.135][16.700:1016](),[13.135][16.700:1016](),[16.135][16.700:1016](),[16.135][16.700:1016](),[16.135][16.700:1016](),[16.192][16.700:1016](),[16.700][16.700:1016](),[16.1016][14.56:90](),[14.90][16.409:410](),[16.1016][16.409:410](),[16.409][16.409:410](),[16.410][16.36:133](),[16.875][16.36:133](),[16.133][16.0:28](),[16.28][16.0:31](),[16.31][16.28:77](),[16.28][16.28:77](),[16.77][16.32:58](),[16.58][16.0:38](),[16.77][16.0:38](),[16.38][16.182:426](),[16.77][16.182:426](),[16.182][16.182:426](),[16.426][2.0:42](),[2.42][16.39:84](),[16.426][16.39:84](),[16.84][16.426:556](),[16.426][16.426:556](),[6.21][16.601:734](),[16.31][16.601:734](),[16.601][16.601:734](),[16.734][4.0:22](),[4.22][16.734:780](),[16.734][16.734:780](),[16.45][16.780:841](),[16.780][16.780:841](),[16.841][16.59:128](),[16.128][16.411:433](),[16.128][16.841:863](),[16.433][16.841:863](),[16.841][16.841:863](),[16.889][16.889:910](),[16.22][16.910:940](),[16.910][16.910:940](),[16.940][16.129:151](),[16.151][16.940:960](),[16.940][16.940:960](),[16.1031][16.1031:1059](),[16.176][16.1059:1145](),[16.1059][16.1059:1145](),[16.1145][15.0:107](),[15.107][16.1165:1187](),[16.443][16.1165:1187](),[16.1058][16.1165:1187](),[16.1165][16.1165:1187]()
    /*
    nix = overrideDerivation nixUnstable (attrs: {
    src = fetchFromGitHub {
    owner = "NixOS";
    repo = "nix";
    rev = "4be4f6de56f4de77f6a376f1a40ed75eb641bb89";
    sha256 = "0icvbwpca1jh8qkdlayxspdxl5fb0qjjd1kn74x6gs6iy66kndq6";
    };
    buildInputs = attrs.buildInputs ++ [ autoreconfHook bison flex ];
    nativeBuildInputs = attrs.nativeBuildInputs ++ [ aws-sdk-cpp' autoconf-archive ];
    configureFlags = attrs.configureFlags + " --disable-doc-gen";
    preConfigure = "./bootstrap.sh; mkdir -p $doc $man";
    });
    */
    nix = nixUnstable;
    perlDeps = buildEnv {
    name = "hydra-perl-deps";
    paths = with perlPackages;
    [ ModulePluggable
    CatalystActionREST
    CatalystAuthenticationStoreDBIxClass
    CatalystDevel
    CatalystDispatchTypeRegex
    CatalystPluginAccessLog
    CatalystPluginAuthorizationRoles
    CatalystPluginCaptcha
    CatalystPluginSessionStateCookie
    CatalystPluginSessionStoreFastMmap
    CatalystPluginStackTrace
    CatalystPluginUnicodeEncoding
    CatalystTraitForRequestProxyBase
    CatalystViewDownload
    CatalystViewJSON
    CatalystViewTT
    CatalystXScriptServerStarman
    CryptRandPasswd
    DBDPg
    DBDSQLite
    DataDump
    DateTime
    DigestSHA1
    EmailMIME
    EmailSender
    FileSlurp
    IOCompress
    IPCRun
    JSONXS
    LWP
    LWPProtocolHttps
    NetAmazonS3
    NetStatsd
    PadWalker
    Readonly
    SQLSplitStatement
    SetScalar
    Starman
    SysHostnameLong
    TestMore
    TextDiff
    TextTable
    XMLSimple
    nix
    nix.perl-bindings
    git
    boehmgc
    aws-sdk-cpp'
    ];
    };
  • edit in release.nix at line 48
    [16.1188]
    [16.1188]
    stdenv6 = overrideCC stdenv gcc6;
  • replacement in release.nix at line 51
    [16.185][16.14:42](),[16.42][9.0:33](),[9.33][16.444:445](),[16.22][16.444:445](),[16.445][7.17:63](),[16.32][16.925:926](),[7.63][16.925:926](),[16.109][16.925:926](),[16.253][16.925:926](),[16.460][16.925:926](),[16.500][16.925:926](),[16.1759][16.925:926](),[16.925][16.925:926](),[16.926][16.193:233](),[16.233][16.1760:1780](),[16.926][16.1760:1780](),[16.1780][16.501:680](),[16.77][16.1343:1396](),[16.680][16.1343:1396](),[16.1343][16.1343:1396](),[16.1396][10.0:28](),[10.28][16.0:47](),[16.102][16.0:47](),[16.47][16.1420:1431](),[16.102][16.1420:1431](),[16.118][16.1420:1431](),[16.325][16.1420:1431](),[16.1420][16.1420:1431](),[16.11][16.1304:1305](),[16.302][16.1304:1305](),[16.725][16.1304:1305](),[16.1431][16.1304:1305](),[16.1952][16.1304:1305](),[16.1304][16.1304:1305](),[16.1305][16.0:36](),[16.36][12.0:65](),[12.65][16.0:92](),[16.105][16.0:92](),[16.416][16.0:92](),[16.92][16.511:576](),[16.179][16.511:576](),[16.511][16.511:576](),[16.576][16.74:75](),[16.2226][16.74:75](),[16.75][7.64:110](),[7.110][16.703:757](),[16.703][16.703:757](),[16.757][7.111:196](),[7.196][16.895:987](),[16.895][16.895:987](),[16.987][16.0:19](),[16.19][16.136:257](),[16.257][16.113:167](),[16.113][16.113:167](),[16.167][16.987:1066](),[16.987][16.987:1066](),[16.1066][16.0:93](),[16.75][16.0:93](),[16.93][16.1400:1401](),[16.115][16.1400:1401](),[16.210][16.1400:1401](),[16.411][16.1400:1401](),[16.2226][16.1400:1401](),[16.1400][16.1400:1401](),[16.1401][16.166:189](),[16.189][16.577:611](),[16.100][16.531:532](),[16.147][16.531:532](),[16.223][16.531:532](),[16.425][16.531:532](),[16.2601][16.531:532](),[16.531][16.531:532](),[16.1557][16.2693:2725](),[16.2725][8.0:87](),[8.87][16.2725:2883](),[5.110][16.2725:2883](),[16.2725][16.2725:2883](),[16.2883][16.1067:1116](),[16.1116][16.0:54](),[16.2994][16.0:54](),[16.54][3.0:59](),[3.59][16.3040:3053](),[16.3040][16.3040:3053](),[16.133][16.3389:3404](),[16.3389][16.3389:3404](),[16.3404][16.0:1](),[16.1][8.88:112](),[16.33][16.209:210](),[8.112][16.209:210](),[16.3404][16.209:210](),[16.212][16.612:668](),[16.668][16.25:61]()
    releaseTools.nixBuild {
    name = "hydra-${version}";
    src = if shell then null else hydraSrc;
    stdenv = overrideCC stdenv gcc6;
    buildInputs =
    [ makeWrapper autoconf automake libtool unzip nukeReferences pkgconfig sqlite libpqxx
    gitAndTools.topGit mercurial darcs subversion bazaar openssl bzip2 libxslt
    guile # optional, for Guile + Guix support
    perlDeps perl nix
    postgresql92 # for running the tests
    ];
    hydraPath = lib.makeBinPath (
    [ sqlite subversion openssh nix coreutils findutils pixz
    gzip bzip2 lzma gnutar unzip git gitAndTools.topGit mercurial darcs gnused bazaar
    ] ++ lib.optionals stdenv.isLinux [ rpm dpkg cdrkit ] );
    postUnpack = optionalString (!shell) ''
    # Clean up when building from a working tree.
    (cd $sourceRoot && (git ls-files -o --directory | xargs -r rm -rfv)) || true
    '';
    configureFlags = [ "--with-docbook-xsl=${docbook_xsl}/xml/xsl/docbook" ];
    preHook = ''
    PATH=$(pwd)/src/hydra-evaluator:$(pwd)/src/script:$(pwd)/src/hydra-eval-jobs:$(pwd)/src/hydra-queue-runner:$PATH
    PERL5LIB=$(pwd)/src/lib:$PERL5LIB;
    '';
    preConfigure = "autoreconf -vfi";
    enableParallelBuilding = true;
    preCheck = ''
    patchShebangs .
    export LOGNAME=${LOGNAME:-foo}
    '';
    postInstall = ''
    mkdir -p $out/nix-support
    for i in $out/bin/*; do
    read -n 4 chars < $i
    if [[ $chars =~ ELF ]]; then continue; fi
    wrapProgram $i \
    --prefix PERL5LIB ':' $out/libexec/hydra/lib:$PERL5LIB \
    --prefix PATH ':' $out/bin:$hydraPath \
    --set HYDRA_RELEASE ${version} \
    --set HYDRA_HOME $out/libexec/hydra \
    --set NIX_RELEASE ${nix.name or "unknown"}
    done
    ''; # */
    dontStrip = true;
    meta.description = "Build of Hydra on ${system}";
    passthru.perlDeps = perlDeps;
    [16.185]
    [16.192]
    callPackage ./. {
    stdenv = stdenv6 // { mkDerivation = args: releaseTools.nixBuild (args // {
    stdenv = stdenv6;
    postUnpack = optionalString (!shell) ''
    # Clean up when building from a working tree.
    (cd $sourceRoot && (git ls-files -o --directory | xargs -r rm -rfv)) || true
    '';
    }); };
    inherit (gitAndTools) topGit;
    nix = nixUnstable;
    aws-sdk-cpp = aws-sdk-cpp';
    hydraSrc = if shell then null else hydraSrc;
  • replacement in release.nix at line 65
    [16.1][16.1:54]()
    manual = pkgs.runCommand "hydra-manual-${version}"
    [16.1]
    [11.0]
    manual = pkgs.runCommand "hydra-manual-${build.x86_64-linux.version}"