mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-16 03:45:24 -05:00
9b5364a3af
Fixes <http://bugs.gnu.org/25089>. Reported by Leo Famulari <leo@famulari.name>. * nix/libstore/build.cc (DerivationGoal::runChild): In the 'isBuiltin' case, check whether DRV's output is in 'redirectedOutputs', and pass an 'output' argument to the built-in builder. (DerivationGoal::addHashRewrite): Add 'printMsg' call. * nix/libstore/builtins.hh (derivationBuilder): Add 'output' parameter. * nix/libstore/builtins.cc (builtinDownload): Likewise. Add OUTPUT to ARGV. * guix/scripts/perform-download.scm (perform-download): Add 'output' parameter. (guix-perform-download): Adjust 'match' clauses accordingly. * tests/derivations.scm ("'download' built-in builder, check mode"): New test.
45 lines
1.5 KiB
C++
45 lines
1.5 KiB
C++
/* GNU Guix --- Functional package management for GNU
|
|
Copyright (C) 2016, 2017 Ludovic Courtès <ludo@gnu.org>
|
|
|
|
This file is part of GNU Guix.
|
|
|
|
GNU Guix is free software; you can redistribute it and/or modify it
|
|
under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation; either version 3 of the License, or (at
|
|
your option) any later version.
|
|
|
|
GNU Guix is distributed in the hope that it will be useful, but
|
|
WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. */
|
|
|
|
/* Interface to built-in derivation builders. */
|
|
|
|
#pragma once
|
|
|
|
#include <derivations.hh>
|
|
#include <map>
|
|
#include <string>
|
|
|
|
namespace nix {
|
|
|
|
inline bool isBuiltin(const Derivation & drv)
|
|
{
|
|
return string(drv.builder, 0, 8) == "builtin:";
|
|
}
|
|
|
|
/* Build DRV, which lives at DRVPATH. */
|
|
typedef void (*derivationBuilder) (const Derivation &drv,
|
|
const std::string &drvPath,
|
|
const std::string &output);
|
|
|
|
/* Return the built-in builder called BUILDER, or NULL if none was
|
|
found. */
|
|
derivationBuilder lookupBuiltinBuilder(const std::string &builder);
|
|
|
|
/* Return the list of supported built-in builder names. */
|
|
std::list<std::string> builtinBuilderNames();
|
|
}
|