forked from lix-project/nix-eval-jobs
optimize imports with "include-what-you-use"
This commit is contained in:
parent
843dc25cfe
commit
1f4bbded61
|
@ -1,7 +1,11 @@
|
||||||
#include "buffered-io.hh"
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <nix/signals.hh>
|
#include <nix/signals.hh>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <error.hh>
|
||||||
|
|
||||||
|
#include "buffered-io.hh"
|
||||||
|
|
||||||
[[nodiscard]] int tryWriteLine(int fd, std::string s) {
|
[[nodiscard]] int tryWriteLine(int fd, std::string s) {
|
||||||
s += "\n";
|
s += "\n";
|
||||||
|
|
21
src/drv.cc
21
src/drv.cc
|
@ -1,10 +1,27 @@
|
||||||
#include "drv.hh"
|
#include <nix/config.h> // IWYU pragma: keep
|
||||||
#include <nix/config.h>
|
|
||||||
#include <nix/path-with-outputs.hh>
|
#include <nix/path-with-outputs.hh>
|
||||||
#include <nix/store-api.hh>
|
#include <nix/store-api.hh>
|
||||||
#include <nix/local-fs-store.hh>
|
#include <nix/local-fs-store.hh>
|
||||||
#include <nix/value-to-json.hh>
|
#include <nix/value-to-json.hh>
|
||||||
#include <nix/derivations.hh>
|
#include <nix/derivations.hh>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <nix/derived-path-map.hh>
|
||||||
|
#include <nix/eval.hh>
|
||||||
|
#include <nix/get-drvs.hh>
|
||||||
|
#include <nix/nixexpr.hh>
|
||||||
|
#include <nlohmann/detail/json_ref.hpp>
|
||||||
|
#include <nix/path.hh>
|
||||||
|
#include <nix/ref.hh>
|
||||||
|
#include <nix/value/context.hh>
|
||||||
|
#include <exception>
|
||||||
|
#include <memory>
|
||||||
|
#include <sstream>
|
||||||
|
#include <utility>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
#include "drv.hh"
|
||||||
|
#include "eval-args.hh"
|
||||||
|
|
||||||
static bool queryIsCached(nix::Store &store,
|
static bool queryIsCached(nix::Store &store,
|
||||||
std::map<std::string, std::string> &outputs) {
|
std::map<std::string, std::string> &outputs) {
|
||||||
|
|
16
src/drv.hh
16
src/drv.hh
|
@ -1,16 +1,22 @@
|
||||||
|
#include <nix/get-drvs.hh>
|
||||||
|
#include <nix/eval.hh>
|
||||||
|
#include <nlohmann/json.hpp>
|
||||||
|
#include <nlohmann/json_fwd.hpp>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <optional>
|
#include <optional>
|
||||||
|
|
||||||
#include <nix/get-drvs.hh>
|
|
||||||
#include <nix/eval.hh>
|
|
||||||
|
|
||||||
#include <nlohmann/json.hpp>
|
|
||||||
|
|
||||||
#include "eval-args.hh"
|
#include "eval-args.hh"
|
||||||
|
|
||||||
|
class MyArgs;
|
||||||
|
|
||||||
|
namespace nix {
|
||||||
|
class EvalState;
|
||||||
|
struct DrvInfo;
|
||||||
|
} // namespace nix
|
||||||
|
|
||||||
/* The fields of a derivation that are printed in json form */
|
/* The fields of a derivation that are printed in json form */
|
||||||
struct Drv {
|
struct Drv {
|
||||||
std::string name;
|
std::string name;
|
||||||
|
|
|
@ -1,3 +1,15 @@
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <nix/args.hh>
|
||||||
|
#include <nix/file-system.hh>
|
||||||
|
#include <nix/flake/flake.hh>
|
||||||
|
#include <nix/flake/lockfile.hh>
|
||||||
|
#include <functional>
|
||||||
|
#include <map>
|
||||||
|
#include <memory>
|
||||||
|
#include <set>
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
#include "eval-args.hh"
|
#include "eval-args.hh"
|
||||||
|
|
||||||
MyArgs::MyArgs() : MixCommonArgs("nix-eval-jobs") {
|
MyArgs::MyArgs() : MixCommonArgs("nix-eval-jobs") {
|
||||||
|
|
|
@ -1,9 +1,14 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <nix/flake/flake.hh>
|
#include <nix/flake/flake.hh>
|
||||||
#include <nix/args/root.hh>
|
#include <nix/args/root.hh>
|
||||||
#include <nix/common-eval-args.hh>
|
#include <nix/common-eval-args.hh>
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <nix/common-args.hh>
|
||||||
|
#include <nix/flake/flakeref.hh>
|
||||||
|
#include <nix/types.hh>
|
||||||
|
#include <string>
|
||||||
|
#include <optional>
|
||||||
|
|
||||||
class MyArgs : virtual public nix::MixEvalArgs,
|
class MyArgs : virtual public nix::MixEvalArgs,
|
||||||
virtual public nix::MixCommonArgs,
|
virtual public nix::MixCommonArgs,
|
||||||
|
|
|
@ -1,30 +1,49 @@
|
||||||
#include <map>
|
#include <nix/config.h> // IWYU pragma: keep
|
||||||
#include <sys/signal.h>
|
|
||||||
#include <thread>
|
|
||||||
#include <condition_variable>
|
|
||||||
#include <filesystem>
|
|
||||||
|
|
||||||
#include <nix/config.h>
|
|
||||||
#include <nix/eval-settings.hh>
|
#include <nix/eval-settings.hh>
|
||||||
#include <nix/common-eval-args.hh>
|
|
||||||
#include <nix/args/root.hh>
|
|
||||||
#include <nix/shared.hh>
|
#include <nix/shared.hh>
|
||||||
#include <nix/sync.hh>
|
#include <nix/sync.hh>
|
||||||
#include <nix/eval.hh>
|
#include <nix/eval.hh>
|
||||||
#include <nix/get-drvs.hh>
|
|
||||||
#include <nix/value-to-json.hh>
|
|
||||||
#include <nix/local-fs-store.hh>
|
|
||||||
#include <nix/signals.hh>
|
#include <nix/signals.hh>
|
||||||
#include <nix/terminal.hh>
|
#include <nix/terminal.hh>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
|
#include <nlohmann/json.hpp>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <signal.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <nix/attr-set.hh>
|
||||||
|
#include <nix/config.hh>
|
||||||
|
#include <nix/error.hh>
|
||||||
|
#include <nix/file-descriptor.hh>
|
||||||
|
#include <nix/globals.hh>
|
||||||
|
#include <nix/logging.hh>
|
||||||
|
#include <nlohmann/detail/iterators/iter_impl.hpp>
|
||||||
|
#include <nlohmann/detail/json_ref.hpp>
|
||||||
|
#include <nlohmann/json_fwd.hpp>
|
||||||
|
#include <nix/processes.hh>
|
||||||
|
#include <nix/ref.hh>
|
||||||
|
#include <nix/store-api.hh>
|
||||||
|
#include <map>
|
||||||
|
#include <thread>
|
||||||
|
#include <condition_variable>
|
||||||
|
#include <filesystem>
|
||||||
|
#include <exception>
|
||||||
|
#include <functional>
|
||||||
|
#include <iostream>
|
||||||
|
#include <memory>
|
||||||
|
#include <optional>
|
||||||
|
#include <set>
|
||||||
|
#include <string>
|
||||||
|
#include <string_view>
|
||||||
|
#include <utility>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
#include "eval-args.hh"
|
#include "eval-args.hh"
|
||||||
#include "drv.hh"
|
|
||||||
#include "buffered-io.hh"
|
#include "buffered-io.hh"
|
||||||
#include "worker.hh"
|
#include "worker.hh"
|
||||||
|
|
||||||
#include <nlohmann/json.hpp>
|
|
||||||
|
|
||||||
using namespace nix;
|
using namespace nix;
|
||||||
using namespace nlohmann;
|
using namespace nlohmann;
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,52 @@
|
||||||
#include "worker.hh"
|
#include <nix/config.h> // IWYU pragma: keep
|
||||||
#include "drv.hh"
|
|
||||||
#include "buffered-io.hh"
|
// doesn't exist on macOS
|
||||||
|
// IWYU pragma: no_include <bits/types/struct_rusage.h>
|
||||||
|
|
||||||
#include <nix/terminal.hh>
|
#include <nix/terminal.hh>
|
||||||
#include <nix/attr-path.hh>
|
#include <nix/attr-path.hh>
|
||||||
#include <nix/local-fs-store.hh>
|
#include <nix/local-fs-store.hh>
|
||||||
#include <nix/installable-flake.hh>
|
#include <nix/installable-flake.hh>
|
||||||
|
|
||||||
#include <sys/resource.h>
|
#include <sys/resource.h>
|
||||||
#include <nlohmann/json.hpp>
|
#include <nlohmann/json.hpp>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <nix/attr-set.hh>
|
||||||
|
#include <nix/canon-path.hh>
|
||||||
|
#include <nix/common-eval-args.hh>
|
||||||
|
#include <nix/error.hh>
|
||||||
|
#include <nix/eval-inline.hh>
|
||||||
|
#include <nix/eval.hh>
|
||||||
|
#include <nix/file-descriptor.hh>
|
||||||
|
#include <nix/file-system.hh>
|
||||||
|
#include <nix/flake/flakeref.hh>
|
||||||
|
#include <nix/get-drvs.hh>
|
||||||
|
#include <nix/input-accessor.hh>
|
||||||
|
#include <nix/logging.hh>
|
||||||
|
#include <nix/nixexpr.hh>
|
||||||
|
#include <nlohmann/detail/json_ref.hpp>
|
||||||
|
#include <nlohmann/json_fwd.hpp>
|
||||||
|
#include <nix/ref.hh>
|
||||||
|
#include <nix/store-api.hh>
|
||||||
|
#include <nix/symbol-table.hh>
|
||||||
|
#include <nix/types.hh>
|
||||||
|
#include <nix/util.hh>
|
||||||
|
#include <nix/value.hh>
|
||||||
|
#include <exception>
|
||||||
|
#include <map>
|
||||||
|
#include <memory>
|
||||||
|
#include <numeric>
|
||||||
|
#include <optional>
|
||||||
|
#include <sstream>
|
||||||
|
#include <string>
|
||||||
|
#include <string_view>
|
||||||
|
#include <utility>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
#include "worker.hh"
|
||||||
|
#include "drv.hh"
|
||||||
|
#include "buffered-io.hh"
|
||||||
|
#include "eval-args.hh"
|
||||||
|
|
||||||
static nix::Value *releaseExprTopLevelValue(nix::EvalState &state,
|
static nix::Value *releaseExprTopLevelValue(nix::EvalState &state,
|
||||||
nix::Bindings &autoArgs,
|
nix::Bindings &autoArgs,
|
||||||
|
|
|
@ -1,9 +1,17 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <nix/config.h>
|
|
||||||
#include <nix/shared.hh>
|
#include <nix/shared.hh>
|
||||||
#include <nix/eval.hh>
|
#include <nix/eval.hh>
|
||||||
|
|
||||||
#include "eval-args.hh"
|
#include "eval-args.hh"
|
||||||
|
|
||||||
|
class MyArgs;
|
||||||
|
|
||||||
|
namespace nix {
|
||||||
|
class AutoCloseFD;
|
||||||
|
class Bindings;
|
||||||
|
class EvalState;
|
||||||
|
template <typename T> class ref;
|
||||||
|
} // namespace nix
|
||||||
|
|
||||||
void worker(nix::ref<nix::EvalState> state, nix::Bindings &autoArgs,
|
void worker(nix::ref<nix::EvalState> state, nix::Bindings &autoArgs,
|
||||||
nix::AutoCloseFD &to, nix::AutoCloseFD &from, MyArgs &args);
|
nix::AutoCloseFD &to, nix::AutoCloseFD &from, MyArgs &args);
|
||||||
|
|
Loading…
Reference in a new issue