hydra-eval-jobs: Fix building against the latest unstable Nix

[?]
Jan 12, 2014, 4:37 PM
5X6FHW3SHOE5R37WJPLKNVJM6VWFT6SNRMC5OFFCCW3IGC4ORY2QC

Dependencies

  • [2] PMNWRTGJ Add multiple output support
  • [3] DPYJFBXU hydra-eval-jobs: Support meta.license being a list
  • [4] 5MNUNZWR * Store meta.maintainers.
  • [5] KD5237CU * eval-jobs now efficiently evaluates all Hydra jobs from a
  • [6] POPU2ATH * hydra_scheduler: use eval-jobs.
  • [7] YGRLM2SK * Export all relevant info about the derivation.
  • [8] 3PNG7NIB Remove trailing whitespace
  • [9] ZTQEU5QS Hydra: Add support for maxSilent meta attribute (also already added timeout, but not implemented the actual timeout for the build yet)
  • [10] AEKIREIH * Updated hydra_eval_jobs for the new evaluator.
  • [11] 7YCFGMZB * Report evaluation errors per job, and don't bail out if a job fails
  • [12] 4LWGZL33
  • [13] HVXL2XUZ
  • [14] FMJMW4PU
  • [15] A63IHCMX * Register GC roots properly.
  • [16] JTHWA6AM Rename aggregate members to constituents
  • [*] 4N5APGRG * Start of a helper tool to evaluate job expressions efficiently.

Change contents

  • replacement in src/c/hydra-eval-jobs.cc at line 92
    [4.221][4.221:294]()
    static string queryMetaFieldString(MetaInfo & meta, const string & name)
    [4.221]
    [4.294]
    static string queryMetaStrings(EvalState & state, DrvInfo & drv, const string & name)
  • replacement in src/c/hydra-eval-jobs.cc at line 94
    [4.296][4.296:417](),[4.417][4.800:801](),[4.801][4.422:713](),[4.422][4.422:713](),[4.713][4.306:312](),[4.306][4.306:312](),[4.312][4.714:730](),[4.730][3.0:386]()
    MetaValue value = meta[name];
    if (value.type != MetaValue::tpString) return "";
    return value.stringValue;
    }
    static int queryMetaFieldInt(MetaInfo & meta, const string & name, int def)
    {
    MetaValue value = meta[name];
    if (value.type == MetaValue::tpInt) return value.intValue;
    if (value.type == MetaValue::tpString) {
    int n;
    if (string2Int(value.stringValue, n)) return n;
    }
    return def;
    }
    static string queryMetaField(MetaInfo & meta, const string & name)
    {
    string res;
    MetaValue value = meta[name];
    if (value.type == MetaValue::tpString)
    res = value.stringValue;
    else if (value.type == MetaValue::tpStrings) {
    foreach (Strings::const_iterator, i, value.stringValues) {
    if (res.size() != 0) res += ", ";
    res += *i;
    [4.296]
    [3.386]
    Value * v = drv.queryMeta(name);
    if (v) {
    state.forceValue(*v);
    if (v->type == tString)
    return v->string.s;
    else if (v->type == tList) {
    string res = "";
    for (unsigned int n = 0; n < v->list.length; ++n) {
    Value v2(*v->list.elems[n]);
    state.forceValue(v2);
    if (v2.type == tString) {
    if (res.size() != 0) res += ", ";
    res += v2.string.s;
    }
    }
    return res;
  • replacement in src/c/hydra-eval-jobs.cc at line 112
    [3.402][3.402:418]()
    return res;
    [3.402]
    [4.1405]
    return "";
  • replacement in src/c/hydra-eval-jobs.cc at line 128
    [4.512][4.24:45]()
    DrvInfo drv;
    [4.512]
    [4.802]
    DrvInfo drv(state);
  • replacement in src/c/hydra-eval-jobs.cc at line 134
    [2.1][2.1:65]()
    DrvInfo::Outputs outputs = drv.queryOutputs(state);
    [2.1]
    [4.747]
    DrvInfo::Outputs outputs = drv.queryOutputs();
  • replacement in src/c/hydra-eval-jobs.cc at line 139
    [4.158][4.56:125](),[4.276][4.759:983](),[4.983][3.419:486](),[3.486][4.1056:1131](),[4.1056][4.1056:1131](),[4.1131][3.487:562]()
    xmlAttrs["drvPath"] = drvPath = drv.queryDrvPath(state);
    MetaInfo meta = drv.queryMetaInfo(state);
    xmlAttrs["description"] = queryMetaFieldString(meta, "description");
    xmlAttrs["longDescription"] = queryMetaFieldString(meta, "longDescription");
    xmlAttrs["license"] = queryMetaField(meta, "license");
    xmlAttrs["homepage"] = queryMetaFieldString(meta, "homepage");
    xmlAttrs["maintainers"] = queryMetaField(meta, "maintainers");
    [4.158]
    [4.0]
    xmlAttrs["drvPath"] = drvPath = drv.queryDrvPath();
    xmlAttrs["description"] = drv.queryMetaString("description");
    xmlAttrs["longDescription"] = drv.queryMetaString("longDescription");
    xmlAttrs["license"] = queryMetaStrings(state, drv, "license");
    xmlAttrs["homepage"] = drv.queryMetaString("homepage");
    xmlAttrs["maintainers"] = queryMetaStrings(state, drv, "maintainers");
  • replacement in src/c/hydra-eval-jobs.cc at line 146
    [4.1][4.1131:1269](),[4.1131][4.1131:1269]()
    int prio = queryMetaFieldInt(meta, "schedulingPriority", 100);
    xmlAttrs["schedulingPriority"] = int2String(prio);
    [4.1]
    [4.2]
    xmlAttrs["schedulingPriority"] = int2String(drv.queryMetaInt("schedulingPriority", 100));
  • replacement in src/c/hydra-eval-jobs.cc at line 148
    [4.3][4.3:127]()
    int timeout = queryMetaFieldInt(meta, "timeout", 36000);
    xmlAttrs["timeout"] = int2String(timeout);
    [4.3]
    [4.0]
    xmlAttrs["timeout"] = int2String(drv.queryMetaInt("timeout", 36000));
  • replacement in src/c/hydra-eval-jobs.cc at line 150
    [4.1][4.128:259]()
    int maxsilent = queryMetaFieldInt(meta, "maxSilent", 3600);
    xmlAttrs["maxSilent"] = int2String(maxsilent);
    [4.1]
    [4.259]
    xmlAttrs["maxSilent"] = int2String(drv.queryMetaInt("maxSilent", 3600));