mirror of
https://github.com/NixOS/nix
synced 2025-06-25 19:01:16 +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
11
.mergify.yml
11
.mergify.yml
|
@ -128,3 +128,14 @@ pull_request_rules:
|
|||
labels:
|
||||
- automatic backport
|
||||
- merge-queue
|
||||
|
||||
- name: backport patches to 2.28
|
||||
conditions:
|
||||
- label=backport 2.28-maintenance
|
||||
actions:
|
||||
backport:
|
||||
branches:
|
||||
- "2.28-maintenance"
|
||||
labels:
|
||||
- automatic backport
|
||||
- merge-queue
|
||||
|
|
|
@ -31,7 +31,7 @@ The unit tests are defined using the [googletest] and [rapidcheck] frameworks.
|
|||
> ├── libexpr
|
||||
> │ ├── meson.build
|
||||
> │ ├── value/context.hh
|
||||
> │ ├── value/context.cc
|
||||
> │ ├── include/nix/value/context.cc
|
||||
> │ …
|
||||
> │
|
||||
> ├── tests
|
||||
|
@ -46,8 +46,12 @@ The unit tests are defined using the [googletest] and [rapidcheck] frameworks.
|
|||
> │ │
|
||||
> │ ├── libexpr-test-support
|
||||
> │ │ ├── meson.build
|
||||
> │ │ ├── include/nix
|
||||
> │ │ │ ├── meson.build
|
||||
> │ │ │ └── tests
|
||||
> │ │ │ ├── value/context.hh
|
||||
> │ │ │ …
|
||||
> │ │ └── tests
|
||||
> │ │ ├── value/context.hh
|
||||
> │ │ ├── value/context.cc
|
||||
> │ │ …
|
||||
> │ │
|
||||
|
@ -59,7 +63,7 @@ The unit tests are defined using the [googletest] and [rapidcheck] frameworks.
|
|||
> ```
|
||||
|
||||
The tests for each Nix library (`libnixexpr`, `libnixstore`, etc..) live inside a directory `src/${library_name_without-nix}-test`.
|
||||
Given an interface (header) and implementation pair in the original library, say, `src/libexpr/value/context.{hh,cc}`, we write tests for it in `src/libexpr-tests/value/context.cc`, and (possibly) declare/define additional interfaces for testing purposes in `src/libexpr-test-support/tests/value/context.{hh,cc}`.
|
||||
Given an interface (header) and implementation pair in the original library, say, `src/libexpr/include/nix/value/context.hh` and `src/libexpr/value/context.cc`, we write tests for it in `src/libexpr-tests/value/context.cc`, and (possibly) declare/define additional interfaces for testing purposes in `src/libexpr-test-support/include/nix/tests/value/context.hh` and `src/libexpr-test-support/tests/value/context.cc`.
|
||||
|
||||
Data for unit tests is stored in a `data` subdir of the directory for each unit test executable.
|
||||
For example, `libnixstore` code is in `src/libstore`, and its test data is in `src/libstore-tests/data`.
|
||||
|
@ -67,7 +71,7 @@ The path to the `src/${library_name_without-nix}-test/data` directory is passed
|
|||
Note that each executable only gets the data for its tests.
|
||||
|
||||
The unit test libraries are in `src/${library_name_without-nix}-test-support`.
|
||||
All headers are in a `tests` subdirectory so they are included with `#include "tests/"`.
|
||||
All headers are in a `tests` subdirectory so they are included with `#include "nix/tests/"`.
|
||||
|
||||
The use of all these separate directories for the unit tests might seem inconvenient, as for example the tests are not "right next to" the part of the code they are testing.
|
||||
But organizing the tests this way has one big benefit:
|
||||
|
|
|
@ -230,6 +230,9 @@
|
|||
This shouldn't build anything significant; just check that things
|
||||
(including derivations) are _set up_ correctly.
|
||||
*/
|
||||
# Disabled due to a bug in `testEqualContents` (see
|
||||
# https://github.com/NixOS/nix/issues/12690).
|
||||
/*
|
||||
packaging-overriding =
|
||||
let
|
||||
pkgs = nixpkgsFor.${system}.native;
|
||||
|
@ -248,6 +251,7 @@
|
|||
# Same for all components; nix-util is an arbitrary pick
|
||||
(nix.appendPatches [ pkgs.emptyFile ]).libs.nix-util.src;
|
||||
};
|
||||
*/
|
||||
}
|
||||
// (lib.optionalAttrs (builtins.elem system linux64BitSystems)) {
|
||||
dockerImage = self.hydraJobs.dockerImage.${system};
|
||||
|
|
|
@ -84,340 +84,340 @@
|
|||
''^precompiled-headers\.h$''
|
||||
''^src/build-remote/build-remote\.cc$''
|
||||
''^src/libcmd/built-path\.cc$''
|
||||
''^src/libcmd/built-path\.hh$''
|
||||
''^src/libcmd/include/nix/built-path\.hh$''
|
||||
''^src/libcmd/common-eval-args\.cc$''
|
||||
''^src/libcmd/common-eval-args\.hh$''
|
||||
''^src/libcmd/include/nix/common-eval-args\.hh$''
|
||||
''^src/libcmd/editor-for\.cc$''
|
||||
''^src/libcmd/installable-attr-path\.cc$''
|
||||
''^src/libcmd/installable-attr-path\.hh$''
|
||||
''^src/libcmd/include/nix/installable-attr-path\.hh$''
|
||||
''^src/libcmd/installable-derived-path\.cc$''
|
||||
''^src/libcmd/installable-derived-path\.hh$''
|
||||
''^src/libcmd/include/nix/installable-derived-path\.hh$''
|
||||
''^src/libcmd/installable-flake\.cc$''
|
||||
''^src/libcmd/installable-flake\.hh$''
|
||||
''^src/libcmd/include/nix/installable-flake\.hh$''
|
||||
''^src/libcmd/installable-value\.cc$''
|
||||
''^src/libcmd/installable-value\.hh$''
|
||||
''^src/libcmd/include/nix/installable-value\.hh$''
|
||||
''^src/libcmd/installables\.cc$''
|
||||
''^src/libcmd/installables\.hh$''
|
||||
''^src/libcmd/legacy\.hh$''
|
||||
''^src/libcmd/include/nix/installables\.hh$''
|
||||
''^src/libcmd/include/nix/legacy\.hh$''
|
||||
''^src/libcmd/markdown\.cc$''
|
||||
''^src/libcmd/misc-store-flags\.cc$''
|
||||
''^src/libcmd/repl-interacter\.cc$''
|
||||
''^src/libcmd/repl-interacter\.hh$''
|
||||
''^src/libcmd/include/nix/repl-interacter\.hh$''
|
||||
''^src/libcmd/repl\.cc$''
|
||||
''^src/libcmd/repl\.hh$''
|
||||
''^src/libcmd/include/nix/repl\.hh$''
|
||||
''^src/libexpr-c/nix_api_expr\.cc$''
|
||||
''^src/libexpr-c/nix_api_external\.cc$''
|
||||
''^src/libexpr/attr-path\.cc$''
|
||||
''^src/libexpr/attr-path\.hh$''
|
||||
''^src/libexpr/include/nix/attr-path\.hh$''
|
||||
''^src/libexpr/attr-set\.cc$''
|
||||
''^src/libexpr/attr-set\.hh$''
|
||||
''^src/libexpr/include/nix/attr-set\.hh$''
|
||||
''^src/libexpr/eval-cache\.cc$''
|
||||
''^src/libexpr/eval-cache\.hh$''
|
||||
''^src/libexpr/include/nix/eval-cache\.hh$''
|
||||
''^src/libexpr/eval-error\.cc$''
|
||||
''^src/libexpr/eval-inline\.hh$''
|
||||
''^src/libexpr/include/nix/eval-inline\.hh$''
|
||||
''^src/libexpr/eval-settings\.cc$''
|
||||
''^src/libexpr/eval-settings\.hh$''
|
||||
''^src/libexpr/include/nix/eval-settings\.hh$''
|
||||
''^src/libexpr/eval\.cc$''
|
||||
''^src/libexpr/eval\.hh$''
|
||||
''^src/libexpr/include/nix/eval\.hh$''
|
||||
''^src/libexpr/function-trace\.cc$''
|
||||
''^src/libexpr/gc-small-vector\.hh$''
|
||||
''^src/libexpr/include/nix/gc-small-vector\.hh$''
|
||||
''^src/libexpr/get-drvs\.cc$''
|
||||
''^src/libexpr/get-drvs\.hh$''
|
||||
''^src/libexpr/include/nix/get-drvs\.hh$''
|
||||
''^src/libexpr/json-to-value\.cc$''
|
||||
''^src/libexpr/nixexpr\.cc$''
|
||||
''^src/libexpr/nixexpr\.hh$''
|
||||
''^src/libexpr/parser-state\.hh$''
|
||||
''^src/libexpr/include/nix/nixexpr\.hh$''
|
||||
''^src/libexpr/include/nix/parser-state\.hh$''
|
||||
''^src/libexpr/primops\.cc$''
|
||||
''^src/libexpr/primops\.hh$''
|
||||
''^src/libexpr/include/nix/primops\.hh$''
|
||||
''^src/libexpr/primops/context\.cc$''
|
||||
''^src/libexpr/primops/fetchClosure\.cc$''
|
||||
''^src/libexpr/primops/fetchMercurial\.cc$''
|
||||
''^src/libexpr/primops/fetchTree\.cc$''
|
||||
''^src/libexpr/primops/fromTOML\.cc$''
|
||||
''^src/libexpr/print-ambiguous\.cc$''
|
||||
''^src/libexpr/print-ambiguous\.hh$''
|
||||
''^src/libexpr/print-options\.hh$''
|
||||
''^src/libexpr/include/nix/print-ambiguous\.hh$''
|
||||
''^src/libexpr/include/nix/print-options\.hh$''
|
||||
''^src/libexpr/print\.cc$''
|
||||
''^src/libexpr/print\.hh$''
|
||||
''^src/libexpr/include/nix/print\.hh$''
|
||||
''^src/libexpr/search-path\.cc$''
|
||||
''^src/libexpr/symbol-table\.hh$''
|
||||
''^src/libexpr/include/nix/symbol-table\.hh$''
|
||||
''^src/libexpr/value-to-json\.cc$''
|
||||
''^src/libexpr/value-to-json\.hh$''
|
||||
''^src/libexpr/include/nix/value-to-json\.hh$''
|
||||
''^src/libexpr/value-to-xml\.cc$''
|
||||
''^src/libexpr/value-to-xml\.hh$''
|
||||
''^src/libexpr/value\.hh$''
|
||||
''^src/libexpr/include/nix/value-to-xml\.hh$''
|
||||
''^src/libexpr/include/nix/value\.hh$''
|
||||
''^src/libexpr/value/context\.cc$''
|
||||
''^src/libexpr/value/context\.hh$''
|
||||
''^src/libexpr/include/nix/value/context\.hh$''
|
||||
''^src/libfetchers/attrs\.cc$''
|
||||
''^src/libfetchers/cache\.cc$''
|
||||
''^src/libfetchers/cache\.hh$''
|
||||
''^src/libfetchers/include/nix/cache\.hh$''
|
||||
''^src/libfetchers/fetch-settings\.cc$''
|
||||
''^src/libfetchers/fetch-settings\.hh$''
|
||||
''^src/libfetchers/include/nix/fetch-settings\.hh$''
|
||||
''^src/libfetchers/fetch-to-store\.cc$''
|
||||
''^src/libfetchers/fetchers\.cc$''
|
||||
''^src/libfetchers/fetchers\.hh$''
|
||||
''^src/libfetchers/include/nix/fetchers\.hh$''
|
||||
''^src/libfetchers/filtering-source-accessor\.cc$''
|
||||
''^src/libfetchers/filtering-source-accessor\.hh$''
|
||||
''^src/libfetchers/include/nix/filtering-source-accessor\.hh$''
|
||||
''^src/libfetchers/fs-source-accessor\.cc$''
|
||||
''^src/libfetchers/fs-source-accessor\.hh$''
|
||||
''^src/libfetchers/include/nix/fs-source-accessor\.hh$''
|
||||
''^src/libfetchers/git-utils\.cc$''
|
||||
''^src/libfetchers/git-utils\.hh$''
|
||||
''^src/libfetchers/include/nix/git-utils\.hh$''
|
||||
''^src/libfetchers/github\.cc$''
|
||||
''^src/libfetchers/indirect\.cc$''
|
||||
''^src/libfetchers/memory-source-accessor\.cc$''
|
||||
''^src/libfetchers/path\.cc$''
|
||||
''^src/libfetchers/registry\.cc$''
|
||||
''^src/libfetchers/registry\.hh$''
|
||||
''^src/libfetchers/include/nix/registry\.hh$''
|
||||
''^src/libfetchers/tarball\.cc$''
|
||||
''^src/libfetchers/tarball\.hh$''
|
||||
''^src/libfetchers/include/nix/tarball\.hh$''
|
||||
''^src/libfetchers/git\.cc$''
|
||||
''^src/libfetchers/mercurial\.cc$''
|
||||
''^src/libflake/flake/config\.cc$''
|
||||
''^src/libflake/flake/flake\.cc$''
|
||||
''^src/libflake/flake/flake\.hh$''
|
||||
''^src/libflake/include/nix/flake/flake\.hh$''
|
||||
''^src/libflake/flake/flakeref\.cc$''
|
||||
''^src/libflake/flake/flakeref\.hh$''
|
||||
''^src/libflake/include/nix/flake/flakeref\.hh$''
|
||||
''^src/libflake/flake/lockfile\.cc$''
|
||||
''^src/libflake/flake/lockfile\.hh$''
|
||||
''^src/libflake/include/nix/flake/lockfile\.hh$''
|
||||
''^src/libflake/flake/url-name\.cc$''
|
||||
''^src/libmain/common-args\.cc$''
|
||||
''^src/libmain/common-args\.hh$''
|
||||
''^src/libmain/include/nix/common-args\.hh$''
|
||||
''^src/libmain/loggers\.cc$''
|
||||
''^src/libmain/loggers\.hh$''
|
||||
''^src/libmain/include/nix/loggers\.hh$''
|
||||
''^src/libmain/progress-bar\.cc$''
|
||||
''^src/libmain/shared\.cc$''
|
||||
''^src/libmain/shared\.hh$''
|
||||
''^src/libmain/include/nix/shared\.hh$''
|
||||
''^src/libmain/unix/stack\.cc$''
|
||||
''^src/libstore/binary-cache-store\.cc$''
|
||||
''^src/libstore/binary-cache-store\.hh$''
|
||||
''^src/libstore/build-result\.hh$''
|
||||
''^src/libstore/builtins\.hh$''
|
||||
''^src/libstore/include/nix/binary-cache-store\.hh$''
|
||||
''^src/libstore/include/nix/build-result\.hh$''
|
||||
''^src/libstore/include/nix/builtins\.hh$''
|
||||
''^src/libstore/builtins/buildenv\.cc$''
|
||||
''^src/libstore/builtins/buildenv\.hh$''
|
||||
''^src/libstore/common-protocol-impl\.hh$''
|
||||
''^src/libstore/include/nix/builtins/buildenv\.hh$''
|
||||
''^src/libstore/include/nix/common-protocol-impl\.hh$''
|
||||
''^src/libstore/common-protocol\.cc$''
|
||||
''^src/libstore/common-protocol\.hh$''
|
||||
''^src/libstore/common-ssh-store-config\.hh$''
|
||||
''^src/libstore/include/nix/common-protocol\.hh$''
|
||||
''^src/libstore/include/nix/common-ssh-store-config\.hh$''
|
||||
''^src/libstore/content-address\.cc$''
|
||||
''^src/libstore/content-address\.hh$''
|
||||
''^src/libstore/include/nix/content-address\.hh$''
|
||||
''^src/libstore/daemon\.cc$''
|
||||
''^src/libstore/daemon\.hh$''
|
||||
''^src/libstore/include/nix/daemon\.hh$''
|
||||
''^src/libstore/derivations\.cc$''
|
||||
''^src/libstore/derivations\.hh$''
|
||||
''^src/libstore/include/nix/derivations\.hh$''
|
||||
''^src/libstore/derived-path-map\.cc$''
|
||||
''^src/libstore/derived-path-map\.hh$''
|
||||
''^src/libstore/include/nix/derived-path-map\.hh$''
|
||||
''^src/libstore/derived-path\.cc$''
|
||||
''^src/libstore/derived-path\.hh$''
|
||||
''^src/libstore/include/nix/derived-path\.hh$''
|
||||
''^src/libstore/downstream-placeholder\.cc$''
|
||||
''^src/libstore/downstream-placeholder\.hh$''
|
||||
''^src/libstore/include/nix/downstream-placeholder\.hh$''
|
||||
''^src/libstore/dummy-store\.cc$''
|
||||
''^src/libstore/export-import\.cc$''
|
||||
''^src/libstore/filetransfer\.cc$''
|
||||
''^src/libstore/filetransfer\.hh$''
|
||||
''^src/libstore/gc-store\.hh$''
|
||||
''^src/libstore/include/nix/filetransfer\.hh$''
|
||||
''^src/libstore/include/nix/gc-store\.hh$''
|
||||
''^src/libstore/globals\.cc$''
|
||||
''^src/libstore/globals\.hh$''
|
||||
''^src/libstore/include/nix/globals\.hh$''
|
||||
''^src/libstore/http-binary-cache-store\.cc$''
|
||||
''^src/libstore/legacy-ssh-store\.cc$''
|
||||
''^src/libstore/legacy-ssh-store\.hh$''
|
||||
''^src/libstore/length-prefixed-protocol-helper\.hh$''
|
||||
''^src/libstore/include/nix/legacy-ssh-store\.hh$''
|
||||
''^src/libstore/include/nix/length-prefixed-protocol-helper\.hh$''
|
||||
''^src/libstore/linux/personality\.cc$''
|
||||
''^src/libstore/linux/personality\.hh$''
|
||||
''^src/libstore/linux/include/nix/personality\.hh$''
|
||||
''^src/libstore/local-binary-cache-store\.cc$''
|
||||
''^src/libstore/local-fs-store\.cc$''
|
||||
''^src/libstore/local-fs-store\.hh$''
|
||||
''^src/libstore/include/nix/local-fs-store\.hh$''
|
||||
''^src/libstore/log-store\.cc$''
|
||||
''^src/libstore/log-store\.hh$''
|
||||
''^src/libstore/include/nix/log-store\.hh$''
|
||||
''^src/libstore/machines\.cc$''
|
||||
''^src/libstore/machines\.hh$''
|
||||
''^src/libstore/include/nix/machines\.hh$''
|
||||
''^src/libstore/make-content-addressed\.cc$''
|
||||
''^src/libstore/make-content-addressed\.hh$''
|
||||
''^src/libstore/include/nix/make-content-addressed\.hh$''
|
||||
''^src/libstore/misc\.cc$''
|
||||
''^src/libstore/names\.cc$''
|
||||
''^src/libstore/names\.hh$''
|
||||
''^src/libstore/include/nix/names\.hh$''
|
||||
''^src/libstore/nar-accessor\.cc$''
|
||||
''^src/libstore/nar-accessor\.hh$''
|
||||
''^src/libstore/include/nix/nar-accessor\.hh$''
|
||||
''^src/libstore/nar-info-disk-cache\.cc$''
|
||||
''^src/libstore/nar-info-disk-cache\.hh$''
|
||||
''^src/libstore/include/nix/nar-info-disk-cache\.hh$''
|
||||
''^src/libstore/nar-info\.cc$''
|
||||
''^src/libstore/nar-info\.hh$''
|
||||
''^src/libstore/include/nix/nar-info\.hh$''
|
||||
''^src/libstore/outputs-spec\.cc$''
|
||||
''^src/libstore/outputs-spec\.hh$''
|
||||
''^src/libstore/include/nix/outputs-spec\.hh$''
|
||||
''^src/libstore/parsed-derivations\.cc$''
|
||||
''^src/libstore/path-info\.cc$''
|
||||
''^src/libstore/path-info\.hh$''
|
||||
''^src/libstore/include/nix/path-info\.hh$''
|
||||
''^src/libstore/path-references\.cc$''
|
||||
''^src/libstore/path-regex\.hh$''
|
||||
''^src/libstore/include/nix/path-regex\.hh$''
|
||||
''^src/libstore/path-with-outputs\.cc$''
|
||||
''^src/libstore/path\.cc$''
|
||||
''^src/libstore/path\.hh$''
|
||||
''^src/libstore/include/nix/path\.hh$''
|
||||
''^src/libstore/pathlocks\.cc$''
|
||||
''^src/libstore/pathlocks\.hh$''
|
||||
''^src/libstore/include/nix/pathlocks\.hh$''
|
||||
''^src/libstore/profiles\.cc$''
|
||||
''^src/libstore/profiles\.hh$''
|
||||
''^src/libstore/include/nix/profiles\.hh$''
|
||||
''^src/libstore/realisation\.cc$''
|
||||
''^src/libstore/realisation\.hh$''
|
||||
''^src/libstore/include/nix/realisation\.hh$''
|
||||
''^src/libstore/remote-fs-accessor\.cc$''
|
||||
''^src/libstore/remote-fs-accessor\.hh$''
|
||||
''^src/libstore/remote-store-connection\.hh$''
|
||||
''^src/libstore/include/nix/remote-fs-accessor\.hh$''
|
||||
''^src/libstore/include/nix/remote-store-connection\.hh$''
|
||||
''^src/libstore/remote-store\.cc$''
|
||||
''^src/libstore/remote-store\.hh$''
|
||||
''^src/libstore/include/nix/remote-store\.hh$''
|
||||
''^src/libstore/s3-binary-cache-store\.cc$''
|
||||
''^src/libstore/s3\.hh$''
|
||||
''^src/libstore/include/nix/s3\.hh$''
|
||||
''^src/libstore/serve-protocol-impl\.cc$''
|
||||
''^src/libstore/serve-protocol-impl\.hh$''
|
||||
''^src/libstore/include/nix/serve-protocol-impl\.hh$''
|
||||
''^src/libstore/serve-protocol\.cc$''
|
||||
''^src/libstore/serve-protocol\.hh$''
|
||||
''^src/libstore/include/nix/serve-protocol\.hh$''
|
||||
''^src/libstore/sqlite\.cc$''
|
||||
''^src/libstore/sqlite\.hh$''
|
||||
''^src/libstore/include/nix/sqlite\.hh$''
|
||||
''^src/libstore/ssh-store\.cc$''
|
||||
''^src/libstore/ssh\.cc$''
|
||||
''^src/libstore/ssh\.hh$''
|
||||
''^src/libstore/include/nix/ssh\.hh$''
|
||||
''^src/libstore/store-api\.cc$''
|
||||
''^src/libstore/store-api\.hh$''
|
||||
''^src/libstore/store-dir-config\.hh$''
|
||||
''^src/libstore/include/nix/store-api\.hh$''
|
||||
''^src/libstore/include/nix/store-dir-config\.hh$''
|
||||
''^src/libstore/build/derivation-goal\.cc$''
|
||||
''^src/libstore/build/derivation-goal\.hh$''
|
||||
''^src/libstore/include/nix/build/derivation-goal\.hh$''
|
||||
''^src/libstore/build/drv-output-substitution-goal\.cc$''
|
||||
''^src/libstore/build/drv-output-substitution-goal\.hh$''
|
||||
''^src/libstore/include/nix/build/drv-output-substitution-goal\.hh$''
|
||||
''^src/libstore/build/entry-points\.cc$''
|
||||
''^src/libstore/build/goal\.cc$''
|
||||
''^src/libstore/build/goal\.hh$''
|
||||
''^src/libstore/include/nix/build/goal\.hh$''
|
||||
''^src/libstore/unix/build/hook-instance\.cc$''
|
||||
''^src/libstore/unix/build/local-derivation-goal\.cc$''
|
||||
''^src/libstore/unix/build/local-derivation-goal\.hh$''
|
||||
''^src/libstore/unix/include/nix/build/local-derivation-goal\.hh$''
|
||||
''^src/libstore/build/substitution-goal\.cc$''
|
||||
''^src/libstore/build/substitution-goal\.hh$''
|
||||
''^src/libstore/include/nix/build/substitution-goal\.hh$''
|
||||
''^src/libstore/build/worker\.cc$''
|
||||
''^src/libstore/build/worker\.hh$''
|
||||
''^src/libstore/include/nix/build/worker\.hh$''
|
||||
''^src/libstore/builtins/fetchurl\.cc$''
|
||||
''^src/libstore/builtins/unpack-channel\.cc$''
|
||||
''^src/libstore/gc\.cc$''
|
||||
''^src/libstore/local-overlay-store\.cc$''
|
||||
''^src/libstore/local-overlay-store\.hh$''
|
||||
''^src/libstore/include/nix/local-overlay-store\.hh$''
|
||||
''^src/libstore/local-store\.cc$''
|
||||
''^src/libstore/local-store\.hh$''
|
||||
''^src/libstore/include/nix/local-store\.hh$''
|
||||
''^src/libstore/unix/user-lock\.cc$''
|
||||
''^src/libstore/unix/user-lock\.hh$''
|
||||
''^src/libstore/unix/include/nix/user-lock\.hh$''
|
||||
''^src/libstore/optimise-store\.cc$''
|
||||
''^src/libstore/unix/pathlocks\.cc$''
|
||||
''^src/libstore/posix-fs-canonicalise\.cc$''
|
||||
''^src/libstore/posix-fs-canonicalise\.hh$''
|
||||
''^src/libstore/include/nix/posix-fs-canonicalise\.hh$''
|
||||
''^src/libstore/uds-remote-store\.cc$''
|
||||
''^src/libstore/uds-remote-store\.hh$''
|
||||
''^src/libstore/include/nix/uds-remote-store\.hh$''
|
||||
''^src/libstore/windows/build\.cc$''
|
||||
''^src/libstore/worker-protocol-impl\.hh$''
|
||||
''^src/libstore/include/nix/worker-protocol-impl\.hh$''
|
||||
''^src/libstore/worker-protocol\.cc$''
|
||||
''^src/libstore/worker-protocol\.hh$''
|
||||
''^src/libstore/include/nix/worker-protocol\.hh$''
|
||||
''^src/libutil-c/nix_api_util_internal\.h$''
|
||||
''^src/libutil/archive\.cc$''
|
||||
''^src/libutil/archive\.hh$''
|
||||
''^src/libutil/include/nix/archive\.hh$''
|
||||
''^src/libutil/args\.cc$''
|
||||
''^src/libutil/args\.hh$''
|
||||
''^src/libutil/args/root\.hh$''
|
||||
''^src/libutil/callback\.hh$''
|
||||
''^src/libutil/include/nix/args\.hh$''
|
||||
''^src/libutil/include/nix/args/root\.hh$''
|
||||
''^src/libutil/include/nix/callback\.hh$''
|
||||
''^src/libutil/canon-path\.cc$''
|
||||
''^src/libutil/canon-path\.hh$''
|
||||
''^src/libutil/chunked-vector\.hh$''
|
||||
''^src/libutil/closure\.hh$''
|
||||
''^src/libutil/comparator\.hh$''
|
||||
''^src/libutil/include/nix/canon-path\.hh$''
|
||||
''^src/libutil/include/nix/chunked-vector\.hh$''
|
||||
''^src/libutil/include/nix/closure\.hh$''
|
||||
''^src/libutil/include/nix/comparator\.hh$''
|
||||
''^src/libutil/compute-levels\.cc$''
|
||||
''^src/libutil/config-impl\.hh$''
|
||||
''^src/libutil/include/nix/config-impl\.hh$''
|
||||
''^src/libutil/config\.cc$''
|
||||
''^src/libutil/config\.hh$''
|
||||
''^src/libutil/include/nix/config\.hh$''
|
||||
''^src/libutil/current-process\.cc$''
|
||||
''^src/libutil/current-process\.hh$''
|
||||
''^src/libutil/include/nix/current-process\.hh$''
|
||||
''^src/libutil/english\.cc$''
|
||||
''^src/libutil/english\.hh$''
|
||||
''^src/libutil/include/nix/english\.hh$''
|
||||
''^src/libutil/error\.cc$''
|
||||
''^src/libutil/error\.hh$''
|
||||
''^src/libutil/exit\.hh$''
|
||||
''^src/libutil/include/nix/error\.hh$''
|
||||
''^src/libutil/include/nix/exit\.hh$''
|
||||
''^src/libutil/experimental-features\.cc$''
|
||||
''^src/libutil/experimental-features\.hh$''
|
||||
''^src/libutil/include/nix/experimental-features\.hh$''
|
||||
''^src/libutil/file-content-address\.cc$''
|
||||
''^src/libutil/file-content-address\.hh$''
|
||||
''^src/libutil/include/nix/file-content-address\.hh$''
|
||||
''^src/libutil/file-descriptor\.cc$''
|
||||
''^src/libutil/file-descriptor\.hh$''
|
||||
''^src/libutil/file-path-impl\.hh$''
|
||||
''^src/libutil/file-path\.hh$''
|
||||
''^src/libutil/include/nix/file-descriptor\.hh$''
|
||||
''^src/libutil/include/nix/file-path-impl\.hh$''
|
||||
''^src/libutil/include/nix/file-path\.hh$''
|
||||
''^src/libutil/file-system\.cc$''
|
||||
''^src/libutil/file-system\.hh$''
|
||||
''^src/libutil/finally\.hh$''
|
||||
''^src/libutil/fmt\.hh$''
|
||||
''^src/libutil/include/nix/file-system\.hh$''
|
||||
''^src/libutil/include/nix/finally\.hh$''
|
||||
''^src/libutil/include/nix/fmt\.hh$''
|
||||
''^src/libutil/fs-sink\.cc$''
|
||||
''^src/libutil/fs-sink\.hh$''
|
||||
''^src/libutil/include/nix/fs-sink\.hh$''
|
||||
''^src/libutil/git\.cc$''
|
||||
''^src/libutil/git\.hh$''
|
||||
''^src/libutil/include/nix/git\.hh$''
|
||||
''^src/libutil/hash\.cc$''
|
||||
''^src/libutil/hash\.hh$''
|
||||
''^src/libutil/include/nix/hash\.hh$''
|
||||
''^src/libutil/hilite\.cc$''
|
||||
''^src/libutil/hilite\.hh$''
|
||||
''^src/libutil/include/nix/hilite\.hh$''
|
||||
''^src/libutil/source-accessor\.hh$''
|
||||
''^src/libutil/json-impls\.hh$''
|
||||
''^src/libutil/include/nix/json-impls\.hh$''
|
||||
''^src/libutil/json-utils\.cc$''
|
||||
''^src/libutil/json-utils\.hh$''
|
||||
''^src/libutil/include/nix/json-utils\.hh$''
|
||||
''^src/libutil/linux/cgroup\.cc$''
|
||||
''^src/libutil/linux/namespaces\.cc$''
|
||||
''^src/libutil/logging\.cc$''
|
||||
''^src/libutil/logging\.hh$''
|
||||
''^src/libutil/lru-cache\.hh$''
|
||||
''^src/libutil/include/nix/logging\.hh$''
|
||||
''^src/libutil/include/nix/lru-cache\.hh$''
|
||||
''^src/libutil/memory-source-accessor\.cc$''
|
||||
''^src/libutil/memory-source-accessor\.hh$''
|
||||
''^src/libutil/pool\.hh$''
|
||||
''^src/libutil/include/nix/memory-source-accessor\.hh$''
|
||||
''^src/libutil/include/nix/pool\.hh$''
|
||||
''^src/libutil/position\.cc$''
|
||||
''^src/libutil/position\.hh$''
|
||||
''^src/libutil/include/nix/position\.hh$''
|
||||
''^src/libutil/posix-source-accessor\.cc$''
|
||||
''^src/libutil/posix-source-accessor\.hh$''
|
||||
''^src/libutil/processes\.hh$''
|
||||
''^src/libutil/ref\.hh$''
|
||||
''^src/libutil/include/nix/posix-source-accessor\.hh$''
|
||||
''^src/libutil/include/nix/processes\.hh$''
|
||||
''^src/libutil/include/nix/ref\.hh$''
|
||||
''^src/libutil/references\.cc$''
|
||||
''^src/libutil/references\.hh$''
|
||||
''^src/libutil/include/nix/references\.hh$''
|
||||
''^src/libutil/regex-combinators\.hh$''
|
||||
''^src/libutil/serialise\.cc$''
|
||||
''^src/libutil/serialise\.hh$''
|
||||
''^src/libutil/signals\.hh$''
|
||||
''^src/libutil/include/nix/serialise\.hh$''
|
||||
''^src/libutil/include/nix/signals\.hh$''
|
||||
''^src/libutil/signature/local-keys\.cc$''
|
||||
''^src/libutil/signature/local-keys\.hh$''
|
||||
''^src/libutil/include/nix/signature/local-keys\.hh$''
|
||||
''^src/libutil/signature/signer\.cc$''
|
||||
''^src/libutil/signature/signer\.hh$''
|
||||
''^src/libutil/include/nix/signature/signer\.hh$''
|
||||
''^src/libutil/source-accessor\.cc$''
|
||||
''^src/libutil/source-accessor\.hh$''
|
||||
''^src/libutil/include/nix/source-accessor\.hh$''
|
||||
''^src/libutil/source-path\.cc$''
|
||||
''^src/libutil/source-path\.hh$''
|
||||
''^src/libutil/split\.hh$''
|
||||
''^src/libutil/include/nix/source-path\.hh$''
|
||||
''^src/libutil/include/nix/split\.hh$''
|
||||
''^src/libutil/suggestions\.cc$''
|
||||
''^src/libutil/suggestions\.hh$''
|
||||
''^src/libutil/sync\.hh$''
|
||||
''^src/libutil/include/nix/suggestions\.hh$''
|
||||
''^src/libutil/include/nix/sync\.hh$''
|
||||
''^src/libutil/terminal\.cc$''
|
||||
''^src/libutil/terminal\.hh$''
|
||||
''^src/libutil/include/nix/terminal\.hh$''
|
||||
''^src/libutil/thread-pool\.cc$''
|
||||
''^src/libutil/thread-pool\.hh$''
|
||||
''^src/libutil/topo-sort\.hh$''
|
||||
''^src/libutil/types\.hh$''
|
||||
''^src/libutil/include/nix/thread-pool\.hh$''
|
||||
''^src/libutil/include/nix/topo-sort\.hh$''
|
||||
''^src/libutil/include/nix/types\.hh$''
|
||||
''^src/libutil/unix/file-descriptor\.cc$''
|
||||
''^src/libutil/unix/file-path\.cc$''
|
||||
''^src/libutil/unix/processes\.cc$''
|
||||
''^src/libutil/unix/signals-impl\.hh$''
|
||||
''^src/libutil/unix/include/nix/signals-impl\.hh$''
|
||||
''^src/libutil/unix/signals\.cc$''
|
||||
''^src/libutil/unix-domain-socket\.cc$''
|
||||
''^src/libutil/unix/users\.cc$''
|
||||
''^src/libutil/url-parts\.hh$''
|
||||
''^src/libutil/include/nix/url-parts\.hh$''
|
||||
''^src/libutil/url\.cc$''
|
||||
''^src/libutil/url\.hh$''
|
||||
''^src/libutil/include/nix/url\.hh$''
|
||||
''^src/libutil/users\.cc$''
|
||||
''^src/libutil/users\.hh$''
|
||||
''^src/libutil/include/nix/users\.hh$''
|
||||
''^src/libutil/util\.cc$''
|
||||
''^src/libutil/util\.hh$''
|
||||
''^src/libutil/variant-wrapper\.hh$''
|
||||
''^src/libutil/include/nix/util\.hh$''
|
||||
''^src/libutil/include/nix/variant-wrapper\.hh$''
|
||||
''^src/libutil/widecharwidth/widechar_width\.h$'' # vendored source
|
||||
''^src/libutil/windows/file-descriptor\.cc$''
|
||||
''^src/libutil/windows/file-path\.cc$''
|
||||
''^src/libutil/windows/processes\.cc$''
|
||||
''^src/libutil/windows/users\.cc$''
|
||||
''^src/libutil/windows/windows-error\.cc$''
|
||||
''^src/libutil/windows/windows-error\.hh$''
|
||||
''^src/libutil/windows/include/nix/windows-error\.hh$''
|
||||
''^src/libutil/xml-writer\.cc$''
|
||||
''^src/libutil/xml-writer\.hh$''
|
||||
''^src/libutil/include/nix/xml-writer\.hh$''
|
||||
''^src/nix-build/nix-build\.cc$''
|
||||
''^src/nix-channel/nix-channel\.cc$''
|
||||
''^src/nix-collect-garbage/nix-collect-garbage\.cc$''
|
||||
|
@ -481,9 +481,9 @@
|
|||
''^tests/nixos/ca-fd-leak/sender\.c''
|
||||
''^tests/nixos/ca-fd-leak/smuggler\.c''
|
||||
''^tests/nixos/user-sandboxing/attacker\.c''
|
||||
''^src/libexpr-test-support/tests/libexpr\.hh''
|
||||
''^src/libexpr-test-support/include/nix/tests/libexpr\.hh''
|
||||
''^src/libexpr-test-support/tests/value/context\.cc''
|
||||
''^src/libexpr-test-support/tests/value/context\.hh''
|
||||
''^src/libexpr-test-support/include/nix/tests/value/context\.hh''
|
||||
''^src/libexpr-tests/derived-path\.cc''
|
||||
''^src/libexpr-tests/error_traces\.cc''
|
||||
''^src/libexpr-tests/eval\.cc''
|
||||
|
@ -498,13 +498,13 @@
|
|||
''^src/libflake-tests/flakeref\.cc''
|
||||
''^src/libflake-tests/url-name\.cc''
|
||||
''^src/libstore-test-support/tests/derived-path\.cc''
|
||||
''^src/libstore-test-support/tests/derived-path\.hh''
|
||||
''^src/libstore-test-support/tests/nix_api_store\.hh''
|
||||
''^src/libstore-test-support/include/nix/tests/derived-path\.hh''
|
||||
''^src/libstore-test-support/include/nix/tests/nix_api_store\.hh''
|
||||
''^src/libstore-test-support/tests/outputs-spec\.cc''
|
||||
''^src/libstore-test-support/tests/outputs-spec\.hh''
|
||||
''^src/libstore-test-support/tests/path\.cc''
|
||||
''^src/libstore-test-support/tests/path\.hh''
|
||||
''^src/libstore-test-support/tests/protocol\.hh''
|
||||
''^src/libstore-test-support/include/nix/tests/outputs-spec\.hh''
|
||||
''^src/libstore-test-support/path\.cc''
|
||||
''^src/libstore-test-support/include/nix/tests/path\.hh''
|
||||
''^src/libstore-test-support/include/nix/tests/protocol\.hh''
|
||||
''^src/libstore-tests/common-protocol\.cc''
|
||||
''^src/libstore-tests/content-address\.cc''
|
||||
''^src/libstore-tests/derivation\.cc''
|
||||
|
@ -518,9 +518,9 @@
|
|||
''^src/libstore-tests/path\.cc''
|
||||
''^src/libstore-tests/serve-protocol\.cc''
|
||||
''^src/libstore-tests/worker-protocol\.cc''
|
||||
''^src/libutil-test-support/tests/characterization\.hh''
|
||||
''^src/libutil-test-support/tests/hash\.cc''
|
||||
''^src/libutil-test-support/tests/hash\.hh''
|
||||
''^src/libutil-test-support/include/nix/tests/characterization\.hh''
|
||||
''^src/libutil-test-support/hash\.cc''
|
||||
''^src/libutil-test-support/include/nix/tests/hash\.hh''
|
||||
''^src/libutil-tests/args\.cc''
|
||||
''^src/libutil-tests/canon-path\.cc''
|
||||
''^src/libutil-tests/chunked-vector\.cc''
|
||||
|
|
83
maintainers/link-headers
Executable file
83
maintainers/link-headers
Executable file
|
@ -0,0 +1,83 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
# This script must be run from the root of the Nix repository.
|
||||
#
|
||||
# For include path hygiene, we need to put headers in a separate
|
||||
# directory than sources. But during development, it is nice to paths
|
||||
# that are similar for headers and source files, e.g.
|
||||
# `foo/bar/baz.{cc,hh}`, e.g. for less typing when opening one file, and
|
||||
# then opening the other file.
|
||||
#
|
||||
# This script symlinks the headers next to the source files to
|
||||
# facilitate such a development workflows. It also updates
|
||||
# `.git/info/exclude` so that the symlinks are not accidentally committed
|
||||
# by mistake.
|
||||
|
||||
from pathlib import Path
|
||||
import subprocess
|
||||
import os
|
||||
|
||||
|
||||
def main() -> None:
|
||||
# Path to the source directory
|
||||
GIT_TOPLEVEL = Path(
|
||||
subprocess.run(
|
||||
["git", "rev-parse", "--show-toplevel"],
|
||||
text=True,
|
||||
stdout=subprocess.PIPE,
|
||||
check=True,
|
||||
).stdout.strip()
|
||||
)
|
||||
|
||||
# Get header files from git
|
||||
result = subprocess.run(
|
||||
["git", "-C", str(GIT_TOPLEVEL), "ls-files", "*/include/nix/**.hh"],
|
||||
text=True,
|
||||
stdout=subprocess.PIPE,
|
||||
check=True,
|
||||
)
|
||||
header_files = result.stdout.strip().split("\n")
|
||||
header_files.sort()
|
||||
|
||||
links = []
|
||||
for file_str in header_files:
|
||||
project_str, header_str = file_str.split("/include/nix/", 1)
|
||||
project = Path(project_str)
|
||||
header = Path(header_str)
|
||||
|
||||
# Reconstruct the full path (relative to SRC_DIR) to the header file.
|
||||
file = project / "include" / "nix" / header
|
||||
|
||||
# The symlink should be created at "project/header", i.e. next to the project's sources.
|
||||
link = project / header
|
||||
|
||||
# Compute a relative path from the symlink's parent directory to the actual header file.
|
||||
relative_source = os.path.relpath(
|
||||
GIT_TOPLEVEL / file, GIT_TOPLEVEL / link.parent
|
||||
)
|
||||
|
||||
# Create the symbolic link.
|
||||
full_link_path = GIT_TOPLEVEL / link
|
||||
full_link_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
if full_link_path.is_symlink():
|
||||
full_link_path.unlink()
|
||||
full_link_path.symlink_to(relative_source)
|
||||
links.append(link)
|
||||
|
||||
# Generate .gitignore file
|
||||
gitignore_path = GIT_TOPLEVEL / ".git" / "info" / "exclude"
|
||||
gitignore_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
with gitignore_path.open("w") as gitignore:
|
||||
gitignore.write("# DO NOT EDIT! Autogenerated\n")
|
||||
gitignore.write(
|
||||
"# Symlinks for headers to be next to sources for development\n"
|
||||
)
|
||||
gitignore.write('# Run "maintainers/link-headers" to regenerate\n\n')
|
||||
gitignore.write('# Run "maintainers/link-headers" to regenerate\n\n')
|
||||
|
||||
for link in links:
|
||||
gitignore.write(f"/{link}\n")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
|
@ -16,7 +16,6 @@ import('pkgconfig').generate(
|
|||
filebase : meson.project_name(),
|
||||
name : 'Nix',
|
||||
description : 'Nix Package Manager',
|
||||
subdirs : ['nix'],
|
||||
extra_cflags : ['-std=c++2a'],
|
||||
requires : requires_public,
|
||||
requires_private : requires_private,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Only execute this file once per shell.
|
||||
# This file is tested by tests/installer/default.nix.
|
||||
if [ -n "${__ETC_PROFILE_NIX_SOURCED:-}" ]; then return; fi
|
||||
__ETC_PROFILE_NIX_SOURCED=1
|
||||
export __ETC_PROFILE_NIX_SOURCED=1
|
||||
|
||||
NIX_LINK=$HOME/.nix-profile
|
||||
if [ -n "${XDG_STATE_HOME-}" ]; then
|
||||
|
|
|
@ -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 {
|
||||
|
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