Upload log files to the right location

We were mixing up builds and steps. So for example

  https://cache.nixos.org/log/2w66a98iqbjdppc5s2b8qvhi3gprvy45-freecell-solver-4.8.0.drv

at the moment contains the log for
/nix/store/442r9d5ihbcpgq8q9dhijhvhlmplzp96-perl-namespace-autoclean-0.28.drv
because the latter is a step in http://hydra.nixos.org/build/51300420.
Oops.
This commit is contained in:
Eelco Dolstra 2017-04-06 13:03:12 +02:00
parent fec895a642
commit 8364f4ec70
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE

View file

@ -154,7 +154,7 @@ State::StepResult State::doBuildStep(nix::ref<Store> destStore,
try { try {
auto store = destStore.dynamic_pointer_cast<BinaryCacheStore>(); auto store = destStore.dynamic_pointer_cast<BinaryCacheStore>();
if (uploadLogsToBinaryCache && store && pathExists(result.logFile)) { if (uploadLogsToBinaryCache && store && pathExists(result.logFile)) {
store->upsertFile("log/" + baseNameOf(buildDrvPath), readFile(result.logFile), "text/plain; charset=utf-8"); store->upsertFile("log/" + baseNameOf(step->drvPath), readFile(result.logFile), "text/plain; charset=utf-8");
unlink(result.logFile.c_str()); unlink(result.logFile.c_str());
} }
} catch (...) { } catch (...) {