lix/src
jade 1eef1927b6 libexpr: fix accessing uninitialized values and fix pure-eval docs
We got UBSan working on Lix, so we of course immediately found a bug and
some definitely nonsense behaviour.

Accessing `pureEval` or `restrictEval` from a default setting value is
nonsense, since they would never be actually set by the time that value
is set so they are not going to do anything. The configuration is not
applied in an initializer (and even if it were, it's not going to be in
the right order).

After looking into *that*, we hunted down what actually was applying
these, since clearly this code did not do anything. The EvalState
constructor should have a "search path added and removed here :)" sign
on it, because that's where it is done. We added an explicit
initialization of the optional in there because it was otherwise unclear
why pureEval also has the search path to allowed paths setup code run.

We then realized that the `pureEval` documentation was *also* bogus, and
we rewrote it. In so doing, we realized that we forgot to file a bug to
make `builtins.storePath` work in pure eval mode, so we filed one of
those: lix-project/lix#402

Yaks have been thoroughly shorn.

UBSan report:

    ../src/libexpr/eval-settings.cc:66:10: runtime error: member call on address 0x752fa9a13060 which does not point to an object of type 'nix::BaseSetting<b
    ool>'
    0x752fa9a13060: note: object has invalid vptr
     00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00
                  ^~~~~~~~~~~~~~~~~~~~~~~
                  invalid vptr
        0 0x752fa95106a6 in nix::EvalSettings::getDefaultNixPath[abi:cxx11]() /home/jade/lix/lix2/build/src/libexpr/eval-settings.cc:66:10
        1 0x752fa950e420 in nix::EvalSettings::EvalSettings() /home/jade/lix/lix2/build/src/libexpr/eval-settings.hh:36:15
        2 0x752fa9469f1f in __cxx_global_var_init.50 /home/jade/lix/lix2/build/src/libexpr/eval-settings.cc:98:14
        3 0x752fa9469f1f in _GLOBAL__sub_I_eval_settings.cc /home/jade/lix/lix2/build/src/libexpr/eval-settings.cc
        4 0x752fabbd308d in call_init (/nix/store/k7zgvzp2r31zkg9xqgjim7mbknryv6bs-glibc-2.39-52/lib/ld-linux-x86-64.so.2+0x508d) (BuildId: a5b8228edc9f16078ac3c894af964eeb990ecb4c)
        5 0x752fabbd317b in _dl_init (/nix/store/k7zgvzp2r31zkg9xqgjim7mbknryv6bs-glibc-2.39-52/lib/ld-linux-x86-64.so.2+0x517b) (BuildId: a5b8228edc9f16078ac3c894af964eeb990ecb4c)
        6 0x752fabbe9c2f in _dl_start_user (/nix/store/k7zgvzp2r31zkg9xqgjim7mbknryv6bs-glibc-2.39-52/lib/ld-linux-x86-64.so.2+0x1bc2f) (BuildId: a5b8228edc9f16078ac3c894af964eeb990ecb4c)

Change-Id: I5d8ffb7bfbe24b6584020ac74eed93d9f2e6d111
2024-06-18 19:25:35 -07:00
..
build-remote build-remote: truncate+hash store URI used in lockfile paths 2024-05-31 12:18:24 +00:00
libcmd libexpr: pass Exprs as references, not pointers 2024-06-17 19:46:44 +00:00
libexpr libexpr: fix accessing uninitialized values and fix pure-eval docs 2024-06-18 19:25:35 -07:00
libfetchers filetransfer: {up,down}load -> transfer 2024-06-18 23:58:25 +00:00
libmain build: expose option to enable or disable precompiled std headers 2024-06-06 12:46:26 -06:00
libstore filetransfer: {up,down}load -> transfer 2024-06-18 23:58:25 +00:00
libutil libutil: BrotliDecompression{Sink -> Source} 2024-06-19 00:54:06 +00:00
nix filetransfer: {up,down}load -> transfer 2024-06-18 23:58:25 +00:00
nix-build libexpr: pass Exprs as references, not pointers 2024-06-17 19:46:44 +00:00
nix-channel util.{hh,cc}: Split out users.{hh,cc} 2024-05-29 11:01:34 +02:00
nix-collect-garbage util.{hh,cc}: Split out file-system.{hh,cc} 2024-05-29 09:54:47 +02:00
nix-copy-closure Merge pull request #9277 from keszybz/file-permissions 2024-03-04 05:26:17 +01:00
nix-env libexpr: pass Exprs as references, not pointers 2024-06-17 19:46:44 +00:00
nix-instantiate libexpr: pass Exprs as references, not pointers 2024-06-17 19:46:44 +00:00
nix-store util.hh: Delete remaining file and clean up headers 2024-05-29 12:38:51 +02:00
pch build-time: remove 20% more by PCH'ing C++ stdlib 2024-05-30 21:54:21 +00:00
resolve-system-dependencies remove the autoconf+Make buildsystem 2024-05-07 17:04:30 -06:00
lix-base.pc.in packaging: rename nixexpr -> lixexpr and so on 2024-05-23 16:45:23 -06:00
meson.build meson: implement functional tests 2024-03-27 18:37:50 -06:00