Find a file
Rebecca Turner 0cee56db1a
Fix logging.sh test on macOS
On macOS in the `nix develop` shell, `make
tests/functional/logging.sh.test` errors:

    ++(logging.sh:18) mktemp
    +(logging.sh:18) builder=/var/folders/z5/fclwwdms3r1gq4k4p3pkvvc00000gn/T/tmp.StuabKUhMh
    +(logging.sh:19) echo -e '#!/bin/sh\nmkdir $out'
    +++(logging.sh:22) mktemp -d
    ++(logging.sh:22) nix-build -E 'with import ./config.nix; mkDerivation { name = "fnord"; builder = /var/folders/z5/fclwwdms3r1gq4k4p3pkvvc00000gn/T/tmp.StuabKUhMh; }' --out-link /var/folders/z5/fclwwdms3r1gq4k4p3pkvvc00000gn/T/tmp.oaKcy0NXqC/result
    error:
           … while calling the 'derivationStrict' builtin
             at <nix/derivation-internal.nix>:9:12:
                8|
                9|   strict = derivationStrict drvAttrs;
                 |            ^
               10|

           … while evaluating derivation 'fnord'
             whose name attribute is located at «string»:1:42

           … while evaluating attribute 'args' of derivation 'fnord'
             at /Users/wiggles/nix/tests/functional/config.nix:23:7:
               22|       builder = shell;
               23|       args = ["-e" args.builder or (builtins.toFile "builder-${args.name}.sh" ''
                 |       ^
               24|         if [ -e "$NIX_ATTRS_SH_FILE" ]; then source $NIX_ATTRS_SH_FILE; fi;

           error: path '/var' is a symlink
    +(logging.sh:22) outp=
    ++(logging.sh:22) onError
    ++(/Users/wiggles/nix/tests/functional/common/vars-and-functions.sh:237) set +x
    logging.sh: test failed at:
      main in logging.sh:22

This is because `mktemp` returns a path like
`/var/folders/z5/fclwwdms3r1gq4k4p3pkvvc00000gn/T/tmp.qDY24l6bIM`,
where `/var` is a symlink to `/private/var`.

Then, we attempt to use that path as a `builder`, which errors because
symlinks are impure or whatever.

Anyways, we can fix this by using `realpath "$(mktemp)"` instead of
`mktemp` directly.

NB: This error doesn't seem to happen when I run the tests through `nix
flake check`. I'm not sure if Nix does something to `TMP` in that case.
2023-12-18 14:04:25 -08:00
.github docs: add link to project board to PRs (#9630) 2023-12-18 15:45:57 +00:00
config Run autoupdate 2021-06-01 11:42:38 +02:00
contrib function-trace: always show the trace 2019-09-18 23:23:21 +02:00
doc Split --disable-tests, fix cross builds 2023-12-18 10:47:50 -05:00
m4 Add configure test to ensure GCC bug is fixed 2023-10-31 12:09:46 -04:00
maintainers flake.nix: Use config not system for cross so we can be a bit more precise 2023-12-11 12:31:27 -05:00
misc Remove custom lowdown 2023-12-13 16:25:18 -05:00
mk Split --disable-tests, fix cross builds 2023-12-18 10:47:50 -05:00
perl Store.xs: fix references to HashFormat::Nix32 2023-12-06 23:43:42 +01:00
scripts Restore comment 2023-12-13 15:33:15 -05:00
src Merge pull request #9628 from fricklerhandwerk/add-links 2023-12-18 13:07:39 +01:00
tests Fix logging.sh test on macOS 2023-12-18 14:04:25 -08:00
.dir-locals.el .dir-locals.el: Set c-block-comment-prefix 2020-07-10 11:21:06 +02:00
.editorconfig .editorconfig: Also affect Perl FFI xs file 2023-11-09 23:11:52 -05:00
.gitignore Move tests to separate directories, and document 2023-12-01 10:48:58 -05:00
.version Bump version 2023-11-20 15:06:28 +01:00
boehmgc-coroutine-sp-fallback.diff Fix boehmgc-coroutine-sp-fallback.diff for FreeBSD 2023-09-20 09:04:42 -04:00
boehmgc-traceable_allocator-public.diff Use boost::container::small_vector in place of VLAs 2023-11-21 20:52:27 +01:00
configure.ac Split --disable-tests, fix cross builds 2023-12-18 10:47:50 -05:00
CONTRIBUTING.md Merge pull request #9182 from fricklerhandwerk/popular-issues 2023-10-19 16:25:36 -04:00
COPYING * Change this to LGPL to keep the government happy. 2006-04-25 16:41:06 +00:00
default.nix add flake-compat to flake.nix and use sha256 in default.nix 2023-03-06 21:11:24 +01:00
docker.nix fix "add an option to include flake-registry..." 2023-05-16 14:35:31 +02:00
flake.lock Remove custom lowdown 2023-12-13 16:25:18 -05:00
flake.nix Move clang dev deps to the nix devshell override 2023-12-15 12:41:38 +01:00
local.mk Use positive source filtering for the standalone functional tests job 2023-10-09 08:29:27 -04:00
Makefile Split --disable-tests, fix cross builds 2023-12-18 10:47:50 -05:00
Makefile.config.in Split --disable-tests, fix cross builds 2023-12-18 10:47:50 -05:00
package.nix Split --disable-tests, fix cross builds 2023-12-18 10:47:50 -05:00
precompiled-headers.h Config: Use nlohmann/json 2020-08-20 11:02:16 +02:00
README.md fix: Remove extra to from README.md (#9213) 2023-10-23 19:20:23 +02:00
shell.nix Remove url literals 2022-01-24 13:28:21 +01:00

Nix

Open Collective supporters Test

Nix is a powerful package manager for Linux and other Unix systems that makes package management reliable and reproducible. Please refer to the Nix manual for more details.

Installation and first steps

Visit nix.dev for installation instructions and beginner tutorials.

Full reference documentation can be found in the Nix manual.

Building And Developing

See our Hacking guide in our manual for instruction on how to set up a development environment and build Nix from source.

Contributing

Check the contributing guide if you want to get involved with developing Nix.

Additional Resources

License

Nix is released under the LGPL v2.1.