mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-22 22:16:16 +02:00
unsigned long long -> uint64_t
This commit is contained in:
parent
ebee2b7852
commit
3f6e88a552
26 changed files with 67 additions and 71 deletions
|
@ -33,7 +33,7 @@ std::string escapeUri(std::string uri)
|
||||||
|
|
||||||
static string currentLoad;
|
static string currentLoad;
|
||||||
|
|
||||||
static AutoCloseFD openSlotLock(const Machine & m, unsigned long long slot)
|
static AutoCloseFD openSlotLock(const Machine & m, uint64_t slot)
|
||||||
{
|
{
|
||||||
return openLockFile(fmt("%s/%s-%d", currentLoad, escapeUri(m.storeUri), slot), true);
|
return openLockFile(fmt("%s/%s-%d", currentLoad, escapeUri(m.storeUri), slot), true);
|
||||||
}
|
}
|
||||||
|
@ -119,7 +119,7 @@ static int _main(int argc, char * * argv)
|
||||||
bool rightType = false;
|
bool rightType = false;
|
||||||
|
|
||||||
Machine * bestMachine = nullptr;
|
Machine * bestMachine = nullptr;
|
||||||
unsigned long long bestLoad = 0;
|
uint64_t bestLoad = 0;
|
||||||
for (auto & m : machines) {
|
for (auto & m : machines) {
|
||||||
debug("considering building on remote machine '%s'", m.storeUri);
|
debug("considering building on remote machine '%s'", m.storeUri);
|
||||||
|
|
||||||
|
@ -130,8 +130,8 @@ static int _main(int argc, char * * argv)
|
||||||
m.mandatoryMet(requiredFeatures)) {
|
m.mandatoryMet(requiredFeatures)) {
|
||||||
rightType = true;
|
rightType = true;
|
||||||
AutoCloseFD free;
|
AutoCloseFD free;
|
||||||
unsigned long long load = 0;
|
uint64_t load = 0;
|
||||||
for (unsigned long long slot = 0; slot < m.maxJobs; ++slot) {
|
for (uint64_t slot = 0; slot < m.maxJobs; ++slot) {
|
||||||
auto slotLock = openSlotLock(m, slot);
|
auto slotLock = openSlotLock(m, slot);
|
||||||
if (lockFile(slotLock.get(), ltWrite, false)) {
|
if (lockFile(slotLock.get(), ltWrite, false)) {
|
||||||
if (!free) {
|
if (!free) {
|
||||||
|
|
|
@ -65,7 +65,7 @@ void EvalState::realiseContext(const PathSet & context)
|
||||||
|
|
||||||
/* For performance, prefetch all substitute info. */
|
/* For performance, prefetch all substitute info. */
|
||||||
StorePathSet willBuild, willSubstitute, unknown;
|
StorePathSet willBuild, willSubstitute, unknown;
|
||||||
unsigned long long downloadSize, narSize;
|
uint64_t downloadSize, narSize;
|
||||||
store->queryMissing(drvs, willBuild, willSubstitute, unknown, downloadSize, narSize);
|
store->queryMissing(drvs, willBuild, willSubstitute, unknown, downloadSize, narSize);
|
||||||
|
|
||||||
store->buildPaths(drvs);
|
store->buildPaths(drvs);
|
||||||
|
|
|
@ -36,7 +36,7 @@ void printGCWarning()
|
||||||
|
|
||||||
void printMissing(ref<Store> store, const std::vector<StorePathWithOutputs> & paths, Verbosity lvl)
|
void printMissing(ref<Store> store, const std::vector<StorePathWithOutputs> & paths, Verbosity lvl)
|
||||||
{
|
{
|
||||||
unsigned long long downloadSize, narSize;
|
uint64_t downloadSize, narSize;
|
||||||
StorePathSet willBuild, willSubstitute, unknown;
|
StorePathSet willBuild, willSubstitute, unknown;
|
||||||
store->queryMissing(paths, willBuild, willSubstitute, unknown, downloadSize, narSize);
|
store->queryMissing(paths, willBuild, willSubstitute, unknown, downloadSize, narSize);
|
||||||
printMissing(store, willBuild, willSubstitute, unknown, downloadSize, narSize, lvl);
|
printMissing(store, willBuild, willSubstitute, unknown, downloadSize, narSize, lvl);
|
||||||
|
@ -45,7 +45,7 @@ void printMissing(ref<Store> store, const std::vector<StorePathWithOutputs> & pa
|
||||||
|
|
||||||
void printMissing(ref<Store> store, const StorePathSet & willBuild,
|
void printMissing(ref<Store> store, const StorePathSet & willBuild,
|
||||||
const StorePathSet & willSubstitute, const StorePathSet & unknown,
|
const StorePathSet & willSubstitute, const StorePathSet & unknown,
|
||||||
unsigned long long downloadSize, unsigned long long narSize, Verbosity lvl)
|
uint64_t downloadSize, uint64_t narSize, Verbosity lvl)
|
||||||
{
|
{
|
||||||
if (!willBuild.empty()) {
|
if (!willBuild.empty()) {
|
||||||
if (willBuild.size() == 1)
|
if (willBuild.size() == 1)
|
||||||
|
@ -384,7 +384,7 @@ RunPager::~RunPager()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
string showBytes(unsigned long long bytes)
|
string showBytes(uint64_t bytes)
|
||||||
{
|
{
|
||||||
return (format("%.2f MiB") % (bytes / (1024.0 * 1024.0))).str();
|
return (format("%.2f MiB") % (bytes / (1024.0 * 1024.0))).str();
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@ void printMissing(
|
||||||
|
|
||||||
void printMissing(ref<Store> store, const StorePathSet & willBuild,
|
void printMissing(ref<Store> store, const StorePathSet & willBuild,
|
||||||
const StorePathSet & willSubstitute, const StorePathSet & unknown,
|
const StorePathSet & willSubstitute, const StorePathSet & unknown,
|
||||||
unsigned long long downloadSize, unsigned long long narSize, Verbosity lvl = lvlInfo);
|
uint64_t downloadSize, uint64_t narSize, Verbosity lvl = lvlInfo);
|
||||||
|
|
||||||
string getArg(const string & opt,
|
string getArg(const string & opt,
|
||||||
Strings::iterator & i, const Strings::iterator & end);
|
Strings::iterator & i, const Strings::iterator & end);
|
||||||
|
@ -110,7 +110,7 @@ extern volatile ::sig_atomic_t blockInt;
|
||||||
|
|
||||||
/* GC helpers. */
|
/* GC helpers. */
|
||||||
|
|
||||||
string showBytes(unsigned long long bytes);
|
string showBytes(uint64_t bytes);
|
||||||
|
|
||||||
struct GCResults;
|
struct GCResults;
|
||||||
|
|
||||||
|
|
|
@ -1646,13 +1646,13 @@ void DerivationGoal::buildDone()
|
||||||
So instead, check if the disk is (nearly) full now. If
|
So instead, check if the disk is (nearly) full now. If
|
||||||
so, we don't mark this build as a permanent failure. */
|
so, we don't mark this build as a permanent failure. */
|
||||||
#if HAVE_STATVFS
|
#if HAVE_STATVFS
|
||||||
unsigned long long required = 8ULL * 1024 * 1024; // FIXME: make configurable
|
uint64_t required = 8ULL * 1024 * 1024; // FIXME: make configurable
|
||||||
struct statvfs st;
|
struct statvfs st;
|
||||||
if (statvfs(worker.store.realStoreDir.c_str(), &st) == 0 &&
|
if (statvfs(worker.store.realStoreDir.c_str(), &st) == 0 &&
|
||||||
(unsigned long long) st.f_bavail * st.f_bsize < required)
|
(uint64_t) st.f_bavail * st.f_bsize < required)
|
||||||
diskFull = true;
|
diskFull = true;
|
||||||
if (statvfs(tmpDir.c_str(), &st) == 0 &&
|
if (statvfs(tmpDir.c_str(), &st) == 0 &&
|
||||||
(unsigned long long) st.f_bavail * st.f_bsize < required)
|
(uint64_t) st.f_bavail * st.f_bsize < required)
|
||||||
diskFull = true;
|
diskFull = true;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -2851,7 +2851,7 @@ struct RestrictedStore : public LocalFSStore
|
||||||
|
|
||||||
void queryMissing(const std::vector<StorePathWithOutputs> & targets,
|
void queryMissing(const std::vector<StorePathWithOutputs> & targets,
|
||||||
StorePathSet & willBuild, StorePathSet & willSubstitute, StorePathSet & unknown,
|
StorePathSet & willBuild, StorePathSet & willSubstitute, StorePathSet & unknown,
|
||||||
unsigned long long & downloadSize, unsigned long long & narSize) override
|
uint64_t & downloadSize, uint64_t & narSize) override
|
||||||
{
|
{
|
||||||
/* This is slightly impure since it leaks information to the
|
/* This is slightly impure since it leaks information to the
|
||||||
client about what paths will be built/substituted or are
|
client about what paths will be built/substituted or are
|
||||||
|
@ -5038,7 +5038,7 @@ void Worker::markContentsGood(const StorePath & path)
|
||||||
static void primeCache(Store & store, const std::vector<StorePathWithOutputs> & paths)
|
static void primeCache(Store & store, const std::vector<StorePathWithOutputs> & paths)
|
||||||
{
|
{
|
||||||
StorePathSet willBuild, willSubstitute, unknown;
|
StorePathSet willBuild, willSubstitute, unknown;
|
||||||
unsigned long long downloadSize, narSize;
|
uint64_t downloadSize, narSize;
|
||||||
store.queryMissing(paths, willBuild, willSubstitute, unknown, downloadSize, narSize);
|
store.queryMissing(paths, willBuild, willSubstitute, unknown, downloadSize, narSize);
|
||||||
|
|
||||||
if (!willBuild.empty() && 0 == settings.maxBuildJobs && getMachines().empty())
|
if (!willBuild.empty() && 0 == settings.maxBuildJobs && getMachines().empty())
|
||||||
|
|
|
@ -790,7 +790,7 @@ static void performOp(TunnelLogger * logger, ref<Store> store,
|
||||||
targets.push_back(store->parsePathWithOutputs(s));
|
targets.push_back(store->parsePathWithOutputs(s));
|
||||||
logger->startWork();
|
logger->startWork();
|
||||||
StorePathSet willBuild, willSubstitute, unknown;
|
StorePathSet willBuild, willSubstitute, unknown;
|
||||||
unsigned long long downloadSize, narSize;
|
uint64_t downloadSize, narSize;
|
||||||
store->queryMissing(targets, willBuild, willSubstitute, unknown, downloadSize, narSize);
|
store->queryMissing(targets, willBuild, willSubstitute, unknown, downloadSize, narSize);
|
||||||
logger->stopWork();
|
logger->stopWork();
|
||||||
writeStorePaths(*store, to, willBuild);
|
writeStorePaths(*store, to, willBuild);
|
||||||
|
|
|
@ -500,7 +500,7 @@ struct LocalStore::GCState
|
||||||
StorePathSet alive;
|
StorePathSet alive;
|
||||||
bool gcKeepOutputs;
|
bool gcKeepOutputs;
|
||||||
bool gcKeepDerivations;
|
bool gcKeepDerivations;
|
||||||
unsigned long long bytesInvalidated;
|
uint64_t bytesInvalidated;
|
||||||
bool moveToTrash = true;
|
bool moveToTrash = true;
|
||||||
bool shouldDelete;
|
bool shouldDelete;
|
||||||
GCState(const GCOptions & options, GCResults & results)
|
GCState(const GCOptions & options, GCResults & results)
|
||||||
|
@ -518,7 +518,7 @@ bool LocalStore::isActiveTempFile(const GCState & state,
|
||||||
|
|
||||||
void LocalStore::deleteGarbage(GCState & state, const Path & path)
|
void LocalStore::deleteGarbage(GCState & state, const Path & path)
|
||||||
{
|
{
|
||||||
unsigned long long bytesFreed;
|
uint64_t bytesFreed;
|
||||||
deletePath(path, bytesFreed);
|
deletePath(path, bytesFreed);
|
||||||
state.results.bytesFreed += bytesFreed;
|
state.results.bytesFreed += bytesFreed;
|
||||||
}
|
}
|
||||||
|
@ -528,7 +528,7 @@ void LocalStore::deletePathRecursive(GCState & state, const Path & path)
|
||||||
{
|
{
|
||||||
checkInterrupt();
|
checkInterrupt();
|
||||||
|
|
||||||
unsigned long long size = 0;
|
uint64_t size = 0;
|
||||||
|
|
||||||
auto storePath = maybeParseStorePath(path);
|
auto storePath = maybeParseStorePath(path);
|
||||||
if (storePath && isValidPath(*storePath)) {
|
if (storePath && isValidPath(*storePath)) {
|
||||||
|
@ -687,7 +687,7 @@ void LocalStore::removeUnusedLinks(const GCState & state)
|
||||||
AutoCloseDir dir(opendir(linksDir.c_str()));
|
AutoCloseDir dir(opendir(linksDir.c_str()));
|
||||||
if (!dir) throw SysError("opening directory '%1%'", linksDir);
|
if (!dir) throw SysError("opening directory '%1%'", linksDir);
|
||||||
|
|
||||||
long long actualSize = 0, unsharedSize = 0;
|
int64_t actualSize = 0, unsharedSize = 0;
|
||||||
|
|
||||||
struct dirent * dirent;
|
struct dirent * dirent;
|
||||||
while (errno = 0, dirent = readdir(dir.get())) {
|
while (errno = 0, dirent = readdir(dir.get())) {
|
||||||
|
@ -717,10 +717,10 @@ void LocalStore::removeUnusedLinks(const GCState & state)
|
||||||
struct stat st;
|
struct stat st;
|
||||||
if (stat(linksDir.c_str(), &st) == -1)
|
if (stat(linksDir.c_str(), &st) == -1)
|
||||||
throw SysError("statting '%1%'", linksDir);
|
throw SysError("statting '%1%'", linksDir);
|
||||||
long long overhead = st.st_blocks * 512ULL;
|
auto overhead = st.st_blocks * 512ULL;
|
||||||
|
|
||||||
printInfo(format("note: currently hard linking saves %.2f MiB")
|
printInfo("note: currently hard linking saves %.2f MiB",
|
||||||
% ((unsharedSize - actualSize - overhead) / (1024.0 * 1024.0)));
|
((unsharedSize - actualSize - overhead) / (1024.0 * 1024.0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -29,8 +29,8 @@ struct Derivation;
|
||||||
struct OptimiseStats
|
struct OptimiseStats
|
||||||
{
|
{
|
||||||
unsigned long filesLinked = 0;
|
unsigned long filesLinked = 0;
|
||||||
unsigned long long bytesFreed = 0;
|
uint64_t bytesFreed = 0;
|
||||||
unsigned long long blocksFreed = 0;
|
uint64_t blocksFreed = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -110,7 +110,7 @@ void Store::computeFSClosure(const StorePath & startPath,
|
||||||
|
|
||||||
void Store::queryMissing(const std::vector<StorePathWithOutputs> & targets,
|
void Store::queryMissing(const std::vector<StorePathWithOutputs> & targets,
|
||||||
StorePathSet & willBuild_, StorePathSet & willSubstitute_, StorePathSet & unknown_,
|
StorePathSet & willBuild_, StorePathSet & willSubstitute_, StorePathSet & unknown_,
|
||||||
unsigned long long & downloadSize_, unsigned long long & narSize_)
|
uint64_t & downloadSize_, uint64_t & narSize_)
|
||||||
{
|
{
|
||||||
Activity act(*logger, lvlDebug, actUnknown, "querying info about missing paths");
|
Activity act(*logger, lvlDebug, actUnknown, "querying info about missing paths");
|
||||||
|
|
||||||
|
@ -122,8 +122,8 @@ void Store::queryMissing(const std::vector<StorePathWithOutputs> & targets,
|
||||||
{
|
{
|
||||||
std::unordered_set<std::string> done;
|
std::unordered_set<std::string> done;
|
||||||
StorePathSet & unknown, & willSubstitute, & willBuild;
|
StorePathSet & unknown, & willSubstitute, & willBuild;
|
||||||
unsigned long long & downloadSize;
|
uint64_t & downloadSize;
|
||||||
unsigned long long & narSize;
|
uint64_t & narSize;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct DrvState
|
struct DrvState
|
||||||
|
|
|
@ -79,7 +79,7 @@ struct NarAccessor : public FSAccessor
|
||||||
parents.top()->isExecutable = true;
|
parents.top()->isExecutable = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void preallocateContents(unsigned long long size) override
|
void preallocateContents(uint64_t size) override
|
||||||
{
|
{
|
||||||
assert(size <= std::numeric_limits<uint64_t>::max());
|
assert(size <= std::numeric_limits<uint64_t>::max());
|
||||||
parents.top()->size = (uint64_t) size;
|
parents.top()->size = (uint64_t) size;
|
||||||
|
|
|
@ -282,7 +282,7 @@ void LocalStore::optimiseStore(OptimiseStats & stats)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static string showBytes(unsigned long long bytes)
|
static string showBytes(uint64_t bytes)
|
||||||
{
|
{
|
||||||
return (format("%.2f MiB") % (bytes / (1024.0 * 1024.0))).str();
|
return (format("%.2f MiB") % (bytes / (1024.0 * 1024.0))).str();
|
||||||
}
|
}
|
||||||
|
|
|
@ -782,7 +782,7 @@ void RemoteStore::addSignatures(const StorePath & storePath, const StringSet & s
|
||||||
|
|
||||||
void RemoteStore::queryMissing(const std::vector<StorePathWithOutputs> & targets,
|
void RemoteStore::queryMissing(const std::vector<StorePathWithOutputs> & targets,
|
||||||
StorePathSet & willBuild, StorePathSet & willSubstitute, StorePathSet & unknown,
|
StorePathSet & willBuild, StorePathSet & willSubstitute, StorePathSet & unknown,
|
||||||
unsigned long long & downloadSize, unsigned long long & narSize)
|
uint64_t & downloadSize, uint64_t & narSize)
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
auto conn(getConnection());
|
auto conn(getConnection());
|
||||||
|
|
|
@ -94,7 +94,7 @@ public:
|
||||||
|
|
||||||
void queryMissing(const std::vector<StorePathWithOutputs> & targets,
|
void queryMissing(const std::vector<StorePathWithOutputs> & targets,
|
||||||
StorePathSet & willBuild, StorePathSet & willSubstitute, StorePathSet & unknown,
|
StorePathSet & willBuild, StorePathSet & willSubstitute, StorePathSet & unknown,
|
||||||
unsigned long long & downloadSize, unsigned long long & narSize) override;
|
uint64_t & downloadSize, uint64_t & narSize) override;
|
||||||
|
|
||||||
void connect() override;
|
void connect() override;
|
||||||
|
|
||||||
|
|
|
@ -85,7 +85,7 @@ struct GCOptions
|
||||||
StorePathSet pathsToDelete;
|
StorePathSet pathsToDelete;
|
||||||
|
|
||||||
/* Stop after at least `maxFreed' bytes have been freed. */
|
/* Stop after at least `maxFreed' bytes have been freed. */
|
||||||
unsigned long long maxFreed{std::numeric_limits<unsigned long long>::max()};
|
uint64_t maxFreed{std::numeric_limits<uint64_t>::max()};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@ struct GCResults
|
||||||
|
|
||||||
/* For `gcReturnDead', `gcDeleteDead' and `gcDeleteSpecific', the
|
/* For `gcReturnDead', `gcDeleteDead' and `gcDeleteSpecific', the
|
||||||
number of bytes that would be or was freed. */
|
number of bytes that would be or was freed. */
|
||||||
unsigned long long bytesFreed = 0;
|
uint64_t bytesFreed = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -105,8 +105,8 @@ struct SubstitutablePathInfo
|
||||||
{
|
{
|
||||||
std::optional<StorePath> deriver;
|
std::optional<StorePath> deriver;
|
||||||
StorePathSet references;
|
StorePathSet references;
|
||||||
unsigned long long downloadSize; /* 0 = unknown or inapplicable */
|
uint64_t downloadSize; /* 0 = unknown or inapplicable */
|
||||||
unsigned long long narSize; /* 0 = unknown */
|
uint64_t narSize; /* 0 = unknown */
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef std::map<StorePath, SubstitutablePathInfo> SubstitutablePathInfos;
|
typedef std::map<StorePath, SubstitutablePathInfo> SubstitutablePathInfos;
|
||||||
|
@ -610,7 +610,7 @@ public:
|
||||||
that will be substituted. */
|
that will be substituted. */
|
||||||
virtual void queryMissing(const std::vector<StorePathWithOutputs> & targets,
|
virtual void queryMissing(const std::vector<StorePathWithOutputs> & targets,
|
||||||
StorePathSet & willBuild, StorePathSet & willSubstitute, StorePathSet & unknown,
|
StorePathSet & willBuild, StorePathSet & willSubstitute, StorePathSet & unknown,
|
||||||
unsigned long long & downloadSize, unsigned long long & narSize);
|
uint64_t & downloadSize, uint64_t & narSize);
|
||||||
|
|
||||||
/* Sort a set of paths topologically under the references
|
/* Sort a set of paths topologically under the references
|
||||||
relation. If p refers to q, then p precedes q in this list. */
|
relation. If p refers to q, then p precedes q in this list. */
|
||||||
|
|
|
@ -150,17 +150,17 @@ static void skipGeneric(Source & source)
|
||||||
|
|
||||||
static void parseContents(ParseSink & sink, Source & source, const Path & path)
|
static void parseContents(ParseSink & sink, Source & source, const Path & path)
|
||||||
{
|
{
|
||||||
unsigned long long size = readLongLong(source);
|
uint64_t size = readLongLong(source);
|
||||||
|
|
||||||
sink.preallocateContents(size);
|
sink.preallocateContents(size);
|
||||||
|
|
||||||
unsigned long long left = size;
|
uint64_t left = size;
|
||||||
std::vector<unsigned char> buf(65536);
|
std::vector<unsigned char> buf(65536);
|
||||||
|
|
||||||
while (left) {
|
while (left) {
|
||||||
checkInterrupt();
|
checkInterrupt();
|
||||||
auto n = buf.size();
|
auto n = buf.size();
|
||||||
if ((unsigned long long)n > left) n = left;
|
if ((uint64_t)n > left) n = left;
|
||||||
source(buf.data(), n);
|
source(buf.data(), n);
|
||||||
sink.receiveContents(buf.data(), n);
|
sink.receiveContents(buf.data(), n);
|
||||||
left -= n;
|
left -= n;
|
||||||
|
@ -323,7 +323,7 @@ struct RestoreSink : ParseSink
|
||||||
throw SysError("fchmod");
|
throw SysError("fchmod");
|
||||||
}
|
}
|
||||||
|
|
||||||
void preallocateContents(unsigned long long len)
|
void preallocateContents(uint64_t len)
|
||||||
{
|
{
|
||||||
#if HAVE_POSIX_FALLOCATE
|
#if HAVE_POSIX_FALLOCATE
|
||||||
if (len) {
|
if (len) {
|
||||||
|
|
|
@ -57,7 +57,7 @@ struct ParseSink
|
||||||
|
|
||||||
virtual void createRegularFile(const Path & path) { };
|
virtual void createRegularFile(const Path & path) { };
|
||||||
virtual void isExecutable() { };
|
virtual void isExecutable() { };
|
||||||
virtual void preallocateContents(unsigned long long size) { };
|
virtual void preallocateContents(uint64_t size) { };
|
||||||
virtual void receiveContents(unsigned char * data, size_t len) { };
|
virtual void receiveContents(unsigned char * data, size_t len) { };
|
||||||
|
|
||||||
virtual void createSymlink(const Path & path, const string & target) { };
|
virtual void createSymlink(const Path & path, const string & target) { };
|
||||||
|
|
|
@ -284,7 +284,7 @@ template class BaseSetting<unsigned int>;
|
||||||
template class BaseSetting<long>;
|
template class BaseSetting<long>;
|
||||||
template class BaseSetting<unsigned long>;
|
template class BaseSetting<unsigned long>;
|
||||||
template class BaseSetting<long long>;
|
template class BaseSetting<long long>;
|
||||||
template class BaseSetting<unsigned long long>;
|
template class BaseSetting<uint64_t>;
|
||||||
template class BaseSetting<bool>;
|
template class BaseSetting<bool>;
|
||||||
template class BaseSetting<std::string>;
|
template class BaseSetting<std::string>;
|
||||||
template class BaseSetting<Strings>;
|
template class BaseSetting<Strings>;
|
||||||
|
|
|
@ -111,7 +111,7 @@ Hash hashFile(HashType ht, const Path & path);
|
||||||
|
|
||||||
/* Compute the hash of the given path. The hash is defined as
|
/* Compute the hash of the given path. The hash is defined as
|
||||||
(essentially) hashString(ht, dumpPath(path)). */
|
(essentially) hashString(ht, dumpPath(path)). */
|
||||||
typedef std::pair<Hash, unsigned long long> HashResult;
|
typedef std::pair<Hash, uint64_t> HashResult;
|
||||||
HashResult hashPath(HashType ht, const Path & path,
|
HashResult hashPath(HashType ht, const Path & path,
|
||||||
PathFilter & filter = defaultPathFilter);
|
PathFilter & filter = defaultPathFilter);
|
||||||
|
|
||||||
|
@ -141,7 +141,7 @@ class HashSink : public BufferedSink, public AbstractHashSink
|
||||||
private:
|
private:
|
||||||
HashType ht;
|
HashType ht;
|
||||||
Ctx * ctx;
|
Ctx * ctx;
|
||||||
unsigned long long bytes;
|
uint64_t bytes;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
HashSink(HashType ht);
|
HashSink(HashType ht);
|
||||||
|
|
|
@ -29,7 +29,7 @@ template<> void toJSON<unsigned int>(std::ostream & str, const unsigned int & n)
|
||||||
template<> void toJSON<long>(std::ostream & str, const long & n) { str << n; }
|
template<> void toJSON<long>(std::ostream & str, const long & n) { str << n; }
|
||||||
template<> void toJSON<unsigned long>(std::ostream & str, const unsigned long & n) { str << n; }
|
template<> void toJSON<unsigned long>(std::ostream & str, const unsigned long & n) { str << n; }
|
||||||
template<> void toJSON<long long>(std::ostream & str, const long long & n) { str << n; }
|
template<> void toJSON<long long>(std::ostream & str, const long long & n) { str << n; }
|
||||||
template<> void toJSON<unsigned long long>(std::ostream & str, const unsigned long long & n) { str << n; }
|
template<> void toJSON<uint64_t>(std::ostream & str, const uint64_t & n) { str << n; }
|
||||||
template<> void toJSON<float>(std::ostream & str, const float & n) { str << n; }
|
template<> void toJSON<float>(std::ostream & str, const float & n) { str << n; }
|
||||||
template<> void toJSON<double>(std::ostream & str, const double & n) { str << n; }
|
template<> void toJSON<double>(std::ostream & str, const double & n) { str << n; }
|
||||||
|
|
||||||
|
|
|
@ -312,14 +312,14 @@ T readNum(Source & source)
|
||||||
source(buf, sizeof(buf));
|
source(buf, sizeof(buf));
|
||||||
|
|
||||||
uint64_t n =
|
uint64_t n =
|
||||||
((unsigned long long) buf[0]) |
|
((uint64_t) buf[0]) |
|
||||||
((unsigned long long) buf[1] << 8) |
|
((uint64_t) buf[1] << 8) |
|
||||||
((unsigned long long) buf[2] << 16) |
|
((uint64_t) buf[2] << 16) |
|
||||||
((unsigned long long) buf[3] << 24) |
|
((uint64_t) buf[3] << 24) |
|
||||||
((unsigned long long) buf[4] << 32) |
|
((uint64_t) buf[4] << 32) |
|
||||||
((unsigned long long) buf[5] << 40) |
|
((uint64_t) buf[5] << 40) |
|
||||||
((unsigned long long) buf[6] << 48) |
|
((uint64_t) buf[6] << 48) |
|
||||||
((unsigned long long) buf[7] << 56);
|
((uint64_t) buf[7] << 56);
|
||||||
|
|
||||||
if (n > std::numeric_limits<T>::max())
|
if (n > std::numeric_limits<T>::max())
|
||||||
throw SerialisationError("serialised integer %d is too large for type '%s'", n, typeid(T).name());
|
throw SerialisationError("serialised integer %d is too large for type '%s'", n, typeid(T).name());
|
||||||
|
|
|
@ -374,7 +374,7 @@ void writeLine(int fd, string s)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void _deletePath(int parentfd, const Path & path, unsigned long long & bytesFreed)
|
static void _deletePath(int parentfd, const Path & path, uint64_t & bytesFreed)
|
||||||
{
|
{
|
||||||
checkInterrupt();
|
checkInterrupt();
|
||||||
|
|
||||||
|
@ -414,7 +414,7 @@ static void _deletePath(int parentfd, const Path & path, unsigned long long & by
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _deletePath(const Path & path, unsigned long long & bytesFreed)
|
static void _deletePath(const Path & path, uint64_t & bytesFreed)
|
||||||
{
|
{
|
||||||
Path dir = dirOf(path);
|
Path dir = dirOf(path);
|
||||||
if (dir == "")
|
if (dir == "")
|
||||||
|
@ -435,12 +435,12 @@ static void _deletePath(const Path & path, unsigned long long & bytesFreed)
|
||||||
|
|
||||||
void deletePath(const Path & path)
|
void deletePath(const Path & path)
|
||||||
{
|
{
|
||||||
unsigned long long dummy;
|
uint64_t dummy;
|
||||||
deletePath(path, dummy);
|
deletePath(path, dummy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void deletePath(const Path & path, unsigned long long & bytesFreed)
|
void deletePath(const Path & path, uint64_t & bytesFreed)
|
||||||
{
|
{
|
||||||
//Activity act(*logger, lvlDebug, format("recursively deleting path '%1%'") % path);
|
//Activity act(*logger, lvlDebug, format("recursively deleting path '%1%'") % path);
|
||||||
bytesFreed = 0;
|
bytesFreed = 0;
|
||||||
|
|
|
@ -125,7 +125,7 @@ void writeLine(int fd, string s);
|
||||||
second variant returns the number of bytes and blocks freed. */
|
second variant returns the number of bytes and blocks freed. */
|
||||||
void deletePath(const Path & path);
|
void deletePath(const Path & path);
|
||||||
|
|
||||||
void deletePath(const Path & path, unsigned long long & bytesFreed);
|
void deletePath(const Path & path, uint64_t & bytesFreed);
|
||||||
|
|
||||||
std::string getUserName();
|
std::string getUserName();
|
||||||
|
|
||||||
|
|
|
@ -325,7 +325,7 @@ static void _main(int argc, char * * argv)
|
||||||
auto buildPaths = [&](const std::vector<StorePathWithOutputs> & paths) {
|
auto buildPaths = [&](const std::vector<StorePathWithOutputs> & paths) {
|
||||||
/* Note: we do this even when !printMissing to efficiently
|
/* Note: we do this even when !printMissing to efficiently
|
||||||
fetch binary cache data. */
|
fetch binary cache data. */
|
||||||
unsigned long long downloadSize, narSize;
|
uint64_t downloadSize, narSize;
|
||||||
StorePathSet willBuild, willSubstitute, unknown;
|
StorePathSet willBuild, willSubstitute, unknown;
|
||||||
store->queryMissing(paths,
|
store->queryMissing(paths,
|
||||||
willBuild, willSubstitute, unknown, downloadSize, narSize);
|
willBuild, willSubstitute, unknown, downloadSize, narSize);
|
||||||
|
|
|
@ -67,10 +67,8 @@ static int _main(int argc, char * * argv)
|
||||||
deleteOlderThan = getArg(*arg, arg, end);
|
deleteOlderThan = getArg(*arg, arg, end);
|
||||||
}
|
}
|
||||||
else if (*arg == "--dry-run") dryRun = true;
|
else if (*arg == "--dry-run") dryRun = true;
|
||||||
else if (*arg == "--max-freed") {
|
else if (*arg == "--max-freed")
|
||||||
long long maxFreed = getIntArg<long long>(*arg, arg, end, true);
|
options.maxFreed = std::max(getIntArg<int64_t>(*arg, arg, end, true), (int64_t) 0);
|
||||||
options.maxFreed = maxFreed >= 0 ? maxFreed : 0;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -130,7 +130,7 @@ static void opRealise(Strings opFlags, Strings opArgs)
|
||||||
for (auto & i : opArgs)
|
for (auto & i : opArgs)
|
||||||
paths.push_back(store->followLinksToStorePathWithOutputs(i));
|
paths.push_back(store->followLinksToStorePathWithOutputs(i));
|
||||||
|
|
||||||
unsigned long long downloadSize, narSize;
|
uint64_t downloadSize, narSize;
|
||||||
StorePathSet willBuild, willSubstitute, unknown;
|
StorePathSet willBuild, willSubstitute, unknown;
|
||||||
store->queryMissing(paths, willBuild, willSubstitute, unknown, downloadSize, narSize);
|
store->queryMissing(paths, willBuild, willSubstitute, unknown, downloadSize, narSize);
|
||||||
|
|
||||||
|
@ -572,10 +572,8 @@ static void opGC(Strings opFlags, Strings opArgs)
|
||||||
if (*i == "--print-roots") printRoots = true;
|
if (*i == "--print-roots") printRoots = true;
|
||||||
else if (*i == "--print-live") options.action = GCOptions::gcReturnLive;
|
else if (*i == "--print-live") options.action = GCOptions::gcReturnLive;
|
||||||
else if (*i == "--print-dead") options.action = GCOptions::gcReturnDead;
|
else if (*i == "--print-dead") options.action = GCOptions::gcReturnDead;
|
||||||
else if (*i == "--max-freed") {
|
else if (*i == "--max-freed")
|
||||||
long long maxFreed = getIntArg<long long>(*i, i, opFlags.end(), true);
|
options.maxFreed = std::max(getIntArg<int64_t>(*i, i, opFlags.end(), true), (int64_t) 0);
|
||||||
options.maxFreed = maxFreed >= 0 ? maxFreed : 0;
|
|
||||||
}
|
|
||||||
else throw UsageError("bad sub-operation '%1%' in GC", *i);
|
else throw UsageError("bad sub-operation '%1%' in GC", *i);
|
||||||
|
|
||||||
if (!opArgs.empty()) throw UsageError("no arguments expected");
|
if (!opArgs.empty()) throw UsageError("no arguments expected");
|
||||||
|
@ -831,7 +829,7 @@ static void opServe(Strings opFlags, Strings opArgs)
|
||||||
for (auto & path : paths)
|
for (auto & path : paths)
|
||||||
if (!path.isDerivation())
|
if (!path.isDerivation())
|
||||||
paths2.push_back({path});
|
paths2.push_back({path});
|
||||||
unsigned long long downloadSize, narSize;
|
uint64_t downloadSize, narSize;
|
||||||
StorePathSet willBuild, willSubstitute, unknown;
|
StorePathSet willBuild, willSubstitute, unknown;
|
||||||
store->queryMissing(paths2,
|
store->queryMissing(paths2,
|
||||||
willBuild, willSubstitute, unknown, downloadSize, narSize);
|
willBuild, willSubstitute, unknown, downloadSize, narSize);
|
||||||
|
|
|
@ -61,7 +61,7 @@ struct CmdPathInfo : StorePathsCommand, MixJSON
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
void printSize(unsigned long long value)
|
void printSize(uint64_t value)
|
||||||
{
|
{
|
||||||
if (!humanReadable) {
|
if (!humanReadable) {
|
||||||
std::cout << fmt("\t%11d", value);
|
std::cout << fmt("\t%11d", value);
|
||||||
|
|
Loading…
Reference in a new issue