Machine
-> ::Machine
so we don't conflict with Nix's
This commit is contained in:
parent
f5c0efb11e
commit
2e6ee28f9b
|
@ -48,7 +48,7 @@ static Strings extraStoreArgs(std::string & machine)
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void openConnection(Machine::ptr machine, Path tmpDir, int stderrFD, SSHMaster::Connection & child)
|
static void openConnection(::Machine::ptr machine, Path tmpDir, int stderrFD, SSHMaster::Connection & child)
|
||||||
{
|
{
|
||||||
std::string pgmName;
|
std::string pgmName;
|
||||||
Pipe to, from;
|
Pipe to, from;
|
||||||
|
@ -104,7 +104,7 @@ static void openConnection(Machine::ptr machine, Path tmpDir, int stderrFD, SSHM
|
||||||
|
|
||||||
|
|
||||||
static void copyClosureTo(
|
static void copyClosureTo(
|
||||||
Machine::Connection & conn,
|
::Machine::Connection & conn,
|
||||||
Store & destStore,
|
Store & destStore,
|
||||||
const StorePathSet & paths,
|
const StorePathSet & paths,
|
||||||
SubstituteFlag useSubstitutes = NoSubstitute)
|
SubstituteFlag useSubstitutes = NoSubstitute)
|
||||||
|
@ -195,7 +195,7 @@ static std::pair<Path, AutoCloseFD> openLogFile(const std::string & logDir, cons
|
||||||
* Therefore, no `ServeProto::Serialize` functions can be used until
|
* Therefore, no `ServeProto::Serialize` functions can be used until
|
||||||
* that field is set.
|
* that field is set.
|
||||||
*/
|
*/
|
||||||
static void handshake(Machine::Connection & conn, unsigned int repeats)
|
static void handshake(::Machine::Connection & conn, unsigned int repeats)
|
||||||
{
|
{
|
||||||
conn.to << SERVE_MAGIC_1 << 0x206;
|
conn.to << SERVE_MAGIC_1 << 0x206;
|
||||||
conn.to.flush();
|
conn.to.flush();
|
||||||
|
@ -216,7 +216,7 @@ static BasicDerivation sendInputs(
|
||||||
Step & step,
|
Step & step,
|
||||||
Store & localStore,
|
Store & localStore,
|
||||||
Store & destStore,
|
Store & destStore,
|
||||||
Machine::Connection & conn,
|
::Machine::Connection & conn,
|
||||||
unsigned int & overhead,
|
unsigned int & overhead,
|
||||||
counter & nrStepsWaiting,
|
counter & nrStepsWaiting,
|
||||||
counter & nrStepsCopyingTo
|
counter & nrStepsCopyingTo
|
||||||
|
@ -272,7 +272,7 @@ static BasicDerivation sendInputs(
|
||||||
}
|
}
|
||||||
|
|
||||||
static BuildResult performBuild(
|
static BuildResult performBuild(
|
||||||
Machine::Connection & conn,
|
::Machine::Connection & conn,
|
||||||
Store & localStore,
|
Store & localStore,
|
||||||
StorePath drvPath,
|
StorePath drvPath,
|
||||||
const BasicDerivation & drv,
|
const BasicDerivation & drv,
|
||||||
|
@ -317,7 +317,7 @@ static BuildResult performBuild(
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::map<StorePath, ValidPathInfo> queryPathInfos(
|
static std::map<StorePath, ValidPathInfo> queryPathInfos(
|
||||||
Machine::Connection & conn,
|
::Machine::Connection & conn,
|
||||||
Store & localStore,
|
Store & localStore,
|
||||||
StorePathSet & outputs,
|
StorePathSet & outputs,
|
||||||
size_t & totalNarSize
|
size_t & totalNarSize
|
||||||
|
@ -355,7 +355,7 @@ static std::map<StorePath, ValidPathInfo> queryPathInfos(
|
||||||
}
|
}
|
||||||
|
|
||||||
static void copyPathFromRemote(
|
static void copyPathFromRemote(
|
||||||
Machine::Connection & conn,
|
::Machine::Connection & conn,
|
||||||
NarMemberDatas & narMembers,
|
NarMemberDatas & narMembers,
|
||||||
Store & localStore,
|
Store & localStore,
|
||||||
Store & destStore,
|
Store & destStore,
|
||||||
|
@ -385,7 +385,7 @@ static void copyPathFromRemote(
|
||||||
}
|
}
|
||||||
|
|
||||||
static void copyPathsFromRemote(
|
static void copyPathsFromRemote(
|
||||||
Machine::Connection & conn,
|
::Machine::Connection & conn,
|
||||||
NarMemberDatas & narMembers,
|
NarMemberDatas & narMembers,
|
||||||
Store & localStore,
|
Store & localStore,
|
||||||
Store & destStore,
|
Store & destStore,
|
||||||
|
@ -462,7 +462,7 @@ void RemoteResult::updateWithBuildResult(const nix::BuildResult & buildResult)
|
||||||
|
|
||||||
|
|
||||||
void State::buildRemote(ref<Store> destStore,
|
void State::buildRemote(ref<Store> destStore,
|
||||||
Machine::ptr machine, Step::ptr step,
|
::Machine::ptr machine, Step::ptr step,
|
||||||
const BuildOptions & buildOptions,
|
const BuildOptions & buildOptions,
|
||||||
RemoteResult & result, std::shared_ptr<ActiveStep> activeStep,
|
RemoteResult & result, std::shared_ptr<ActiveStep> activeStep,
|
||||||
std::function<void(StepState)> updateStep,
|
std::function<void(StepState)> updateStep,
|
||||||
|
@ -503,7 +503,7 @@ void State::buildRemote(ref<Store> destStore,
|
||||||
process. Meh. */
|
process. Meh. */
|
||||||
});
|
});
|
||||||
|
|
||||||
Machine::Connection conn {
|
::Machine::Connection conn {
|
||||||
.from = child.out.get(),
|
.from = child.out.get(),
|
||||||
.to = child.in.get(),
|
.to = child.in.get(),
|
||||||
.machine = machine,
|
.machine = machine,
|
||||||
|
|
|
@ -400,7 +400,7 @@ void State::failStep(
|
||||||
Step::ptr step,
|
Step::ptr step,
|
||||||
BuildID buildId,
|
BuildID buildId,
|
||||||
const RemoteResult & result,
|
const RemoteResult & result,
|
||||||
Machine::ptr machine,
|
::Machine::ptr machine,
|
||||||
bool & stepFinished)
|
bool & stepFinished)
|
||||||
{
|
{
|
||||||
/* Register failure in the database for all Build objects that
|
/* Register failure in the database for all Build objects that
|
||||||
|
|
|
@ -199,7 +199,7 @@ system_time State::doDispatch()
|
||||||
filter out temporarily disabled machines. */
|
filter out temporarily disabled machines. */
|
||||||
struct MachineInfo
|
struct MachineInfo
|
||||||
{
|
{
|
||||||
Machine::ptr machine;
|
::Machine::ptr machine;
|
||||||
unsigned long currentJobs;
|
unsigned long currentJobs;
|
||||||
};
|
};
|
||||||
std::vector<MachineInfo> machinesSorted;
|
std::vector<MachineInfo> machinesSorted;
|
||||||
|
@ -435,7 +435,7 @@ void Jobset::pruneSteps()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
State::MachineReservation::MachineReservation(State & state, Step::ptr step, Machine::ptr machine)
|
State::MachineReservation::MachineReservation(State & state, Step::ptr step, ::Machine::ptr machine)
|
||||||
: state(state), step(step), machine(machine)
|
: state(state), step(step), machine(machine)
|
||||||
{
|
{
|
||||||
machine->state->currentJobs++;
|
machine->state->currentJobs++;
|
||||||
|
|
|
@ -140,7 +140,7 @@ void State::parseMachines(const std::string & contents)
|
||||||
if (tokens.size() < 3) continue;
|
if (tokens.size() < 3) continue;
|
||||||
tokens.resize(8);
|
tokens.resize(8);
|
||||||
|
|
||||||
auto machine = std::make_shared<Machine>();
|
auto machine = std::make_shared<::Machine>();
|
||||||
machine->sshName = tokens[0];
|
machine->sshName = tokens[0];
|
||||||
machine->systemTypes = tokenizeString<StringSet>(tokens[1], ",");
|
machine->systemTypes = tokenizeString<StringSet>(tokens[1], ",");
|
||||||
machine->sshKey = tokens[2] == "-" ? std::string("") : tokens[2];
|
machine->sshKey = tokens[2] == "-" ? std::string("") : tokens[2];
|
||||||
|
@ -166,7 +166,7 @@ void State::parseMachines(const std::string & contents)
|
||||||
else
|
else
|
||||||
printMsg(lvlChatty, "updating machine ‘%1%’", machine->sshName);
|
printMsg(lvlChatty, "updating machine ‘%1%’", machine->sshName);
|
||||||
machine->state = i == oldMachines.end()
|
machine->state = i == oldMachines.end()
|
||||||
? std::make_shared<Machine::State>()
|
? std::make_shared<::Machine::State>()
|
||||||
: i->second->state;
|
: i->second->state;
|
||||||
newMachines[machine->sshName] = machine;
|
newMachines[machine->sshName] = machine;
|
||||||
}
|
}
|
||||||
|
@ -175,9 +175,9 @@ void State::parseMachines(const std::string & contents)
|
||||||
if (newMachines.find(m.first) == newMachines.end()) {
|
if (newMachines.find(m.first) == newMachines.end()) {
|
||||||
if (m.second->enabled)
|
if (m.second->enabled)
|
||||||
printInfo("removing machine ‘%1%’", m.first);
|
printInfo("removing machine ‘%1%’", m.first);
|
||||||
/* Add a disabled Machine object to make sure stats are
|
/* Add a disabled ::Machine object to make sure stats are
|
||||||
maintained. */
|
maintained. */
|
||||||
auto machine = std::make_shared<Machine>(*(m.second));
|
auto machine = std::make_shared<::Machine>(*(m.second));
|
||||||
machine->enabled = false;
|
machine->enabled = false;
|
||||||
newMachines[m.first] = machine;
|
newMachines[m.first] = machine;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue