Skip to content

Commit cc24766

Browse files
committed
Expose the nix component in header include paths
For example, instead of doing #include "nix/store-config.hh" #include "nix/derived-path.hh" Now do #include "nix/store/config.hh" #include "nix/store/derived-path.hh" This was originally planned in the issue, and also recent requested by Eelco. Most of the change is purely mechanical. There is just one small additional issue. See how, in the example above, we took this opportunity to also turn `<comp>-config.hh` into `<comp>/config.hh`. Well, there was already a `nix/util/config.{cc,hh}`. Even though there is not a public configuration header for libutil (which also would be called `nix/util/config.{cc,hh}`) that's still confusing, To avoid any such confusion, we renamed that to `nix/util/configuration.{cc,hh}`. Finally, note that the libflake headers already did this, so we didn't need to do anything to them. We wouldn't want to mistakenly get `nix/flake/flake/flake.hh`! Progress on #7876
1 parent 4de73df commit cc24766

File tree

647 files changed

+2570
-2572
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

647 files changed

+2570
-2572
lines changed

doc/manual/source/development/testing.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ The unit tests are defined using the [googletest] and [rapidcheck] frameworks.
3030
> src
3131
> ├── libexpr
3232
> │ ├── meson.build
33-
> │ ├── value/context.hh
34-
> │ ├── include/nix/value/context.cc
33+
> │ ├── include/nix/expr/value/context.hh
34+
> │ ├── value/context.cc
3535
> │ …
3636
> │
3737
> ├── tests
@@ -46,7 +46,7 @@ The unit tests are defined using the [googletest] and [rapidcheck] frameworks.
4646
> │ │
4747
> │ ├── libexpr-test-support
4848
> │ │ ├── meson.build
49-
> │ │ ├── include/nix
49+
> │ │ ├── include/nix/expr
5050
> │ │ │ ├── meson.build
5151
> │ │ │ └── tests
5252
> │ │ │ ├── value/context.hh
@@ -63,7 +63,7 @@ The unit tests are defined using the [googletest] and [rapidcheck] frameworks.
6363
> ```
6464
6565
The tests for each Nix library (`libnixexpr`, `libnixstore`, etc..) live inside a directory `src/${library_name_without-nix}-test`.
66-
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`.
66+
Given an interface (header) and implementation pair in the original library, say, `src/libexpr/include/nix/expr/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/expr/tests/value/context.hh` and `src/libexpr-test-support/tests/value/context.cc`.
6767
6868
Data for unit tests is stored in a `data` subdir of the directory for each unit test executable.
6969
For example, `libnixstore` code is in `src/libstore`, and its test data is in `src/libstore-tests/data`.

maintainers/flake-module.nix

Lines changed: 164 additions & 164 deletions
Large diffs are not rendered by default.

src/build-remote/build-remote.cc

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@
99
#include <sys/time.h>
1010
#endif
1111

12-
#include "nix/machines.hh"
13-
#include "nix/shared.hh"
14-
#include "nix/plugin.hh"
15-
#include "nix/pathlocks.hh"
16-
#include "nix/globals.hh"
17-
#include "nix/serialise.hh"
18-
#include "nix/build-result.hh"
19-
#include "nix/store-api.hh"
20-
#include "nix/strings.hh"
21-
#include "nix/derivations.hh"
22-
#include "nix/local-store.hh"
23-
#include "nix/legacy.hh"
24-
#include "nix/experimental-features.hh"
12+
#include "nix/store/machines.hh"
13+
#include "nix/main/shared.hh"
14+
#include "nix/main/plugin.hh"
15+
#include "nix/store/pathlocks.hh"
16+
#include "nix/store/globals.hh"
17+
#include "nix/util/serialise.hh"
18+
#include "nix/store/build-result.hh"
19+
#include "nix/store/store-api.hh"
20+
#include "nix/util/strings.hh"
21+
#include "nix/store/derivations.hh"
22+
#include "nix/store/local-store.hh"
23+
#include "nix/cmd/legacy.hh"
24+
#include "nix/util/experimental-features.hh"
2525

2626
using namespace nix;
2727
using std::cin;

src/libcmd/built-path.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
#include "nix/built-path.hh"
2-
#include "nix/derivations.hh"
3-
#include "nix/store-api.hh"
4-
#include "nix/comparator.hh"
1+
#include "nix/cmd/built-path.hh"
2+
#include "nix/store/derivations.hh"
3+
#include "nix/store/store-api.hh"
4+
#include "nix/util/comparator.hh"
55

66
#include <nlohmann/json.hpp>
77

src/libcmd/command-installable-value.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "nix/command-installable-value.hh"
1+
#include "nix/cmd/command-installable-value.hh"
22

33
namespace nix {
44

src/libcmd/command.cc

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
#include <algorithm>
22
#include <nlohmann/json.hpp>
33

4-
#include "nix/command.hh"
5-
#include "nix/markdown.hh"
6-
#include "nix/store-api.hh"
7-
#include "nix/local-fs-store.hh"
8-
#include "nix/derivations.hh"
9-
#include "nix/nixexpr.hh"
10-
#include "nix/profiles.hh"
11-
#include "nix/repl.hh"
12-
#include "nix/strings.hh"
13-
#include "nix/environment-variables.hh"
4+
#include "nix/cmd/command.hh"
5+
#include "nix/cmd/markdown.hh"
6+
#include "nix/store/store-api.hh"
7+
#include "nix/store/local-fs-store.hh"
8+
#include "nix/store/derivations.hh"
9+
#include "nix/expr/nixexpr.hh"
10+
#include "nix/store/profiles.hh"
11+
#include "nix/cmd/repl.hh"
12+
#include "nix/util/strings.hh"
13+
#include "nix/util/environment-variables.hh"
1414

1515
namespace nix {
1616

src/libcmd/common-eval-args.cc

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
#include "nix/fetch-settings.hh"
2-
#include "nix/eval-settings.hh"
3-
#include "nix/common-eval-args.hh"
4-
#include "nix/shared.hh"
5-
#include "nix/config-global.hh"
6-
#include "nix/filetransfer.hh"
7-
#include "nix/eval.hh"
8-
#include "nix/fetchers.hh"
9-
#include "nix/registry.hh"
1+
#include "nix/fetchers/fetch-settings.hh"
2+
#include "nix/expr/eval-settings.hh"
3+
#include "nix/cmd/common-eval-args.hh"
4+
#include "nix/main/shared.hh"
5+
#include "nix/util/config-global.hh"
6+
#include "nix/store/filetransfer.hh"
7+
#include "nix/expr/eval.hh"
8+
#include "nix/fetchers/fetchers.hh"
9+
#include "nix/fetchers/registry.hh"
1010
#include "nix/flake/flakeref.hh"
1111
#include "nix/flake/settings.hh"
12-
#include "nix/store-api.hh"
13-
#include "nix/command.hh"
14-
#include "nix/tarball.hh"
15-
#include "nix/fetch-to-store.hh"
16-
#include "nix/compatibility-settings.hh"
17-
#include "nix/eval-settings.hh"
12+
#include "nix/store/store-api.hh"
13+
#include "nix/cmd/command.hh"
14+
#include "nix/fetchers/tarball.hh"
15+
#include "nix/fetchers/fetch-to-store.hh"
16+
#include "nix/cmd/compatibility-settings.hh"
17+
#include "nix/expr/eval-settings.hh"
1818

1919
namespace nix {
2020

src/libcmd/editor-for.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#include "nix/editor-for.hh"
2-
#include "nix/environment-variables.hh"
3-
#include "nix/source-path.hh"
1+
#include "nix/cmd/editor-for.hh"
2+
#include "nix/util/environment-variables.hh"
3+
#include "nix/util/source-path.hh"
44

55
namespace nix {
66

src/libcmd/include/nix/built-path.hh renamed to src/libcmd/include/nix/cmd/built-path.hh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#pragma once
22
///@file
33

4-
#include "nix/derived-path.hh"
5-
#include "nix/realisation.hh"
4+
#include "nix/store/derived-path.hh"
5+
#include "nix/store/realisation.hh"
66

77
namespace nix {
88

src/libcmd/include/nix/command-installable-value.hh renamed to src/libcmd/include/nix/cmd/command-installable-value.hh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#pragma once
22
///@file
33

4-
#include "nix/installable-value.hh"
5-
#include "nix/command.hh"
4+
#include "nix/cmd/installable-value.hh"
5+
#include "nix/cmd/command.hh"
66

77
namespace nix {
88

0 commit comments

Comments
 (0)