diff options
author | Matej Urbas <matej.urbas@gmail.com> | 2023-05-08 19:21:57 +0100 |
---|---|---|
committer | Matej Urbas <matej.urbas@gmail.com> | 2023-05-08 19:21:57 +0100 |
commit | 1ea1e378de22bf32b5ccc1edf66798ab91299ac7 (patch) | |
tree | 44afe2e70cb4e6908979f245cc10a86e9e52be5c /src | |
parent | 613bc699bb72d32c7d0622bf2996b2ecc8012455 (diff) |
removes MaxSubstitutionJobsSetting
Diffstat (limited to 'src')
-rw-r--r-- | src/libstore/globals.cc | 11 | ||||
-rw-r--r-- | src/libstore/globals.hh | 22 |
2 files changed, 2 insertions, 31 deletions
diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc index 46b14cc98..4c66d08ee 100644 --- a/src/libstore/globals.cc +++ b/src/libstore/globals.cc @@ -249,17 +249,6 @@ unsigned int MaxBuildJobsSetting::parse(const std::string & str) const } } -unsigned int MaxSubstitutionJobsSetting::parse(const std::string & str) const -{ - if (str == "auto") return std::max(1U, std::thread::hardware_concurrency()); - else { - if (auto n = string2Int<decltype(value)>(str)) - return std::max(1U, *n); - else - throw UsageError("configuration setting '%s' should be 'auto' or an integer", name); - } -} - Paths PluginFilesSetting::parse(const std::string & str) const { diff --git a/src/libstore/globals.hh b/src/libstore/globals.hh index f1e1e4b22..c41125523 100644 --- a/src/libstore/globals.hh +++ b/src/libstore/globals.hh @@ -29,21 +29,6 @@ struct MaxBuildJobsSetting : public BaseSetting<unsigned int> unsigned int parse(const std::string & str) const override; }; -struct MaxSubstitutionJobsSetting : public BaseSetting<unsigned int> -{ - MaxSubstitutionJobsSetting(Config * options, - unsigned int def, - const std::string & name, - const std::string & description, - const std::set<std::string> & aliases = {}) - : BaseSetting<unsigned int>(def, true, name, description, aliases) - { - options->addSetting(this); - } - - unsigned int parse(const std::string & str) const override; -}; - struct PluginFilesSetting : public BaseSetting<Paths> { bool pluginsLoaded = false; @@ -174,15 +159,12 @@ public: )", {"build-max-jobs"}}; - MaxSubstitutionJobsSetting maxSubstitutionJobs{ + Setting<unsigned int> maxSubstitutionJobs{ this, 16, "max-substitution-jobs", R"( This option defines the maximum number of substitution jobs that Nix will try to run in parallel. The default is `16`. The minimum value - one can choose is `1` and lower values will be interpreted as `1`. The - special value `auto` causes Nix to use the number of CPUs in your - system. It can be overridden using the `--max-substitution-jobs` - command line switch. + one can choose is `1` and lower values will be interpreted as `1`. )", {"substitution-max-jobs"}}; |