Remove temporary #if 0...#endif from previous commit

This commit is contained in:
John Ericson 2021-02-26 15:31:15 +00:00
parent 68f4c728ec
commit d560311f76
2 changed files with 1 additions and 1264 deletions

File diff suppressed because it is too large Load diff

View file

@ -9,44 +9,6 @@ struct LocalDerivationGoal : public DerivationGoal
{
LocalStore & getLocalStore();
#if 0
/* Whether to use an on-disk .drv file. */
bool useDerivation;
/* The path of the derivation. */
StorePath drvPath;
/* The path of the corresponding resolved derivation */
std::optional<BasicDerivation> resolvedDrv;
/* The specific outputs that we need to build. Empty means all of
them. */
StringSet wantedOutputs;
/* Whether additional wanted outputs have been added. */
bool needRestart = false;
/* Whether to retry substituting the outputs after building the
inputs. */
bool retrySubstitution;
/* The derivation stored at drvPath. */
std::unique_ptr<Derivation> drv;
std::unique_ptr<ParsedDerivation> parsedDrv;
/* The remainder is state held during the build. */
/* Locks on (fixed) output paths. */
PathLocks outputLocks;
/* All input paths (that is, the union of FS closures of the
immediate input paths). */
StorePathSet inputPaths;
std::map<std::string, InitialOutput> initialOutputs;
#endif
/* User selected for running the builder. */
std::unique_ptr<UserLock> buildUser;
@ -59,23 +21,6 @@ struct LocalDerivationGoal : public DerivationGoal
/* The path of the temporary directory in the sandbox. */
Path tmpDirInSandbox;
#if 0
/* File descriptor for the log file. */
AutoCloseFD fdLogFile;
std::shared_ptr<BufferedSink> logFileSink, logSink;
/* Number of bytes received from the builder's stdout/stderr. */
unsigned long logSize;
/* The most recent log lines. */
std::list<std::string> logTail;
std::string currentLogLine;
size_t currentLogLinePos = 0; // to handle carriage return
std::string currentHookLine;
#endif
/* Pipe for the builder's standard output/error. */
Pipe builderOut;
@ -90,11 +35,6 @@ struct LocalDerivationGoal : public DerivationGoal
namespace. */
bool usingUserNamespace = true;
#if 0
/* The build hook. */
std::unique_ptr<HookInstance> hook;
#endif
/* Whether we're currently doing a chroot build. */
bool useChroot = false;
@ -103,19 +43,9 @@ struct LocalDerivationGoal : public DerivationGoal
/* RAII object to delete the chroot directory. */
std::shared_ptr<AutoDelete> autoDelChroot;
#if 0
/* The sort of derivation we are building. */
DerivationType derivationType;
#endif
/* Whether to run the build in a private network namespace. */
bool privateNetwork = false;
#if 0
typedef void (DerivationGoal::*GoalState)();
GoalState state;
#endif
/* Stuff we need to pass to initChild(). */
struct ChrootPath {
Path source;
@ -155,34 +85,11 @@ struct LocalDerivationGoal : public DerivationGoal
*/
OutputPathMap scratchOutputs;
#if 0
/* The final output paths of the build.
- For input-addressed derivations, always the precomputed paths
- For content-addressed derivations, calcuated from whatever the hash
ends up being. (Note that fixed outputs derivations that produce the
"wrong" output still install that data under its true content-address.)
*/
OutputPathMap finalOutputs;
BuildMode buildMode;
#endif
/* If we're repairing without a chroot, there may be outputs that
are valid but corrupt. So we redirect these outputs to
temporary paths. */
StorePathSet redirectedBadOutputs;
#if 0
BuildResult result;
/* The current round, if we're building multiple times. */
size_t curRound = 1;
size_t nrRounds;
#endif
/* Path registration info from the previous round, if we're
building multiple times. Since this contains the hash, it
allows us to compare whether two rounds produced the same
@ -194,20 +101,6 @@ struct LocalDerivationGoal : public DerivationGoal
const static Path homeDir;
#if 0
std::unique_ptr<MaintainCount<uint64_t>> mcExpectedBuilds, mcRunningBuilds;
std::unique_ptr<Activity> act;
/* Activity that denotes waiting for a lock. */
std::unique_ptr<Activity> actLock;
std::map<ActivityId, Activity> builderActivities;
/* The remote machine on which we're building. */
std::string machineName;
#endif
/* The recursive Nix daemon socket. */
AutoCloseFD daemonSocket;
@ -238,37 +131,8 @@ struct LocalDerivationGoal : public DerivationGoal
/* Whether we need to perform hash rewriting if there are valid output paths. */
bool needsHashRewrite();
#if 0
void timedOut(Error && ex) override;
string key() override;
void work() override;
/* Add wanted outputs to an already existing derivation goal. */
void addWantedOutputs(const StringSet & outputs);
BuildResult getResult() { return result; }
/* The states. */
void getDerivation();
void loadDerivation();
void haveDerivation();
void outputsSubstitutionTried();
void gaveUpOnSubstitution();
void closureRepaired();
void inputsRealised();
void tryToBuild();
#endif
/* The additional states. */
void tryLocalBuild() override;
#if 0
void buildDone();
void resolvedFinished();
/* Is the build hook willing to perform the build? */
HookReply tryBuildHook();
#endif
/* Start building a derivation. */
void startBuilder();
@ -307,14 +171,6 @@ struct LocalDerivationGoal : public DerivationGoal
'{allowed,disallowed}{References,Requisites}' attributes). */
void checkOutputs(const std::map<std::string, ValidPathInfo> & outputs);
#if 0
/* Open a log file and a pipe to it. */
Path openLogFile();
/* Close the log file. */
void closeLogFile();
#endif
/* Close the read side of the logger pipe. */
void closeReadPipes() override;
@ -328,26 +184,9 @@ struct LocalDerivationGoal : public DerivationGoal
bool isReadDesc(int fd) override;
/* Delete the temporary directory, if we have one. */
void deleteTmpDir(bool force);
#if 0
/* Callback used by the worker to write to the log. */
void handleChildOutput(int fd, const string & data) override;
void handleEOF(int fd) override;
void flushLine();
/* Wrappers around the corresponding Store methods that first consult the
derivation. This is currently needed because when there is no drv file
there also is no DB entry. */
std::map<std::string, std::optional<StorePath>> queryPartialDerivationOutputMap();
OutputPathMap queryDerivationOutputMap();
/* Return the set of (in)valid paths. */
void checkPathValidity();
#endif
/* Forcibly kill the child process, if any. */
void killChild() override;
@ -360,18 +199,6 @@ struct LocalDerivationGoal : public DerivationGoal
/* FIXME add option to randomize, so we can audit whether our
rewrites caught everything */
StorePath makeFallbackPath(std::string_view outputName);
#if 0
void repairClosure();
void started();
void done(
BuildResult::Status status,
std::optional<Error> ex = {});
StorePathSet exportReferences(const StorePathSet & storePaths);
#endif
};
}