mirror of
https://github.com/NixOS/nix
synced 2025-07-06 21:41:48 +02:00
Merge remote-tracking branch 'origin/master' into handle-failed-cached-values
This commit is contained in:
commit
2ec1eba7ca
669 changed files with 3341 additions and 3231 deletions
|
@ -9,19 +9,19 @@
|
|||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
#include "machines.hh"
|
||||
#include "shared.hh"
|
||||
#include "plugin.hh"
|
||||
#include "pathlocks.hh"
|
||||
#include "globals.hh"
|
||||
#include "serialise.hh"
|
||||
#include "build-result.hh"
|
||||
#include "store-api.hh"
|
||||
#include "strings.hh"
|
||||
#include "derivations.hh"
|
||||
#include "local-store.hh"
|
||||
#include "legacy.hh"
|
||||
#include "experimental-features.hh"
|
||||
#include "nix/machines.hh"
|
||||
#include "nix/shared.hh"
|
||||
#include "nix/plugin.hh"
|
||||
#include "nix/pathlocks.hh"
|
||||
#include "nix/globals.hh"
|
||||
#include "nix/serialise.hh"
|
||||
#include "nix/build-result.hh"
|
||||
#include "nix/store-api.hh"
|
||||
#include "nix/strings.hh"
|
||||
#include "nix/derivations.hh"
|
||||
#include "nix/local-store.hh"
|
||||
#include "nix/legacy.hh"
|
||||
#include "nix/experimental-features.hh"
|
||||
|
||||
using namespace nix;
|
||||
using std::cin;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#include "built-path.hh"
|
||||
#include "derivations.hh"
|
||||
#include "store-api.hh"
|
||||
#include "comparator.hh"
|
||||
#include "nix/built-path.hh"
|
||||
#include "nix/derivations.hh"
|
||||
#include "nix/store-api.hh"
|
||||
#include "nix/comparator.hh"
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "command-installable-value.hh"
|
||||
#include "nix/command-installable-value.hh"
|
||||
|
||||
namespace nix {
|
||||
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
#include <algorithm>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
#include "command.hh"
|
||||
#include "markdown.hh"
|
||||
#include "store-api.hh"
|
||||
#include "local-fs-store.hh"
|
||||
#include "derivations.hh"
|
||||
#include "nixexpr.hh"
|
||||
#include "profiles.hh"
|
||||
#include "repl.hh"
|
||||
#include "strings.hh"
|
||||
#include "environment-variables.hh"
|
||||
#include "nix/command.hh"
|
||||
#include "nix/markdown.hh"
|
||||
#include "nix/store-api.hh"
|
||||
#include "nix/local-fs-store.hh"
|
||||
#include "nix/derivations.hh"
|
||||
#include "nix/nixexpr.hh"
|
||||
#include "nix/profiles.hh"
|
||||
#include "nix/repl.hh"
|
||||
#include "nix/strings.hh"
|
||||
#include "nix/environment-variables.hh"
|
||||
|
||||
namespace nix {
|
||||
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
#include "fetch-settings.hh"
|
||||
#include "eval-settings.hh"
|
||||
#include "common-eval-args.hh"
|
||||
#include "shared.hh"
|
||||
#include "config-global.hh"
|
||||
#include "filetransfer.hh"
|
||||
#include "eval.hh"
|
||||
#include "fetchers.hh"
|
||||
#include "registry.hh"
|
||||
#include "flake/flakeref.hh"
|
||||
#include "flake/settings.hh"
|
||||
#include "store-api.hh"
|
||||
#include "command.hh"
|
||||
#include "tarball.hh"
|
||||
#include "fetch-to-store.hh"
|
||||
#include "compatibility-settings.hh"
|
||||
#include "eval-settings.hh"
|
||||
#include "nix/fetch-settings.hh"
|
||||
#include "nix/eval-settings.hh"
|
||||
#include "nix/common-eval-args.hh"
|
||||
#include "nix/shared.hh"
|
||||
#include "nix/config-global.hh"
|
||||
#include "nix/filetransfer.hh"
|
||||
#include "nix/eval.hh"
|
||||
#include "nix/fetchers.hh"
|
||||
#include "nix/registry.hh"
|
||||
#include "nix/flake/flakeref.hh"
|
||||
#include "nix/flake/settings.hh"
|
||||
#include "nix/store-api.hh"
|
||||
#include "nix/command.hh"
|
||||
#include "nix/tarball.hh"
|
||||
#include "nix/fetch-to-store.hh"
|
||||
#include "nix/compatibility-settings.hh"
|
||||
#include "nix/eval-settings.hh"
|
||||
|
||||
namespace nix {
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "editor-for.hh"
|
||||
#include "environment-variables.hh"
|
||||
#include "source-path.hh"
|
||||
#include "nix/editor-for.hh"
|
||||
#include "nix/environment-variables.hh"
|
||||
#include "nix/source-path.hh"
|
||||
|
||||
namespace nix {
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#pragma once
|
||||
///@file
|
||||
|
||||
#include "derived-path.hh"
|
||||
#include "realisation.hh"
|
||||
#include "nix/derived-path.hh"
|
||||
#include "nix/realisation.hh"
|
||||
|
||||
namespace nix {
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
#pragma once
|
||||
///@file
|
||||
|
||||
#include "installable-value.hh"
|
||||
#include "command.hh"
|
||||
#include "nix/installable-value.hh"
|
||||
#include "nix/command.hh"
|
||||
|
||||
namespace nix {
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
#pragma once
|
||||
///@file
|
||||
|
||||
#include "installable-value.hh"
|
||||
#include "args.hh"
|
||||
#include "common-eval-args.hh"
|
||||
#include "path.hh"
|
||||
#include "flake/lockfile.hh"
|
||||
#include "nix/installable-value.hh"
|
||||
#include "nix/args.hh"
|
||||
#include "nix/common-eval-args.hh"
|
||||
#include "nix/path.hh"
|
||||
#include "nix/flake/lockfile.hh"
|
||||
|
||||
#include <optional>
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
#pragma once
|
||||
///@file
|
||||
|
||||
#include "args.hh"
|
||||
#include "canon-path.hh"
|
||||
#include "common-args.hh"
|
||||
#include "search-path.hh"
|
||||
#include "nix/args.hh"
|
||||
#include "nix/canon-path.hh"
|
||||
#include "nix/common-args.hh"
|
||||
#include "nix/search-path.hh"
|
||||
|
||||
#include <filesystem>
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
#pragma once
|
||||
#include "config.hh"
|
||||
#include "nix/config.hh"
|
||||
|
||||
namespace nix {
|
||||
struct CompatibilitySettings : public Config
|
|
@ -1,8 +1,8 @@
|
|||
#pragma once
|
||||
///@file
|
||||
|
||||
#include "types.hh"
|
||||
#include "source-path.hh"
|
||||
#include "nix/types.hh"
|
||||
#include "nix/source-path.hh"
|
||||
|
||||
namespace nix {
|
||||
|
|
@ -1,22 +1,22 @@
|
|||
#pragma once
|
||||
///@file
|
||||
|
||||
#include "globals.hh"
|
||||
#include "installable-value.hh"
|
||||
#include "outputs-spec.hh"
|
||||
#include "command.hh"
|
||||
#include "attr-path.hh"
|
||||
#include "common-eval-args.hh"
|
||||
#include "derivations.hh"
|
||||
#include "eval-inline.hh"
|
||||
#include "eval.hh"
|
||||
#include "get-drvs.hh"
|
||||
#include "store-api.hh"
|
||||
#include "shared.hh"
|
||||
#include "eval-cache.hh"
|
||||
#include "url.hh"
|
||||
#include "registry.hh"
|
||||
#include "build-result.hh"
|
||||
#include "nix/globals.hh"
|
||||
#include "nix/installable-value.hh"
|
||||
#include "nix/outputs-spec.hh"
|
||||
#include "nix/command.hh"
|
||||
#include "nix/attr-path.hh"
|
||||
#include "nix/common-eval-args.hh"
|
||||
#include "nix/derivations.hh"
|
||||
#include "nix/eval-inline.hh"
|
||||
#include "nix/eval.hh"
|
||||
#include "nix/get-drvs.hh"
|
||||
#include "nix/store-api.hh"
|
||||
#include "nix/shared.hh"
|
||||
#include "nix/eval-cache.hh"
|
||||
#include "nix/url.hh"
|
||||
#include "nix/registry.hh"
|
||||
#include "nix/build-result.hh"
|
||||
|
||||
#include <regex>
|
||||
#include <queue>
|
|
@ -1,7 +1,7 @@
|
|||
#pragma once
|
||||
///@file
|
||||
|
||||
#include "installables.hh"
|
||||
#include "nix/installables.hh"
|
||||
|
||||
namespace nix {
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
#pragma once
|
||||
///@file
|
||||
|
||||
#include "common-eval-args.hh"
|
||||
#include "installable-value.hh"
|
||||
#include "nix/common-eval-args.hh"
|
||||
#include "nix/installable-value.hh"
|
||||
|
||||
namespace nix {
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
#pragma once
|
||||
///@file
|
||||
|
||||
#include "installables.hh"
|
||||
#include "flake/flake.hh"
|
||||
#include "nix/installables.hh"
|
||||
#include "nix/flake/flake.hh"
|
||||
|
||||
namespace nix {
|
||||
|
|
@ -1,12 +1,12 @@
|
|||
#pragma once
|
||||
///@file
|
||||
|
||||
#include "path.hh"
|
||||
#include "outputs-spec.hh"
|
||||
#include "derived-path.hh"
|
||||
#include "built-path.hh"
|
||||
#include "store-api.hh"
|
||||
#include "build-result.hh"
|
||||
#include "nix/path.hh"
|
||||
#include "nix/outputs-spec.hh"
|
||||
#include "nix/derived-path.hh"
|
||||
#include "nix/built-path.hh"
|
||||
#include "nix/store-api.hh"
|
||||
#include "nix/build-result.hh"
|
||||
|
||||
#include <optional>
|
||||
|
23
src/libcmd/include/nix/meson.build
Normal file
23
src/libcmd/include/nix/meson.build
Normal file
|
@ -0,0 +1,23 @@
|
|||
# Public headers directory
|
||||
|
||||
include_dirs = [include_directories('..')]
|
||||
|
||||
headers = files(
|
||||
'built-path.hh',
|
||||
'command-installable-value.hh',
|
||||
'command.hh',
|
||||
'common-eval-args.hh',
|
||||
'compatibility-settings.hh',
|
||||
'editor-for.hh',
|
||||
'installable-attr-path.hh',
|
||||
'installable-derived-path.hh',
|
||||
'installable-flake.hh',
|
||||
'installable-value.hh',
|
||||
'installables.hh',
|
||||
'legacy.hh',
|
||||
'markdown.hh',
|
||||
'misc-store-flags.hh',
|
||||
'network-proxy.hh',
|
||||
'repl-interacter.hh',
|
||||
'repl.hh',
|
||||
)
|
|
@ -1,5 +1,5 @@
|
|||
#include "args.hh"
|
||||
#include "content-address.hh"
|
||||
#include "nix/args.hh"
|
||||
#include "nix/content-address.hh"
|
||||
|
||||
namespace nix::flag {
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
#pragma once
|
||||
///@file
|
||||
|
||||
#include "types.hh"
|
||||
#include "nix/types.hh"
|
||||
|
||||
namespace nix {
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
#pragma once
|
||||
/// @file
|
||||
|
||||
#include "finally.hh"
|
||||
#include "types.hh"
|
||||
#include "nix/finally.hh"
|
||||
#include "nix/types.hh"
|
||||
#include <functional>
|
||||
#include <string>
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
#pragma once
|
||||
///@file
|
||||
|
||||
#include "eval.hh"
|
||||
#include "nix/eval.hh"
|
||||
|
||||
namespace nix {
|
||||
|
|
@ -1,21 +1,21 @@
|
|||
#include "globals.hh"
|
||||
#include "installable-attr-path.hh"
|
||||
#include "outputs-spec.hh"
|
||||
#include "util.hh"
|
||||
#include "command.hh"
|
||||
#include "attr-path.hh"
|
||||
#include "common-eval-args.hh"
|
||||
#include "derivations.hh"
|
||||
#include "eval-inline.hh"
|
||||
#include "eval.hh"
|
||||
#include "get-drvs.hh"
|
||||
#include "store-api.hh"
|
||||
#include "shared.hh"
|
||||
#include "flake/flake.hh"
|
||||
#include "eval-cache.hh"
|
||||
#include "url.hh"
|
||||
#include "registry.hh"
|
||||
#include "build-result.hh"
|
||||
#include "nix/globals.hh"
|
||||
#include "nix/installable-attr-path.hh"
|
||||
#include "nix/outputs-spec.hh"
|
||||
#include "nix/util.hh"
|
||||
#include "nix/command.hh"
|
||||
#include "nix/attr-path.hh"
|
||||
#include "nix/common-eval-args.hh"
|
||||
#include "nix/derivations.hh"
|
||||
#include "nix/eval-inline.hh"
|
||||
#include "nix/eval.hh"
|
||||
#include "nix/get-drvs.hh"
|
||||
#include "nix/store-api.hh"
|
||||
#include "nix/shared.hh"
|
||||
#include "nix/flake/flake.hh"
|
||||
#include "nix/eval-cache.hh"
|
||||
#include "nix/url.hh"
|
||||
#include "nix/registry.hh"
|
||||
#include "nix/build-result.hh"
|
||||
|
||||
#include <regex>
|
||||
#include <queue>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include "installable-derived-path.hh"
|
||||
#include "derivations.hh"
|
||||
#include "nix/installable-derived-path.hh"
|
||||
#include "nix/derivations.hh"
|
||||
|
||||
namespace nix {
|
||||
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
#include "globals.hh"
|
||||
#include "installable-flake.hh"
|
||||
#include "installable-derived-path.hh"
|
||||
#include "outputs-spec.hh"
|
||||
#include "util.hh"
|
||||
#include "command.hh"
|
||||
#include "attr-path.hh"
|
||||
#include "common-eval-args.hh"
|
||||
#include "derivations.hh"
|
||||
#include "eval-inline.hh"
|
||||
#include "eval.hh"
|
||||
#include "get-drvs.hh"
|
||||
#include "store-api.hh"
|
||||
#include "shared.hh"
|
||||
#include "flake/flake.hh"
|
||||
#include "eval-cache.hh"
|
||||
#include "url.hh"
|
||||
#include "registry.hh"
|
||||
#include "build-result.hh"
|
||||
#include "nix/globals.hh"
|
||||
#include "nix/installable-flake.hh"
|
||||
#include "nix/installable-derived-path.hh"
|
||||
#include "nix/outputs-spec.hh"
|
||||
#include "nix/util.hh"
|
||||
#include "nix/command.hh"
|
||||
#include "nix/attr-path.hh"
|
||||
#include "nix/common-eval-args.hh"
|
||||
#include "nix/derivations.hh"
|
||||
#include "nix/eval-inline.hh"
|
||||
#include "nix/eval.hh"
|
||||
#include "nix/get-drvs.hh"
|
||||
#include "nix/store-api.hh"
|
||||
#include "nix/shared.hh"
|
||||
#include "nix/flake/flake.hh"
|
||||
#include "nix/eval-cache.hh"
|
||||
#include "nix/url.hh"
|
||||
#include "nix/registry.hh"
|
||||
#include "nix/build-result.hh"
|
||||
|
||||
#include <regex>
|
||||
#include <queue>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "installable-value.hh"
|
||||
#include "eval-cache.hh"
|
||||
#include "fetch-to-store.hh"
|
||||
#include "nix/installable-value.hh"
|
||||
#include "nix/eval-cache.hh"
|
||||
#include "nix/fetch-to-store.hh"
|
||||
|
||||
namespace nix {
|
||||
|
||||
|
|
|
@ -1,33 +1,33 @@
|
|||
#include "globals.hh"
|
||||
#include "installables.hh"
|
||||
#include "installable-derived-path.hh"
|
||||
#include "installable-attr-path.hh"
|
||||
#include "installable-flake.hh"
|
||||
#include "outputs-spec.hh"
|
||||
#include "users.hh"
|
||||
#include "util.hh"
|
||||
#include "command.hh"
|
||||
#include "attr-path.hh"
|
||||
#include "common-eval-args.hh"
|
||||
#include "derivations.hh"
|
||||
#include "eval-inline.hh"
|
||||
#include "eval.hh"
|
||||
#include "eval-settings.hh"
|
||||
#include "get-drvs.hh"
|
||||
#include "store-api.hh"
|
||||
#include "shared.hh"
|
||||
#include "flake/flake.hh"
|
||||
#include "eval-cache.hh"
|
||||
#include "url.hh"
|
||||
#include "registry.hh"
|
||||
#include "build-result.hh"
|
||||
#include "nix/globals.hh"
|
||||
#include "nix/installables.hh"
|
||||
#include "nix/installable-derived-path.hh"
|
||||
#include "nix/installable-attr-path.hh"
|
||||
#include "nix/installable-flake.hh"
|
||||
#include "nix/outputs-spec.hh"
|
||||
#include "nix/users.hh"
|
||||
#include "nix/util.hh"
|
||||
#include "nix/command.hh"
|
||||
#include "nix/attr-path.hh"
|
||||
#include "nix/common-eval-args.hh"
|
||||
#include "nix/derivations.hh"
|
||||
#include "nix/eval-inline.hh"
|
||||
#include "nix/eval.hh"
|
||||
#include "nix/eval-settings.hh"
|
||||
#include "nix/get-drvs.hh"
|
||||
#include "nix/store-api.hh"
|
||||
#include "nix/shared.hh"
|
||||
#include "nix/flake/flake.hh"
|
||||
#include "nix/eval-cache.hh"
|
||||
#include "nix/url.hh"
|
||||
#include "nix/registry.hh"
|
||||
#include "nix/build-result.hh"
|
||||
|
||||
#include <regex>
|
||||
#include <queue>
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
#include "strings-inline.hh"
|
||||
#include "nix/strings-inline.hh"
|
||||
|
||||
namespace nix {
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "legacy.hh"
|
||||
#include "nix/legacy.hh"
|
||||
|
||||
namespace nix {
|
||||
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
#include "markdown.hh"
|
||||
#include "environment-variables.hh"
|
||||
#include "error.hh"
|
||||
#include "finally.hh"
|
||||
#include "terminal.hh"
|
||||
#include "nix/markdown.hh"
|
||||
#include "nix/environment-variables.hh"
|
||||
#include "nix/error.hh"
|
||||
#include "nix/finally.hh"
|
||||
#include "nix/terminal.hh"
|
||||
|
||||
#include "cmd-config-private.hh"
|
||||
|
||||
#if HAVE_LOWDOWN
|
||||
# include <sys/queue.h>
|
||||
|
|
|
@ -44,28 +44,18 @@ if readline_flavor == 'editline'
|
|||
elif readline_flavor == 'readline'
|
||||
readline = dependency('readline')
|
||||
deps_private += readline
|
||||
configdata.set(
|
||||
'USE_READLINE',
|
||||
1,
|
||||
description: 'Use readline instead of editline',
|
||||
)
|
||||
else
|
||||
error('illegal editline flavor', readline_flavor)
|
||||
endif
|
||||
|
||||
config_h = configure_file(
|
||||
configuration : configdata,
|
||||
output : 'config-cmd.hh',
|
||||
configdata.set(
|
||||
'USE_READLINE',
|
||||
(readline_flavor == 'readline').to_int(),
|
||||
description: 'Use readline instead of editline',
|
||||
)
|
||||
|
||||
add_project_arguments(
|
||||
# TODO(Qyriad): Yes this is how the autoconf+Make system did it.
|
||||
# It would be nice for our headers to be idempotent instead.
|
||||
'-include', 'config-util.hh',
|
||||
'-include', 'config-store.hh',
|
||||
'-include', 'config-expr.hh',
|
||||
'-include', 'config-cmd.hh',
|
||||
language : 'cpp',
|
||||
config_priv_h = configure_file(
|
||||
configuration : configdata,
|
||||
output : 'cmd-config-private.hh',
|
||||
)
|
||||
|
||||
subdir('nix-meson-build-support/common')
|
||||
|
@ -89,27 +79,7 @@ sources = files(
|
|||
'repl.cc',
|
||||
)
|
||||
|
||||
include_dirs = [include_directories('.')]
|
||||
|
||||
headers = files(
|
||||
'built-path.hh',
|
||||
'command-installable-value.hh',
|
||||
'command.hh',
|
||||
'common-eval-args.hh',
|
||||
'compatibility-settings.hh',
|
||||
'editor-for.hh',
|
||||
'installable-attr-path.hh',
|
||||
'installable-derived-path.hh',
|
||||
'installable-flake.hh',
|
||||
'installable-value.hh',
|
||||
'installables.hh',
|
||||
'legacy.hh',
|
||||
'markdown.hh',
|
||||
'misc-store-flags.hh',
|
||||
'network-proxy.hh',
|
||||
'repl-interacter.hh',
|
||||
'repl.hh',
|
||||
)
|
||||
subdir('include/nix')
|
||||
|
||||
subdir('nix-meson-build-support/export-all-symbols')
|
||||
subdir('nix-meson-build-support/windows-version')
|
||||
|
@ -117,7 +87,7 @@ subdir('nix-meson-build-support/windows-version')
|
|||
this_library = library(
|
||||
'nixcmd',
|
||||
sources,
|
||||
config_h,
|
||||
config_priv_h,
|
||||
dependencies : deps_public + deps_private + deps_other,
|
||||
include_directories : include_dirs,
|
||||
link_args: linker_export_flags,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "misc-store-flags.hh"
|
||||
#include "nix/misc-store-flags.hh"
|
||||
|
||||
namespace nix::flag
|
||||
{
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#include "network-proxy.hh"
|
||||
#include "nix/network-proxy.hh"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include "environment-variables.hh"
|
||||
#include "nix/environment-variables.hh"
|
||||
|
||||
namespace nix {
|
||||
|
||||
|
|
|
@ -46,6 +46,7 @@ mkMesonLibrary (finalAttrs: {
|
|||
./.version
|
||||
./meson.build
|
||||
./meson.options
|
||||
./include/nix/meson.build
|
||||
(fileset.fileFilter (file: file.hasExt "cc") ./.)
|
||||
(fileset.fileFilter (file: file.hasExt "hh") ./.)
|
||||
];
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#include "cmd-config-private.hh"
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
#ifdef USE_READLINE
|
||||
#if USE_READLINE
|
||||
#include <readline/history.h>
|
||||
#include <readline/readline.h>
|
||||
#else
|
||||
|
@ -14,12 +16,12 @@ extern "C" {
|
|||
}
|
||||
#endif
|
||||
|
||||
#include "signals.hh"
|
||||
#include "finally.hh"
|
||||
#include "repl-interacter.hh"
|
||||
#include "file-system.hh"
|
||||
#include "repl.hh"
|
||||
#include "environment-variables.hh"
|
||||
#include "nix/signals.hh"
|
||||
#include "nix/finally.hh"
|
||||
#include "nix/repl-interacter.hh"
|
||||
#include "nix/file-system.hh"
|
||||
#include "nix/repl.hh"
|
||||
#include "nix/environment-variables.hh"
|
||||
|
||||
namespace nix {
|
||||
|
||||
|
@ -35,7 +37,7 @@ void sigintHandler(int signo)
|
|||
|
||||
static detail::ReplCompleterMixin * curRepl; // ugly
|
||||
|
||||
#ifndef USE_READLINE
|
||||
#if !USE_READLINE
|
||||
static char * completionCallback(char * s, int * match)
|
||||
{
|
||||
auto possible = curRepl->completePrefix(s);
|
||||
|
@ -113,14 +115,14 @@ ReadlineLikeInteracter::Guard ReadlineLikeInteracter::init(detail::ReplCompleter
|
|||
} catch (SystemError & e) {
|
||||
logWarning(e.info());
|
||||
}
|
||||
#ifndef USE_READLINE
|
||||
#if !USE_READLINE
|
||||
el_hist_size = 1000;
|
||||
#endif
|
||||
read_history(historyFile.c_str());
|
||||
auto oldRepl = curRepl;
|
||||
curRepl = repl;
|
||||
Guard restoreRepl([oldRepl] { curRepl = oldRepl; });
|
||||
#ifndef USE_READLINE
|
||||
#if !USE_READLINE
|
||||
rl_set_complete_func(completionCallback);
|
||||
rl_set_list_possib_func(listPossibleCallback);
|
||||
#endif
|
||||
|
@ -183,7 +185,7 @@ bool ReadlineLikeInteracter::getLine(std::string & input, ReplPromptType promptT
|
|||
// quite useful for reading the test output, so we add it here.
|
||||
if (auto e = getEnv("_NIX_TEST_REPL_ECHO"); s && e && *e == "1")
|
||||
{
|
||||
#ifndef USE_READLINE
|
||||
#if !USE_READLINE
|
||||
// This is probably not right for multi-line input, but we don't use that
|
||||
// in the characterisation tests, so it's fine.
|
||||
std::cout << promptForType(promptType) << s << std::endl;
|
||||
|
|
|
@ -2,34 +2,34 @@
|
|||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
|
||||
#include "error.hh"
|
||||
#include "repl-interacter.hh"
|
||||
#include "repl.hh"
|
||||
#include "nix/error.hh"
|
||||
#include "nix/repl-interacter.hh"
|
||||
#include "nix/repl.hh"
|
||||
|
||||
#include "ansicolor.hh"
|
||||
#include "shared.hh"
|
||||
#include "eval.hh"
|
||||
#include "eval-settings.hh"
|
||||
#include "attr-path.hh"
|
||||
#include "signals.hh"
|
||||
#include "store-api.hh"
|
||||
#include "log-store.hh"
|
||||
#include "common-eval-args.hh"
|
||||
#include "get-drvs.hh"
|
||||
#include "derivations.hh"
|
||||
#include "globals.hh"
|
||||
#include "flake/flake.hh"
|
||||
#include "flake/lockfile.hh"
|
||||
#include "users.hh"
|
||||
#include "editor-for.hh"
|
||||
#include "finally.hh"
|
||||
#include "markdown.hh"
|
||||
#include "local-fs-store.hh"
|
||||
#include "print.hh"
|
||||
#include "ref.hh"
|
||||
#include "value.hh"
|
||||
#include "nix/ansicolor.hh"
|
||||
#include "nix/shared.hh"
|
||||
#include "nix/eval.hh"
|
||||
#include "nix/eval-settings.hh"
|
||||
#include "nix/attr-path.hh"
|
||||
#include "nix/signals.hh"
|
||||
#include "nix/store-api.hh"
|
||||
#include "nix/log-store.hh"
|
||||
#include "nix/common-eval-args.hh"
|
||||
#include "nix/get-drvs.hh"
|
||||
#include "nix/derivations.hh"
|
||||
#include "nix/globals.hh"
|
||||
#include "nix/flake/flake.hh"
|
||||
#include "nix/flake/lockfile.hh"
|
||||
#include "nix/users.hh"
|
||||
#include "nix/editor-for.hh"
|
||||
#include "nix/finally.hh"
|
||||
#include "nix/markdown.hh"
|
||||
#include "nix/local-fs-store.hh"
|
||||
#include "nix/print.hh"
|
||||
#include "nix/ref.hh"
|
||||
#include "nix/value.hh"
|
||||
|
||||
#include "strings.hh"
|
||||
#include "nix/strings.hh"
|
||||
|
||||
namespace nix {
|
||||
|
||||
|
|
|
@ -25,18 +25,6 @@ deps_public_maybe_subproject = [
|
|||
]
|
||||
subdir('nix-meson-build-support/subprojects')
|
||||
|
||||
add_project_arguments(
|
||||
# TODO(Qyriad): Yes this is how the autoconf+Make system did it.
|
||||
# It would be nice for our headers to be idempotent instead.
|
||||
|
||||
# From C++ libraries, only for internals
|
||||
'-include', 'config-util.hh',
|
||||
'-include', 'config-store.hh',
|
||||
'-include', 'config-expr.hh',
|
||||
|
||||
language : 'cpp',
|
||||
)
|
||||
|
||||
subdir('nix-meson-build-support/common')
|
||||
|
||||
sources = files(
|
||||
|
@ -69,7 +57,7 @@ this_library = library(
|
|||
install : true,
|
||||
)
|
||||
|
||||
install_headers(headers, subdir : 'nix', preserve_path : true)
|
||||
install_headers(headers, preserve_path : true)
|
||||
|
||||
libraries_private = []
|
||||
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
#include <stdexcept>
|
||||
#include <string>
|
||||
|
||||
#include "eval.hh"
|
||||
#include "eval-gc.hh"
|
||||
#include "globals.hh"
|
||||
#include "eval-settings.hh"
|
||||
#include "ref.hh"
|
||||
#include "nix/eval.hh"
|
||||
#include "nix/eval-gc.hh"
|
||||
#include "nix/globals.hh"
|
||||
#include "nix/eval-settings.hh"
|
||||
#include "nix/ref.hh"
|
||||
|
||||
#include "nix_api_expr.h"
|
||||
#include "nix_api_expr_internal.h"
|
||||
|
@ -15,7 +15,7 @@
|
|||
#include "nix_api_util.h"
|
||||
#include "nix_api_util_internal.h"
|
||||
|
||||
#if HAVE_BOEHMGC
|
||||
#if NIX_USE_BOEHMGC
|
||||
# include <mutex>
|
||||
#endif
|
||||
|
||||
|
@ -209,7 +209,7 @@ void nix_state_free(EvalState * state)
|
|||
delete state;
|
||||
}
|
||||
|
||||
#if HAVE_BOEHMGC
|
||||
#if NIX_USE_BOEHMGC
|
||||
std::unordered_map<
|
||||
const void *,
|
||||
unsigned int,
|
||||
|
@ -285,7 +285,7 @@ nix_err nix_value_decref(nix_c_context * context, nix_value *x)
|
|||
|
||||
void nix_gc_register_finalizer(void * obj, void * cd, void (*finalizer)(void * obj, void * cd))
|
||||
{
|
||||
#if HAVE_BOEHMGC
|
||||
#if NIX_USE_BOEHMGC
|
||||
GC_REGISTER_FINALIZER(obj, finalizer, cd, 0, 0);
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
#ifndef NIX_API_EXPR_INTERNAL_H
|
||||
#define NIX_API_EXPR_INTERNAL_H
|
||||
|
||||
#include "fetch-settings.hh"
|
||||
#include "eval.hh"
|
||||
#include "eval-settings.hh"
|
||||
#include "attr-set.hh"
|
||||
#include "nix/fetch-settings.hh"
|
||||
#include "nix/eval.hh"
|
||||
#include "nix/eval-settings.hh"
|
||||
#include "nix/attr-set.hh"
|
||||
#include "nix_api_value.h"
|
||||
#include "search-path.hh"
|
||||
#include "nix/search-path.hh"
|
||||
|
||||
struct nix_eval_state_builder
|
||||
{
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#include "attr-set.hh"
|
||||
#include "config.hh"
|
||||
#include "eval.hh"
|
||||
#include "globals.hh"
|
||||
#include "value.hh"
|
||||
#include "nix/attr-set.hh"
|
||||
#include "nix/config.hh"
|
||||
#include "nix/eval.hh"
|
||||
#include "nix/globals.hh"
|
||||
#include "nix/value.hh"
|
||||
|
||||
#include "nix_api_expr.h"
|
||||
#include "nix_api_expr_internal.h"
|
||||
|
@ -10,7 +10,7 @@
|
|||
#include "nix_api_util.h"
|
||||
#include "nix_api_util_internal.h"
|
||||
#include "nix_api_value.h"
|
||||
#include "value/context.hh"
|
||||
#include "nix/value/context.hh"
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
|
@ -168,7 +168,7 @@ ExternalValue * nix_create_external_value(nix_c_context * context, NixCExternalV
|
|||
context->last_err_code = NIX_OK;
|
||||
try {
|
||||
auto ret = new
|
||||
#if HAVE_BOEHMGC
|
||||
#if NIX_USE_BOEHMGC
|
||||
(GC)
|
||||
#endif
|
||||
NixCExternalValue(*desc, v);
|
||||
|
|
|
@ -12,9 +12,10 @@
|
|||
#include "nix_api_expr.h"
|
||||
#include "nix_api_util.h"
|
||||
#include "nix_api_value.h"
|
||||
#include "stdbool.h"
|
||||
#include "stddef.h"
|
||||
#include "stdint.h"
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
#include "attr-set.hh"
|
||||
#include "config.hh"
|
||||
#include "eval.hh"
|
||||
#include "globals.hh"
|
||||
#include "path.hh"
|
||||
#include "primops.hh"
|
||||
#include "value.hh"
|
||||
#include "nix/attr-set.hh"
|
||||
#include "nix/config.hh"
|
||||
#include "nix/eval.hh"
|
||||
#include "nix/globals.hh"
|
||||
#include "nix/path.hh"
|
||||
#include "nix/primops.hh"
|
||||
#include "nix/value.hh"
|
||||
|
||||
#include "nix_api_expr.h"
|
||||
#include "nix_api_expr_internal.h"
|
||||
|
@ -12,7 +12,7 @@
|
|||
#include "nix_api_util_internal.h"
|
||||
#include "nix_api_store_internal.h"
|
||||
#include "nix_api_value.h"
|
||||
#include "value/context.hh"
|
||||
#include "nix/value/context.hh"
|
||||
|
||||
// Internal helper functions to check [in] and [out] `Value *` parameters
|
||||
static const nix::Value & check_value_not_null(const nix_value * value)
|
||||
|
@ -125,7 +125,7 @@ PrimOp * nix_alloc_primop(
|
|||
try {
|
||||
using namespace std::placeholders;
|
||||
auto p = new
|
||||
#if HAVE_BOEHMGC
|
||||
#if NIX_USE_BOEHMGC
|
||||
(GC)
|
||||
#endif
|
||||
nix::PrimOp{
|
||||
|
@ -497,7 +497,7 @@ ListBuilder * nix_make_list_builder(nix_c_context * context, EvalState * state,
|
|||
try {
|
||||
auto builder = state->state.buildList(capacity);
|
||||
return new
|
||||
#if HAVE_BOEHMGC
|
||||
#if NIX_USE_BOEHMGC
|
||||
(NoGC)
|
||||
#endif
|
||||
ListBuilder{std::move(builder)};
|
||||
|
@ -519,7 +519,7 @@ nix_list_builder_insert(nix_c_context * context, ListBuilder * list_builder, uns
|
|||
|
||||
void nix_list_builder_free(ListBuilder * list_builder)
|
||||
{
|
||||
#if HAVE_BOEHMGC
|
||||
#if NIX_USE_BOEHMGC
|
||||
GC_FREE(list_builder);
|
||||
#else
|
||||
delete list_builder;
|
||||
|
@ -578,7 +578,7 @@ BindingsBuilder * nix_make_bindings_builder(nix_c_context * context, EvalState *
|
|||
try {
|
||||
auto bb = state->state.buildBindings(capacity);
|
||||
return new
|
||||
#if HAVE_BOEHMGC
|
||||
#if NIX_USE_BOEHMGC
|
||||
(NoGC)
|
||||
#endif
|
||||
BindingsBuilder{std::move(bb)};
|
||||
|
@ -600,7 +600,7 @@ nix_err nix_bindings_builder_insert(nix_c_context * context, BindingsBuilder * b
|
|||
|
||||
void nix_bindings_builder_free(BindingsBuilder * bb)
|
||||
{
|
||||
#if HAVE_BOEHMGC
|
||||
#if NIX_USE_BOEHMGC
|
||||
GC_FREE((nix::BindingsBuilder *) bb);
|
||||
#else
|
||||
delete (nix::BindingsBuilder *) bb;
|
||||
|
|
|
@ -10,9 +10,10 @@
|
|||
|
||||
#include "nix_api_util.h"
|
||||
#include "nix_api_store.h"
|
||||
#include "stdbool.h"
|
||||
#include "stddef.h"
|
||||
#include "stdint.h"
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
9
src/libexpr-test-support/include/nix/meson.build
Normal file
9
src/libexpr-test-support/include/nix/meson.build
Normal file
|
@ -0,0 +1,9 @@
|
|||
# Public headers directory
|
||||
|
||||
include_dirs = [include_directories('..')]
|
||||
|
||||
headers = files(
|
||||
'tests/libexpr.hh',
|
||||
'tests/nix_api_expr.hh',
|
||||
'tests/value/context.hh',
|
||||
)
|
|
@ -4,16 +4,16 @@
|
|||
#include <gtest/gtest.h>
|
||||
#include <gmock/gmock.h>
|
||||
|
||||
#include "fetch-settings.hh"
|
||||
#include "value.hh"
|
||||
#include "nixexpr.hh"
|
||||
#include "nixexpr.hh"
|
||||
#include "eval.hh"
|
||||
#include "eval-gc.hh"
|
||||
#include "eval-inline.hh"
|
||||
#include "eval-settings.hh"
|
||||
#include "nix/fetch-settings.hh"
|
||||
#include "nix/value.hh"
|
||||
#include "nix/nixexpr.hh"
|
||||
#include "nix/nixexpr.hh"
|
||||
#include "nix/eval.hh"
|
||||
#include "nix/eval-gc.hh"
|
||||
#include "nix/eval-inline.hh"
|
||||
#include "nix/eval-settings.hh"
|
||||
|
||||
#include "tests/libstore.hh"
|
||||
#include "nix/tests/libstore.hh"
|
||||
|
||||
namespace nix {
|
||||
class LibExprTest : public LibStoreTest {
|
|
@ -2,7 +2,7 @@
|
|||
///@file
|
||||
#include "nix_api_expr.h"
|
||||
#include "nix_api_value.h"
|
||||
#include "tests/nix_api_store.hh"
|
||||
#include "nix/tests/nix_api_store.hh"
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
#include <rapidcheck/gen/Arbitrary.h>
|
||||
|
||||
#include "value/context.hh"
|
||||
#include "nix/value/context.hh"
|
||||
|
||||
namespace rc {
|
||||
using namespace nix;
|
|
@ -29,28 +29,13 @@ subdir('nix-meson-build-support/subprojects')
|
|||
rapidcheck = dependency('rapidcheck')
|
||||
deps_public += rapidcheck
|
||||
|
||||
add_project_arguments(
|
||||
# TODO(Qyriad): Yes this is how the autoconf+Make system did it.
|
||||
# It would be nice for our headers to be idempotent instead.
|
||||
'-include', 'config-util.hh',
|
||||
'-include', 'config-store.hh',
|
||||
'-include', 'config-expr.hh',
|
||||
language : 'cpp',
|
||||
)
|
||||
|
||||
subdir('nix-meson-build-support/common')
|
||||
|
||||
sources = files(
|
||||
'tests/value/context.cc',
|
||||
)
|
||||
|
||||
include_dirs = [include_directories('.')]
|
||||
|
||||
headers = files(
|
||||
'tests/libexpr.hh',
|
||||
'tests/nix_api_expr.hh',
|
||||
'tests/value/context.hh',
|
||||
)
|
||||
subdir('include/nix')
|
||||
|
||||
subdir('nix-meson-build-support/export-all-symbols')
|
||||
subdir('nix-meson-build-support/windows-version')
|
||||
|
|
|
@ -29,6 +29,7 @@ mkMesonLibrary (finalAttrs: {
|
|||
./.version
|
||||
./meson.build
|
||||
# ./meson.options
|
||||
./include/nix/meson.build
|
||||
(fileset.fileFilter (file: file.hasExt "cc") ./.)
|
||||
(fileset.fileFilter (file: file.hasExt "hh") ./.)
|
||||
];
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#include <rapidcheck.h>
|
||||
|
||||
#include "tests/path.hh"
|
||||
#include "tests/value/context.hh"
|
||||
#include "nix/tests/path.hh"
|
||||
#include "nix/tests/value/context.hh"
|
||||
|
||||
namespace rc {
|
||||
using namespace nix;
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
#include <gtest/gtest.h>
|
||||
#include <rapidcheck/gtest.h>
|
||||
|
||||
#include "tests/derived-path.hh"
|
||||
#include "tests/libexpr.hh"
|
||||
#include "nix/tests/derived-path.hh"
|
||||
#include "nix/tests/libexpr.hh"
|
||||
|
||||
namespace nix {
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#include <gmock/gmock.h>
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include "tests/libexpr.hh"
|
||||
#include "nix/tests/libexpr.hh"
|
||||
|
||||
namespace nix {
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#include <gmock/gmock.h>
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include "eval.hh"
|
||||
#include "tests/libexpr.hh"
|
||||
#include "nix/eval.hh"
|
||||
#include "nix/tests/libexpr.hh"
|
||||
|
||||
namespace nix {
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include "tests/libexpr.hh"
|
||||
#include "value-to-json.hh"
|
||||
#include "nix/tests/libexpr.hh"
|
||||
#include "nix/value-to-json.hh"
|
||||
|
||||
namespace nix {
|
||||
// Testing the conversion to JSON
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#include <gtest/gtest.h>
|
||||
#include <cstdlib>
|
||||
#include "globals.hh"
|
||||
#include "logging.hh"
|
||||
#include "nix/globals.hh"
|
||||
#include "nix/logging.hh"
|
||||
|
||||
using namespace nix;
|
||||
|
||||
|
|
|
@ -35,13 +35,12 @@ deps_private += gtest
|
|||
gtest = dependency('gmock')
|
||||
deps_private += gtest
|
||||
|
||||
add_project_arguments(
|
||||
# TODO(Qyriad): Yes this is how the autoconf+Make system did it.
|
||||
# It would be nice for our headers to be idempotent instead.
|
||||
'-include', 'config-util.hh',
|
||||
'-include', 'config-store.hh',
|
||||
'-include', 'config-expr.hh',
|
||||
language : 'cpp',
|
||||
configdata = configuration_data()
|
||||
configdata.set_quoted('PACKAGE_VERSION', meson.project_version())
|
||||
|
||||
config_priv_h = configure_file(
|
||||
configuration : configdata,
|
||||
output : 'expr-tests-config.hh',
|
||||
)
|
||||
|
||||
subdir('nix-meson-build-support/common')
|
||||
|
@ -69,6 +68,7 @@ include_dirs = [include_directories('.')]
|
|||
this_exe = executable(
|
||||
meson.project_name(),
|
||||
sources,
|
||||
config_priv_h,
|
||||
dependencies : deps_private_subproject + deps_private + deps_other,
|
||||
include_directories : include_dirs,
|
||||
# TODO: -lrapidcheck, see ../libutil-support/build.meson
|
||||
|
|
|
@ -5,13 +5,15 @@
|
|||
#include "nix_api_expr.h"
|
||||
#include "nix_api_value.h"
|
||||
|
||||
#include "tests/nix_api_expr.hh"
|
||||
#include "tests/string_callback.hh"
|
||||
#include "file-system.hh"
|
||||
#include "nix/tests/nix_api_expr.hh"
|
||||
#include "nix/tests/string_callback.hh"
|
||||
#include "nix/file-system.hh"
|
||||
|
||||
#include <gmock/gmock.h>
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include "expr-tests-config.hh"
|
||||
|
||||
namespace nixC {
|
||||
|
||||
TEST_F(nix_api_store_test, nix_eval_state_lookup_path)
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
#include "nix_api_value.h"
|
||||
#include "nix_api_external.h"
|
||||
|
||||
#include "tests/nix_api_expr.hh"
|
||||
#include "tests/string_callback.hh"
|
||||
#include "nix/tests/nix_api_expr.hh"
|
||||
#include "nix/tests/string_callback.hh"
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
|
|
|
@ -6,10 +6,10 @@
|
|||
#include "nix_api_value.h"
|
||||
#include "nix_api_expr_internal.h"
|
||||
|
||||
#include "tests/nix_api_expr.hh"
|
||||
#include "tests/string_callback.hh"
|
||||
#include "nix/tests/nix_api_expr.hh"
|
||||
#include "nix/tests/string_callback.hh"
|
||||
|
||||
#include "gmock/gmock.h"
|
||||
#include <gmock/gmock.h>
|
||||
#include <cstddef>
|
||||
#include <cstdlib>
|
||||
#include <gtest/gtest.h>
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
#include <gmock/gmock.h>
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include "eval-settings.hh"
|
||||
#include "memory-source-accessor.hh"
|
||||
#include "nix/eval-settings.hh"
|
||||
#include "nix/memory-source-accessor.hh"
|
||||
|
||||
#include "tests/libexpr.hh"
|
||||
#include "nix/tests/libexpr.hh"
|
||||
|
||||
namespace nix {
|
||||
class CaptureLogger : public Logger
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#include <gtest/gtest.h>
|
||||
#include <gmock/gmock.h>
|
||||
|
||||
#include "search-path.hh"
|
||||
#include "nix/search-path.hh"
|
||||
|
||||
namespace nix {
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "tests/libexpr.hh"
|
||||
#include "nix/tests/libexpr.hh"
|
||||
|
||||
namespace nix {
|
||||
// Testing of trivial expressions
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
#include <gtest/gtest.h>
|
||||
#include <rapidcheck/gtest.h>
|
||||
|
||||
#include "tests/path.hh"
|
||||
#include "tests/libexpr.hh"
|
||||
#include "tests/value/context.hh"
|
||||
#include "nix/tests/path.hh"
|
||||
#include "nix/tests/libexpr.hh"
|
||||
#include "nix/tests/value/context.hh"
|
||||
|
||||
namespace nix {
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#include "tests/libexpr.hh"
|
||||
#include "nix/tests/libexpr.hh"
|
||||
|
||||
#include "value.hh"
|
||||
#include "print.hh"
|
||||
#include "nix/value.hh"
|
||||
#include "nix/print.hh"
|
||||
|
||||
namespace nix {
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "value.hh"
|
||||
#include "nix/value.hh"
|
||||
|
||||
#include "tests/libstore.hh"
|
||||
#include "nix/tests/libstore.hh"
|
||||
|
||||
namespace nix {
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include "attr-path.hh"
|
||||
#include "eval-inline.hh"
|
||||
#include "nix/attr-path.hh"
|
||||
#include "nix/eval-inline.hh"
|
||||
|
||||
|
||||
namespace nix {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include "attr-set.hh"
|
||||
#include "eval-inline.hh"
|
||||
#include "nix/attr-set.hh"
|
||||
#include "nix/eval-inline.hh"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
#include "users.hh"
|
||||
#include "eval-cache.hh"
|
||||
#include "sqlite.hh"
|
||||
#include "eval.hh"
|
||||
#include "eval-inline.hh"
|
||||
#include "store-api.hh"
|
||||
#include "nix/users.hh"
|
||||
#include "nix/eval-cache.hh"
|
||||
#include "nix/sqlite.hh"
|
||||
#include "nix/eval.hh"
|
||||
#include "nix/eval-inline.hh"
|
||||
#include "nix/store-api.hh"
|
||||
// Need specialization involving `SymbolStr` just in this one module.
|
||||
#include "strings-inline.hh"
|
||||
#include "nix/strings-inline.hh"
|
||||
|
||||
namespace nix::eval_cache {
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "eval-error.hh"
|
||||
#include "eval.hh"
|
||||
#include "value.hh"
|
||||
#include "nix/eval-error.hh"
|
||||
#include "nix/eval.hh"
|
||||
#include "nix/value.hh"
|
||||
|
||||
namespace nix {
|
||||
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
#include "error.hh"
|
||||
#include "environment-variables.hh"
|
||||
#include "eval-settings.hh"
|
||||
#include "config-global.hh"
|
||||
#include "serialise.hh"
|
||||
#include "eval-gc.hh"
|
||||
#include "nix/error.hh"
|
||||
#include "nix/environment-variables.hh"
|
||||
#include "nix/eval-settings.hh"
|
||||
#include "nix/config-global.hh"
|
||||
#include "nix/serialise.hh"
|
||||
#include "nix/eval-gc.hh"
|
||||
|
||||
#if HAVE_BOEHMGC
|
||||
#include "expr-config-private.hh"
|
||||
|
||||
#if NIX_USE_BOEHMGC
|
||||
|
||||
# include <pthread.h>
|
||||
# if __FreeBSD__
|
||||
|
@ -24,7 +26,7 @@
|
|||
|
||||
namespace nix {
|
||||
|
||||
#if HAVE_BOEHMGC
|
||||
#if NIX_USE_BOEHMGC
|
||||
/* Called when the Boehm GC runs out of memory. */
|
||||
static void * oomHandler(size_t requested)
|
||||
{
|
||||
|
@ -94,7 +96,7 @@ void initGC()
|
|||
if (gcInitialised)
|
||||
return;
|
||||
|
||||
#if HAVE_BOEHMGC
|
||||
#if NIX_USE_BOEHMGC
|
||||
initGCReal();
|
||||
|
||||
gcCyclesAfterInit = GC_get_gc_no();
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#include "users.hh"
|
||||
#include "globals.hh"
|
||||
#include "profiles.hh"
|
||||
#include "eval.hh"
|
||||
#include "eval-settings.hh"
|
||||
#include "nix/users.hh"
|
||||
#include "nix/globals.hh"
|
||||
#include "nix/profiles.hh"
|
||||
#include "nix/eval.hh"
|
||||
#include "nix/eval-settings.hh"
|
||||
|
||||
namespace nix {
|
||||
|
||||
|
|
|
@ -1,24 +1,25 @@
|
|||
#include "eval.hh"
|
||||
#include "eval-settings.hh"
|
||||
#include "primops.hh"
|
||||
#include "print-options.hh"
|
||||
#include "exit.hh"
|
||||
#include "types.hh"
|
||||
#include "util.hh"
|
||||
#include "store-api.hh"
|
||||
#include "derivations.hh"
|
||||
#include "downstream-placeholder.hh"
|
||||
#include "eval-inline.hh"
|
||||
#include "filetransfer.hh"
|
||||
#include "function-trace.hh"
|
||||
#include "profiles.hh"
|
||||
#include "print.hh"
|
||||
#include "filtering-source-accessor.hh"
|
||||
#include "memory-source-accessor.hh"
|
||||
#include "gc-small-vector.hh"
|
||||
#include "url.hh"
|
||||
#include "fetch-to-store.hh"
|
||||
#include "tarball.hh"
|
||||
#include "nix/eval.hh"
|
||||
#include "nix/eval-settings.hh"
|
||||
#include "nix/primops.hh"
|
||||
#include "nix/print-options.hh"
|
||||
#include "nix/exit.hh"
|
||||
#include "nix/types.hh"
|
||||
#include "nix/util.hh"
|
||||
#include "nix/store-api.hh"
|
||||
#include "nix/derivations.hh"
|
||||
#include "nix/downstream-placeholder.hh"
|
||||
#include "nix/eval-inline.hh"
|
||||
#include "nix/filetransfer.hh"
|
||||
#include "nix/function-trace.hh"
|
||||
#include "nix/profiles.hh"
|
||||
#include "nix/print.hh"
|
||||
#include "nix/filtering-source-accessor.hh"
|
||||
#include "nix/memory-source-accessor.hh"
|
||||
#include "nix/gc-small-vector.hh"
|
||||
#include "nix/url.hh"
|
||||
#include "nix/fetch-to-store.hh"
|
||||
#include "nix/tarball.hh"
|
||||
|
||||
#include "parser-tab.hh"
|
||||
|
||||
#include <algorithm>
|
||||
|
@ -38,7 +39,7 @@
|
|||
# include <sys/resource.h>
|
||||
#endif
|
||||
|
||||
#include "strings-inline.hh"
|
||||
#include "nix/strings-inline.hh"
|
||||
|
||||
using json = nlohmann::json;
|
||||
|
||||
|
@ -294,7 +295,7 @@ EvalState::EvalState(
|
|||
, debugStop(false)
|
||||
, trylevel(0)
|
||||
, regexCache(makeRegexCache())
|
||||
#if HAVE_BOEHMGC
|
||||
#if NIX_USE_BOEHMGC
|
||||
, valueAllocCache(std::allocate_shared<void *>(traceable_allocator<void *>(), nullptr))
|
||||
, env1AllocCache(std::allocate_shared<void *>(traceable_allocator<void *>(), nullptr))
|
||||
, baseEnvP(std::allocate_shared<Env *>(traceable_allocator<Env *>(), &allocEnv(BASE_ENV_SIZE)))
|
||||
|
@ -2811,7 +2812,7 @@ bool EvalState::eqValues(Value & v1, Value & v2, const PosIdx pos, std::string_v
|
|||
}
|
||||
|
||||
bool EvalState::fullGC() {
|
||||
#if HAVE_BOEHMGC
|
||||
#if NIX_USE_BOEHMGC
|
||||
GC_gcollect();
|
||||
// Check that it ran. We might replace this with a version that uses more
|
||||
// of the boehm API to get this reliably, at a maintenance cost.
|
||||
|
@ -2830,7 +2831,7 @@ void EvalState::maybePrintStats()
|
|||
|
||||
if (showStats) {
|
||||
// Make the final heap size more deterministic.
|
||||
#if HAVE_BOEHMGC
|
||||
#if NIX_USE_BOEHMGC
|
||||
if (!fullGC()) {
|
||||
warn("failed to perform a full GC before reporting stats");
|
||||
}
|
||||
|
@ -2852,7 +2853,7 @@ void EvalState::printStatistics()
|
|||
uint64_t bValues = nrValues * sizeof(Value);
|
||||
uint64_t bAttrsets = nrAttrsets * sizeof(Bindings) + nrAttrsInAttrsets * sizeof(Attr);
|
||||
|
||||
#if HAVE_BOEHMGC
|
||||
#if NIX_USE_BOEHMGC
|
||||
GC_word heapSize, totalBytes;
|
||||
GC_get_heap_usage_safe(&heapSize, 0, 0, 0, &totalBytes);
|
||||
double gcFullOnlyTime = ({
|
||||
|
@ -2874,7 +2875,7 @@ void EvalState::printStatistics()
|
|||
#ifndef _WIN32 // TODO implement
|
||||
{"cpu", cpuTime},
|
||||
#endif
|
||||
#if HAVE_BOEHMGC
|
||||
#if NIX_USE_BOEHMGC
|
||||
{GC_is_incremental_mode() ? "gcNonIncremental" : "gc", gcFullOnlyTime},
|
||||
#ifndef _WIN32 // TODO implement
|
||||
{GC_is_incremental_mode() ? "gcNonIncrementalFraction" : "gcFraction", gcFullOnlyTime / cpuTime},
|
||||
|
@ -2918,7 +2919,7 @@ void EvalState::printStatistics()
|
|||
topObj["nrLookups"] = nrLookups;
|
||||
topObj["nrPrimOpCalls"] = nrPrimOpCalls;
|
||||
topObj["nrFunctionCalls"] = nrFunctionCalls;
|
||||
#if HAVE_BOEHMGC
|
||||
#if NIX_USE_BOEHMGC
|
||||
topObj["gc"] = {
|
||||
{"heapSize", heapSize},
|
||||
{"totalBytes", totalBytes},
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include "function-trace.hh"
|
||||
#include "logging.hh"
|
||||
#include "nix/function-trace.hh"
|
||||
#include "nix/logging.hh"
|
||||
|
||||
namespace nix {
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#include "get-drvs.hh"
|
||||
#include "eval-inline.hh"
|
||||
#include "derivations.hh"
|
||||
#include "store-api.hh"
|
||||
#include "path-with-outputs.hh"
|
||||
#include "nix/get-drvs.hh"
|
||||
#include "nix/eval-inline.hh"
|
||||
#include "nix/derivations.hh"
|
||||
#include "nix/store-api.hh"
|
||||
#include "nix/path-with-outputs.hh"
|
||||
|
||||
#include <cstring>
|
||||
#include <regex>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#pragma once
|
||||
///@file
|
||||
|
||||
#include "eval.hh"
|
||||
#include "nix/eval.hh"
|
||||
|
||||
#include <string>
|
||||
#include <map>
|
|
@ -1,8 +1,8 @@
|
|||
#pragma once
|
||||
///@file
|
||||
|
||||
#include "nixexpr.hh"
|
||||
#include "symbol-table.hh"
|
||||
#include "nix/nixexpr.hh"
|
||||
#include "nix/symbol-table.hh"
|
||||
|
||||
#include <algorithm>
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
#pragma once
|
||||
///@file
|
||||
|
||||
#include "sync.hh"
|
||||
#include "hash.hh"
|
||||
#include "eval.hh"
|
||||
#include "nix/sync.hh"
|
||||
#include "nix/hash.hh"
|
||||
#include "nix/eval.hh"
|
||||
|
||||
#include <functional>
|
||||
#include <variant>
|
|
@ -1,7 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "error.hh"
|
||||
#include "pos-idx.hh"
|
||||
#include "nix/error.hh"
|
||||
#include "nix/pos-idx.hh"
|
||||
|
||||
namespace nix {
|
||||
|
|
@ -3,7 +3,10 @@
|
|||
|
||||
#include <cstddef>
|
||||
|
||||
#if HAVE_BOEHMGC
|
||||
// For `NIX_USE_BOEHMGC`, and if that's set, `GC_THREADS`
|
||||
#include "nix/expr-config.hh"
|
||||
|
||||
#if NIX_USE_BOEHMGC
|
||||
|
||||
# define GC_INCLUDE_NEW
|
||||
|
||||
|
@ -43,7 +46,7 @@ void initGC();
|
|||
*/
|
||||
void assertGCInitialized();
|
||||
|
||||
#ifdef HAVE_BOEHMGC
|
||||
#if NIX_USE_BOEHMGC
|
||||
/**
|
||||
* The number of GC cycles since initGC().
|
||||
*/
|
|
@ -1,10 +1,13 @@
|
|||
#pragma once
|
||||
///@file
|
||||
|
||||
#include "print.hh"
|
||||
#include "eval.hh"
|
||||
#include "eval-error.hh"
|
||||
#include "eval-settings.hh"
|
||||
#include "nix/print.hh"
|
||||
#include "nix/eval.hh"
|
||||
#include "nix/eval-error.hh"
|
||||
#include "nix/eval-settings.hh"
|
||||
|
||||
// For `NIX_USE_BOEHMGC`, and if that's set, `GC_THREADS`
|
||||
#include "nix/expr-config.hh"
|
||||
|
||||
namespace nix {
|
||||
|
||||
|
@ -15,7 +18,7 @@ namespace nix {
|
|||
inline void * allocBytes(size_t n)
|
||||
{
|
||||
void * p;
|
||||
#if HAVE_BOEHMGC
|
||||
#if NIX_USE_BOEHMGC
|
||||
p = GC_MALLOC(n);
|
||||
#else
|
||||
p = calloc(n, 1);
|
||||
|
@ -28,7 +31,7 @@ inline void * allocBytes(size_t n)
|
|||
[[gnu::always_inline]]
|
||||
Value * EvalState::allocValue()
|
||||
{
|
||||
#if HAVE_BOEHMGC
|
||||
#if NIX_USE_BOEHMGC
|
||||
/* We use the boehm batch allocator to speed up allocations of Values (of which there are many).
|
||||
GC_malloc_many returns a linked list of objects of the given size, where the first word
|
||||
of each object is also the pointer to the next object in the list. This also means that we
|
||||
|
@ -60,7 +63,7 @@ Env & EvalState::allocEnv(size_t size)
|
|||
|
||||
Env * env;
|
||||
|
||||
#if HAVE_BOEHMGC
|
||||
#if NIX_USE_BOEHMGC
|
||||
if (size == 1) {
|
||||
/* see allocValue for explanations. */
|
||||
if (!*env1AllocCache) {
|
|
@ -1,8 +1,8 @@
|
|||
#pragma once
|
||||
///@file
|
||||
|
||||
#include "config.hh"
|
||||
#include "source-path.hh"
|
||||
#include "nix/config.hh"
|
||||
#include "nix/source-path.hh"
|
||||
|
||||
namespace nix {
|
||||
|
|
@ -1,20 +1,23 @@
|
|||
#pragma once
|
||||
///@file
|
||||
|
||||
#include "attr-set.hh"
|
||||
#include "eval-error.hh"
|
||||
#include "types.hh"
|
||||
#include "value.hh"
|
||||
#include "nixexpr.hh"
|
||||
#include "symbol-table.hh"
|
||||
#include "config.hh"
|
||||
#include "experimental-features.hh"
|
||||
#include "position.hh"
|
||||
#include "pos-table.hh"
|
||||
#include "source-accessor.hh"
|
||||
#include "search-path.hh"
|
||||
#include "repl-exit-status.hh"
|
||||
#include "ref.hh"
|
||||
#include "nix/attr-set.hh"
|
||||
#include "nix/eval-error.hh"
|
||||
#include "nix/types.hh"
|
||||
#include "nix/value.hh"
|
||||
#include "nix/nixexpr.hh"
|
||||
#include "nix/symbol-table.hh"
|
||||
#include "nix/config.hh"
|
||||
#include "nix/experimental-features.hh"
|
||||
#include "nix/position.hh"
|
||||
#include "nix/pos-table.hh"
|
||||
#include "nix/source-accessor.hh"
|
||||
#include "nix/search-path.hh"
|
||||
#include "nix/repl-exit-status.hh"
|
||||
#include "nix/ref.hh"
|
||||
|
||||
// For `NIX_USE_BOEHMGC`, and if that's set, `GC_THREADS`
|
||||
#include "nix/expr-config.hh"
|
||||
|
||||
#include <map>
|
||||
#include <optional>
|
||||
|
@ -369,7 +372,7 @@ private:
|
|||
*/
|
||||
std::shared_ptr<RegexCache> regexCache;
|
||||
|
||||
#if HAVE_BOEHMGC
|
||||
#if NIX_USE_BOEHMGC
|
||||
/**
|
||||
* Allocation cache for GC'd Value objects.
|
||||
*/
|
||||
|
@ -596,7 +599,7 @@ public:
|
|||
*/
|
||||
SingleDerivedPath coerceToSingleDerivedPath(const PosIdx pos, Value & v, std::string_view errorCtx);
|
||||
|
||||
#if HAVE_BOEHMGC
|
||||
#if NIX_USE_BOEHMGC
|
||||
/** A GC root for the baseEnv reference. */
|
||||
std::shared_ptr<Env *> baseEnvP;
|
||||
#endif
|
||||
|
@ -944,4 +947,4 @@ bool isAllowedURI(std::string_view uri, const Strings & allowedPaths);
|
|||
|
||||
}
|
||||
|
||||
#include "eval-inline.hh"
|
||||
#include "nix/eval-inline.hh"
|
|
@ -1,7 +1,7 @@
|
|||
#pragma once
|
||||
///@file
|
||||
|
||||
#include "eval.hh"
|
||||
#include "nix/eval.hh"
|
||||
|
||||
#include <chrono>
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
#include <boost/container/small_vector.hpp>
|
||||
|
||||
#include "value.hh"
|
||||
#include "nix/value.hh"
|
||||
|
||||
namespace nix {
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
#pragma once
|
||||
///@file
|
||||
|
||||
#include "eval.hh"
|
||||
#include "path.hh"
|
||||
#include "nix/eval.hh"
|
||||
#include "nix/path.hh"
|
||||
|
||||
#include <string>
|
||||
#include <map>
|
|
@ -1,7 +1,7 @@
|
|||
#pragma once
|
||||
///@file
|
||||
|
||||
#include "error.hh"
|
||||
#include "nix/error.hh"
|
||||
|
||||
#include <string>
|
||||
|
37
src/libexpr/include/nix/meson.build
Normal file
37
src/libexpr/include/nix/meson.build
Normal file
|
@ -0,0 +1,37 @@
|
|||
# Public headers directory
|
||||
|
||||
include_dirs = [include_directories('..')]
|
||||
|
||||
config_pub_h = configure_file(
|
||||
configuration : configdata_pub,
|
||||
output : 'expr-config.hh',
|
||||
)
|
||||
|
||||
headers = [config_pub_h] + files(
|
||||
'attr-path.hh',
|
||||
'attr-set.hh',
|
||||
'eval-cache.hh',
|
||||
'eval-error.hh',
|
||||
'eval-gc.hh',
|
||||
'eval-inline.hh',
|
||||
'eval-settings.hh',
|
||||
'eval.hh',
|
||||
'function-trace.hh',
|
||||
'gc-small-vector.hh',
|
||||
'get-drvs.hh',
|
||||
'json-to-value.hh',
|
||||
# internal: 'lexer-helpers.hh',
|
||||
'nixexpr.hh',
|
||||
'parser-state.hh',
|
||||
'primops.hh',
|
||||
'print-ambiguous.hh',
|
||||
'print-options.hh',
|
||||
'print.hh',
|
||||
'repl-exit-status.hh',
|
||||
'search-path.hh',
|
||||
'symbol-table.hh',
|
||||
'value-to-json.hh',
|
||||
'value-to-xml.hh',
|
||||
'value.hh',
|
||||
'value/context.hh',
|
||||
)
|
|
@ -4,10 +4,10 @@
|
|||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
#include "value.hh"
|
||||
#include "symbol-table.hh"
|
||||
#include "eval-error.hh"
|
||||
#include "pos-idx.hh"
|
||||
#include "nix/value.hh"
|
||||
#include "nix/symbol-table.hh"
|
||||
#include "nix/eval-error.hh"
|
||||
#include "nix/pos-idx.hh"
|
||||
|
||||
namespace nix {
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
#include <limits>
|
||||
|
||||
#include "eval.hh"
|
||||
#include "nix/eval.hh"
|
||||
|
||||
namespace nix {
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
#pragma once
|
||||
///@file
|
||||
|
||||
#include "eval.hh"
|
||||
#include "nix/eval.hh"
|
||||
|
||||
#include <tuple>
|
||||
#include <vector>
|
|
@ -1,6 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include "value.hh"
|
||||
#include "nix/value.hh"
|
||||
|
||||
namespace nix {
|
||||
|
|
@ -9,8 +9,8 @@
|
|||
|
||||
#include <iostream>
|
||||
|
||||
#include "fmt.hh"
|
||||
#include "print-options.hh"
|
||||
#include "nix/fmt.hh"
|
||||
#include "nix/print-options.hh"
|
||||
|
||||
namespace nix {
|
||||
|
|
@ -3,8 +3,8 @@
|
|||
|
||||
#include <optional>
|
||||
|
||||
#include "types.hh"
|
||||
#include "comparator.hh"
|
||||
#include "nix/types.hh"
|
||||
#include "nix/comparator.hh"
|
||||
|
||||
namespace nix {
|
||||
|
|
@ -5,9 +5,9 @@
|
|||
#include <map>
|
||||
#include <unordered_map>
|
||||
|
||||
#include "types.hh"
|
||||
#include "chunked-vector.hh"
|
||||
#include "error.hh"
|
||||
#include "nix/types.hh"
|
||||
#include "nix/chunked-vector.hh"
|
||||
#include "nix/error.hh"
|
||||
|
||||
namespace nix {
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
#pragma once
|
||||
///@file
|
||||
|
||||
#include "nixexpr.hh"
|
||||
#include "eval.hh"
|
||||
#include "nix/nixexpr.hh"
|
||||
#include "nix/eval.hh"
|
||||
|
||||
#include <string>
|
||||
#include <map>
|
|
@ -1,8 +1,8 @@
|
|||
#pragma once
|
||||
///@file
|
||||
|
||||
#include "nixexpr.hh"
|
||||
#include "eval.hh"
|
||||
#include "nix/nixexpr.hh"
|
||||
#include "nix/eval.hh"
|
||||
|
||||
#include <string>
|
||||
#include <map>
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue