Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions src/libexpr/eval-cache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -381,11 +381,6 @@ AttrPath AttrCursor::getAttrPath(Symbol name) const
return attrPath;
}

std::string toAttrPathStr(EvalState & state, const AttrPath & attrPath)
{
return dropEmptyInitThenConcatStringsSep(".", state.symbols.resolve(attrPath));
}

std::string AttrCursor::getAttrPathStr() const
{
return getAttrPath().to_string(root->state);
Expand Down
8 changes: 8 additions & 0 deletions src/libfetchers/git-utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,7 @@ struct GitRepoImpl : GitRepo, std::enable_shared_from_this<GitRepoImpl>
keyDecoded = base64::decode(k.key);
} catch (Error & e) {
e.addTrace({}, "while decoding public key '%s' used for git signature", k.key);
throw;
}
auto fingerprint =
trim(hashString(HashAlgorithm::SHA256, keyDecoded).to_string(nix::HashFormat::Base64, false), "=");
Expand Down Expand Up @@ -1121,6 +1122,13 @@ struct GitFileSystemObjectSinkImpl : GitFileSystemObjectSink
{
}

~GitFileSystemObjectSinkImpl()
{
// Make sure the worker threads are destroyed before any state
// they're referring to.
workers.shutdown();
}

struct Child;

/// A directory to be written as a Git tree.
Expand Down
2 changes: 0 additions & 2 deletions src/libstore/build-result.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
#include "nix/util/json-utils.hh"
#include <array>

#include <nlohmann/json.hpp>

namespace nix {

bool BuildResult::operator==(const BuildResult &) const noexcept = default;
Expand Down
10 changes: 0 additions & 10 deletions src/libutil/hash.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
#include <sys/stat.h>
#include <fcntl.h>

#include <nlohmann/json.hpp>

#include <sodium.h>

namespace nix {
Expand Down Expand Up @@ -513,14 +511,6 @@ std::string_view printHashAlgo(HashAlgorithm ha)
}
}

void to_json(nlohmann::json & json, const Hash & hash)
{
json = nlohmann::json::object({
{"algo", printHashAlgo(hash.algo)},
{"base16", hash.to_string(HashFormat::Base16, false)},
});
}

} // namespace nix

namespace nlohmann {
Expand Down
7 changes: 0 additions & 7 deletions src/libutil/include/nix/util/hash.hh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
#include "nix/util/file-system.hh"
#include "nix/util/json-impls.hh"

#include <nlohmann/json_fwd.hpp>

namespace nix {

MakeError(BadHash, Error);
Expand Down Expand Up @@ -216,11 +214,6 @@ parseHashAlgoOpt(std::string_view s, const ExperimentalFeatureSettings & xpSetti
*/
std::string_view printHashAlgo(HashAlgorithm ha);

/**
* Write a JSON serialisation of the format `{"algo":"<sha1|...>","base16":"<hex>"}`.
*/
void to_json(nlohmann::json & json, const Hash & hash);

struct AbstractHashSink : virtual Sink
{
virtual HashResult finish() = 0;
Expand Down
8 changes: 6 additions & 2 deletions src/libutil/include/nix/util/thread-pool.hh
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ public:
*/
void process();

/**
* Shut down all worker threads and wait until they've exited.
* Active work items are finished, but any pending work items are discarded.
*/
void shutdown();

private:

size_t maxThreads;
Expand All @@ -72,8 +78,6 @@ private:
std::condition_variable work;

void doWork(bool mainThread);

void shutdown();
};

/**
Expand Down