2003-06-16 15:33:38 +02:00
|
|
|
#ifndef __GLOBALS_H
|
|
|
|
#define __GLOBALS_H
|
|
|
|
|
2006-09-04 23:06:23 +02:00
|
|
|
#include "types.hh"
|
|
|
|
|
|
|
|
|
|
|
|
namespace nix {
|
2003-06-16 15:33:38 +02:00
|
|
|
|
|
|
|
|
|
|
|
/* Path names. */
|
|
|
|
|
2003-06-27 15:55:12 +02:00
|
|
|
/* nixStore is the directory where we generally store atomic and
|
|
|
|
derived files. */
|
|
|
|
extern string nixStore;
|
2003-06-16 15:33:38 +02:00
|
|
|
|
2003-07-10 15:41:28 +02:00
|
|
|
extern string nixDataDir; /* !!! fix */
|
|
|
|
|
2003-06-27 15:55:12 +02:00
|
|
|
/* nixLogDir is the directory where we log various operations. */
|
2003-06-16 15:33:38 +02:00
|
|
|
extern string nixLogDir;
|
|
|
|
|
2003-11-19 18:27:16 +01:00
|
|
|
/* nixStateDir is the directory where state is stored. */
|
|
|
|
extern string nixStateDir;
|
|
|
|
|
2003-07-31 15:47:13 +02:00
|
|
|
/* nixDBPath is the path name of our Berkeley DB environment. */
|
|
|
|
extern string nixDBPath;
|
|
|
|
|
2005-02-01 23:07:48 +01:00
|
|
|
/* nixConfDir is the directory where configuration files are
|
|
|
|
stored. */
|
|
|
|
extern string nixConfDir;
|
|
|
|
|
2006-07-20 15:21:37 +02:00
|
|
|
/* nixLibexecDir is the directory where internal helper programs are
|
|
|
|
stored. */
|
|
|
|
extern string nixLibexecDir;
|
|
|
|
|
2006-12-04 14:09:16 +01:00
|
|
|
/* nixBinDir is the directory where the main programs are stored. */
|
|
|
|
extern string nixBinDir;
|
|
|
|
|
2005-02-01 23:07:48 +01:00
|
|
|
|
2003-08-19 11:04:47 +02:00
|
|
|
/* Misc. global flags. */
|
|
|
|
|
|
|
|
/* Whether to keep temporary directories of failed builds. */
|
|
|
|
extern bool keepFailed;
|
|
|
|
|
2004-06-25 17:36:09 +02:00
|
|
|
/* Whether to keep building subgoals when a sibling (another subgoal
|
|
|
|
of the same goal) fails. */
|
|
|
|
extern bool keepGoing;
|
|
|
|
|
2004-06-28 12:42:57 +02:00
|
|
|
/* Whether, if we cannot realise the known closure corresponding to a
|
|
|
|
derivation, we should try to normalise the derivation instead. */
|
|
|
|
extern bool tryFallback;
|
|
|
|
|
2004-01-13 17:35:43 +01:00
|
|
|
/* Verbosity level for build output. */
|
|
|
|
extern Verbosity buildVerbosity;
|
|
|
|
|
2004-05-12 16:20:32 +02:00
|
|
|
/* Maximum number of parallel build jobs. 0 means unlimited. */
|
|
|
|
extern unsigned int maxBuildJobs;
|
|
|
|
|
2004-10-25 16:38:23 +02:00
|
|
|
/* Read-only mode. Don't copy stuff to the store, don't change the
|
|
|
|
database. */
|
|
|
|
extern bool readOnlyMode;
|
|
|
|
|
2006-07-06 17:30:37 +02:00
|
|
|
/* The canonical system name, as returned by config.guess. */
|
|
|
|
extern string thisSystem;
|
|
|
|
|
2006-12-08 16:44:00 +01:00
|
|
|
/* The maximum time in seconds that a builer can go without producing
|
|
|
|
any output on stdout/stderr before it is killed. 0 means
|
|
|
|
infinity. */
|
|
|
|
extern unsigned int maxSilentTime;
|
|
|
|
|
2007-08-12 02:29:28 +02:00
|
|
|
/* The substituters. There are programs that can somehow realise a
|
|
|
|
store path without building, e.g., by downloading it or copying it
|
|
|
|
from a CD. */
|
|
|
|
extern Paths substituters;
|
|
|
|
|
2007-11-16 17:15:26 +01:00
|
|
|
/* Whether to use build hooks (for distributed builds). Sometimes
|
|
|
|
users want to disable this from the command-line. */
|
|
|
|
extern bool useBuildHook;
|
|
|
|
|
2008-11-12 12:08:27 +01:00
|
|
|
/* Whether buildDerivations() should print out lines on stderr in a
|
|
|
|
fixed format to allow its progress to be monitored. Each line
|
|
|
|
starts with a "@". The following are defined:
|
|
|
|
|
|
|
|
@ build-started <drvpath> <outpath> <system> <logfile>
|
|
|
|
@ build-failed <drvpath> <outpath> <exitcode> <error text>
|
|
|
|
@ build-succeeded <drvpath> <outpath>
|
|
|
|
@ substituter-started <outpath> <substituter>
|
|
|
|
@ substituter-failed <outpath> <exitcode> <error text>
|
|
|
|
@ substituter-succeeded <outpath>
|
|
|
|
|
|
|
|
Best combined with --no-build-output, otherwise stderr might
|
|
|
|
conceivably contain lines in this format printed by the builders.
|
|
|
|
*/
|
|
|
|
extern bool printBuildTrace;
|
|
|
|
|
2003-08-19 11:04:47 +02:00
|
|
|
|
2005-09-22 17:43:22 +02:00
|
|
|
Strings querySetting(const string & name, const Strings & def);
|
2005-02-01 23:07:48 +01:00
|
|
|
|
2006-02-16 14:58:10 +01:00
|
|
|
string querySetting(const string & name, const string & def);
|
|
|
|
|
2005-02-14 14:07:09 +01:00
|
|
|
bool queryBoolSetting(const string & name, bool def);
|
|
|
|
|
2006-12-08 16:44:00 +01:00
|
|
|
unsigned int queryIntSetting(const string & name, unsigned int def);
|
|
|
|
|
2009-02-27 12:04:41 +01:00
|
|
|
void overrideSetting(const string & name, const Strings & value);
|
|
|
|
|
2008-11-20 13:25:11 +01:00
|
|
|
void reloadSettings();
|
|
|
|
|
2006-09-04 23:06:23 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2005-02-01 23:07:48 +01:00
|
|
|
|
2003-06-16 15:33:38 +02:00
|
|
|
#endif /* !__GLOBALS_H */
|