fix tooling after include reorganization

clangd broke because it can't look through symlinks. compile_commands
manipulation does not fix it, clangd configuration does not fix it, a
vfs overlay does not fix it, and while a combination of those can fix
it with a bind mount in place that's just too cursed to even consider

clangd bug: https://github.com/llvm/llvm-project/issues/116877

Change-Id: I8e3e8489548eb3a7aa65ac9d12a5ec8abf814aec
This commit is contained in:
eldritch horrors 2024-11-19 21:51:21 +01:00 committed by jade
parent f116608a20
commit b0d7a81613
840 changed files with 108 additions and 109 deletions

View file

@ -1,6 +1,6 @@
[workspace] [workspace]
resolver = "2" resolver = "2"
members = ["src/lix-doc"] members = ["lix/lix-doc"]
[workspace.package] [workspace.package]
edition = "2021" edition = "2021"

View file

@ -1,25 +1,25 @@
internal_api_sources = [ internal_api_sources = [
'src/libcmd', 'lix/libcmd',
'src/libexpr', 'lix/libexpr',
'src/libexpr/flake', 'lix/libexpr/flake',
'tests/unit/libexpr', 'tests/unit/libexpr',
'tests/unit/libexpr/value', 'tests/unit/libexpr/value',
'tests/unit/libexpr/test', 'tests/unit/libexpr/test',
'tests/unit/libexpr/test/value', 'tests/unit/libexpr/test/value',
'src/libexpr/value', 'lix/libexpr/value',
'src/libfetchers', 'lix/libfetchers',
'src/libmain', 'lix/libmain',
'src/libstore', 'lix/libstore',
'src/libstore/build', 'lix/libstore/build',
'src/libstore/builtins', 'lix/libstore/builtins',
'tests/unit/libstore', 'tests/unit/libstore',
'tests/unit/libstore/test', 'tests/unit/libstore/test',
'src/libutil', 'lix/libutil',
'tests/unit/libutil', 'tests/unit/libutil',
'tests/unit/libutil/test', 'tests/unit/libutil/test',
'src/nix', 'lix/nix',
'src/nix-env', 'lix/nix-env',
'src/nix-store', 'lix/nix-store',
] ]
# We feed Doxygen absolute paths so it can be invoked from any working directory. # We feed Doxygen absolute paths so it can be invoked from any working directory.

View file

@ -17,10 +17,10 @@ Lix crashed. This is a bug. We would appreciate if you report it along with what
Exception: std::runtime_error: test exception Exception: std::runtime_error: test exception
Stack trace: Stack trace:
0# nix::printStackTrace() in /home/jade/lix/lix3/build/src/nix/../libutil/liblixutil.so 0# nix::printStackTrace() in /home/jade/lix/lix3/build/lix/nix/../libutil/liblixutil.so
1# 0x000073C9862331F2 in /home/jade/lix/lix3/build/src/nix/../libmain/liblixmain.so 1# 0x000073C9862331F2 in /home/jade/lix/lix3/build/lix/nix/../libmain/liblixmain.so
2# 0x000073C985F2E21A in /nix/store/p44qan69linp3ii0xrviypsw2j4qdcp2-gcc-13.2.0-lib/lib/libstdc++.so.6 2# 0x000073C985F2E21A in /nix/store/p44qan69linp3ii0xrviypsw2j4qdcp2-gcc-13.2.0-lib/lib/libstdc++.so.6
3# 0x000073C985F2E285 in /nix/store/p44qan69linp3ii0xrviypsw2j4qdcp2-gcc-13.2.0-lib/lib/libstdc++.so.6 3# 0x000073C985F2E285 in /nix/store/p44qan69linp3ii0xrviypsw2j4qdcp2-gcc-13.2.0-lib/lib/libstdc++.so.6
4# nix::handleExceptions(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::function<void ()>) in /home/jade/lix/lix3/build/src/nix/../libmain/liblixmain.so 4# nix::handleExceptions(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::function<void ()>) in /home/jade/lix/lix3/build/lix/nix/../libmain/liblixmain.so
... ...
``` ```

View file

@ -32,10 +32,10 @@ nix3_cli_files = custom_target(
conf_file_md = custom_target( conf_file_md = custom_target(
command : [ command : [
python.full_path(), python.full_path(),
'@SOURCE_ROOT@/src/code-generation/build_settings.py', '@SOURCE_ROOT@/lix/code-generation/build_settings.py',
'--kernel', host_machine.system(), '--kernel', host_machine.system(),
'--docs', '@OUTPUT@', '--docs', '@OUTPUT@',
'--experimental-features', '@SOURCE_ROOT@/src/libutil/experimental-features', '--experimental-features', '@SOURCE_ROOT@/lix/libutil/experimental-features',
'@INPUT@', '@INPUT@',
], ],
input : [ input : [

View file

@ -34,4 +34,4 @@ However, we do not live in such an ideal world, and currently this goal is so fa
# Currently available deprecated features # Currently available deprecated features
{{#include @generated@/../../../src/libutil/deprecated-feature-descriptions.md}} {{#include @generated@/../../../lix/libutil/deprecated-feature-descriptions.md}}

View file

@ -99,4 +99,4 @@ This means that experimental features and RFCs are orthogonal mechanisms, and ca
# Currently available experimental features # Currently available experimental features
{{#include @generated@/../../../src/libutil/experimental-feature-descriptions.md}} {{#include @generated@/../../../lix/libutil/experimental-feature-descriptions.md}}

View file

@ -102,14 +102,14 @@ $ meson compile -C build nixexpr
All targets may be addressed as their output, relative to the build directory, e.g.: All targets may be addressed as their output, relative to the build directory, e.g.:
```bash ```bash
$ meson compile -C build src/libexpr/liblixexpr.so $ meson compile -C build lix/libexpr/liblixexpr.so
``` ```
But Meson does not consider intermediate files like object files targets. But Meson does not consider intermediate files like object files targets.
To build a specific object file, use Ninja directly and specify the output file relative to the build directory: To build a specific object file, use Ninja directly and specify the output file relative to the build directory:
```bash ```bash
$ ninja -C build src/libexpr/liblixexpr.so.p/nixexpr.cc.o $ ninja -C build lix/libexpr/liblixexpr.so.p/nixexpr.cc.o
``` ```
To inspect the canonical source of truth on what the state of the buildsystem configuration is, use: To inspect the canonical source of truth on what the state of the buildsystem configuration is, use:
@ -137,7 +137,7 @@ You can also build Lix for one of the [supported platforms](#platforms).
Lix can be built for various platforms, as specified in [`flake.nix`]: Lix can be built for various platforms, as specified in [`flake.nix`]:
[`flake.nix`]: https://git.lix.systems/lix-project/lix/src/branch/main/flake.nix [`flake.nix`]: https://git.lix.systems/lix-project/lix/lix/branch/main/flake.nix
- `x86_64-linux` - `x86_64-linux`
- `x86_64-darwin` - `x86_64-darwin`
@ -413,8 +413,8 @@ Experimental and deprecated features support the following metadata properties:
This should also be the stem of the file name (with extension `md`). This should also be the stem of the file name (with extension `md`).
* `internalName` (required): identifier used to refer to the feature inside the C++ code. * `internalName` (required): identifier used to refer to the feature inside the C++ code.
Experimental feature data files should live in `src/libutil/experimental-features`, and deprecated features in `src/libutil/deprecated-features`. Experimental feature data files should live in `lix/libutil/experimental-features`, and deprecated features in `lix/libutil/deprecated-features`.
They must be listed in the `experimental_feature_definitions` or `deprecated_feature_definitions` lists in `src/libutil/meson.build` respectively to be considered by the build system. They must be listed in the `experimental_feature_definitions` or `deprecated_feature_definitions` lists in `lix/libutil/meson.build` respectively to be considered by the build system.
### Global settings ### Global settings
@ -441,7 +441,7 @@ Global settings support the following metadata properties:
Defaults to false if not specified. Defaults to false if not specified.
Settings are not collected in a single place in the source tree, so an appropriate place needs to be found for the setting to live. Settings are not collected in a single place in the source tree, so an appropriate place needs to be found for the setting to live.
Look for related setting definition files under second-level subdirectories of `src` whose name includes `settings`. Look for related setting definition files under second-level subdirectories of `lix` whose name includes `settings`.
Then add the new file there, and don't forget to register it in the appropriate `meson.build` file. Then add the new file there, and don't forget to register it in the appropriate `meson.build` file.
### Builtin functions ### Builtin functions
@ -458,7 +458,7 @@ The following metadata properties are supported for builtin functions:
* `experimental_feature` (optional): the user-facing name of the experimental feature which needs to be enabled for the bultin function to be available. * `experimental_feature` (optional): the user-facing name of the experimental feature which needs to be enabled for the bultin function to be available.
If not specified, no experimental feature is required. If not specified, no experimental feature is required.
New builtin function definition files must be added to `src/libexpr/builtins` and registered in the `builtin_definitions` list in `src/libexpr/meson.build`. New builtin function definition files must be added to `lix/libexpr/builtins` and registered in the `builtin_definitions` list in `lix/libexpr/meson.build`.
### Builtin constants ### Builtin constants
The following metadata properties are supported for builtin constants: The following metadata properties are supported for builtin constants:
@ -471,4 +471,4 @@ The following metadata properties are supported for builtin constants:
Impure constants are not available when pure evaluation mode is activated. Impure constants are not available when pure evaluation mode is activated.
Defaults to `false` when not specified. Defaults to `false` when not specified.
New builtin constant definition files must be added to `src/libexpr/builtin-constants` and registered in the `builtin_constant_definitions` list in `src/libexpr/meson.build`. New builtin constant definition files must be added to `lix/libexpr/builtin-constants` and registered in the `builtin_constant_definitions` list in `lix/libexpr/meson.build`.

View file

@ -13,7 +13,7 @@ The unit tests are defined using the [googletest] and [rapidcheck] frameworks.
> >
> ``` > ```
> … > …
> ├── src > ├── lix
> │   ├── libexpr > │   ├── libexpr
> │   │   ├── … > │   │   ├── …
> │   │   ├── value > │   │   ├── value
@ -46,10 +46,10 @@ The unit tests are defined using the [googletest] and [rapidcheck] frameworks.
> … … … … … … > … … … … … …
> ``` > ```
The unit tests for each Lix library (`liblixexpr`, `liblixstore`, etc..) live inside a directory `src/${library_shortname}/tests` within the directory for the library (`src/${library_shortname}`). The unit tests for each Lix library (`liblixexpr`, `liblixstore`, etc..) live inside a directory `lix/${library_shortname}/tests` within the directory for the library (`lix/${library_shortname}`).
The data is in `tests/unit/LIBNAME/data/LIBNAME`, with one subdir per library, with the same name as where the code goes. The data is in `tests/unit/LIBNAME/data/LIBNAME`, with one subdir per library, with the same name as where the code goes.
For example, `liblixstore` code is in `src/libstore`, and its test data is in `tests/unit/libstore/data/libstore`. For example, `liblixstore` code is in `lix/libstore`, and its test data is in `tests/unit/libstore/data/libstore`.
The path to the unit test data directory is passed to the unit test executable with the environment variable `_NIX_TEST_UNIT_DATA`. The path to the unit test data directory is passed to the unit test executable with the environment variable `_NIX_TEST_UNIT_DATA`.
### Running tests ### Running tests
@ -345,7 +345,7 @@ rg '(?:[^A-Za-z]|^)(_[A-Z][^-\[ }/:");$(]+)' -r '$1' --no-filename --only-matchi
rg '\$\{?([A-Z][^-\[ }/:");]+)' -r '$1' --no-filename --only-matching tests | sort -u > vars.txt rg '\$\{?([A-Z][^-\[ }/:");]+)' -r '$1' --no-filename --only-matching tests | sort -u > vars.txt
``` ```
I grepped `src/` for `get[eE]nv\("` to find the mentions in Lix code. I grepped `lix/` for `get[eE]nv\("` to find the mentions in Lix code.
### Used by Lix testing support code ### Used by Lix testing support code
@ -361,8 +361,8 @@ I grepped `src/` for `get[eE]nv\("` to find the mentions in Lix code.
- `_NIX_FORCE_HTTP` - Forces file URIs to be treated as remote ones. - `_NIX_FORCE_HTTP` - Forces file URIs to be treated as remote ones.
Used by `src/libfetchers/git.cc`, `src/libstore/http-binary-cache-store.cc`, Used by `lix/libfetchers/git.cc`, `lix/libstore/http-binary-cache-store.cc`,
`src/libstore/local-binary-cache-store.cc`. Seems to be for forcing Git `lix/libstore/local-binary-cache-store.cc`. Seems to be for forcing Git
clones of `git+file://` URLs, making the HTTP binary clones of `git+file://` URLs, making the HTTP binary
cache store accept `file://` URLs (presumably passing them to curl?), and cache store accept `file://` URLs (presumably passing them to curl?), and
unknown reasons for the local binary cache. unknown reasons for the local binary cache.
@ -374,7 +374,7 @@ I grepped `src/` for `get[eE]nv\("` to find the mentions in Lix code.
`structuredAttrs` documentation. `structuredAttrs` documentation.
- `NIX_BIN_DIR`, `NIX_STORE_DIR` (or its inconsistently-used old alias `NIX_STORE`), `NIX_DATA_DIR`, - `NIX_BIN_DIR`, `NIX_STORE_DIR` (or its inconsistently-used old alias `NIX_STORE`), `NIX_DATA_DIR`,
`NIX_LOG_DIR`, `NIX_LOG_DIR`, `NIX_STATE_DIR`, `NIX_CONF_DIR` - `NIX_LOG_DIR`, `NIX_LOG_DIR`, `NIX_STATE_DIR`, `NIX_CONF_DIR` -
Overrides compile-time configuration of various locations used by Lix. See `src/libstore/globals.cc`. Overrides compile-time configuration of various locations used by Lix. See `lix/libstore/globals.cc`.
**Expected value**: a directory **Expected value**: a directory
- `NIX_DAEMON_SOCKET_PATH` (optional) - Overrides the daemon socket path from `$NIX_STATE_DIR/daemon-socket/socket`. - `NIX_DAEMON_SOCKET_PATH` (optional) - Overrides the daemon socket path from `$NIX_STATE_DIR/daemon-socket/socket`.

View file

@ -4,7 +4,7 @@ These constants are built into the Nix language evaluator:
<dl> <dl>
{{#include @generated@/../../../src/libexpr/builtin-constants.md}} {{#include @generated@/../../../lix/libexpr/builtin-constants.md}}
</dl> </dl>

View file

@ -15,6 +15,6 @@ For convenience, some built-ins can be accessed directly:
<dd><p><var>derivation</var> is described in <dd><p><var>derivation</var> is described in
<a href="derivations.md">its own section</a>.</p></dd> <a href="derivations.md">its own section</a>.</p></dd>
{{#include @generated@/../../../src/libexpr/builtins.md}} {{#include @generated@/../../../lix/libexpr/builtins.md}}
</dl> </dl>

View file

@ -309,7 +309,7 @@ connected:
}); });
// See the very large comment in `case WorkerProto::Op::BuildDerivation:` in // See the very large comment in `case WorkerProto::Op::BuildDerivation:` in
// `src/libstore/daemon.cc` that explains the trust model here. // `lix/libstore/daemon.cc` that explains the trust model here.
// //
// This condition mirrors that: that code enforces the "rules" outlined there; // This condition mirrors that: that code enforces the "rules" outlined there;
// we do the best we can given those "rules". // we do the best we can given those "rules".

View file

@ -53,8 +53,8 @@ libcmd = library(
nlohmann_json, nlohmann_json,
liblix_doc, liblix_doc,
], ],
# '../include' for self references like "lix/libcmd/*.hh" # '../..' for self references like "lix/libcmd/*.hh"
include_directories : [ '../include' ], include_directories : [ '../..' ],
cpp_pch : cpp_pch, cpp_pch : cpp_pch,
install : true, install : true,
# FIXME(Qyriad): is this right? # FIXME(Qyriad): is this right?
@ -71,7 +71,7 @@ custom_target(
) )
liblixcmd = declare_dependency( liblixcmd = declare_dependency(
include_directories : include_directories('../include'), include_directories : include_directories('../..'),
link_with : libcmd, link_with : libcmd,
) )

Some files were not shown because too many files have changed in this diff Show more