1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2024-10-18 00:16:11 -04:00

Compare commits

...

126 commits

Author SHA1 Message Date
Silvan Mosberger c4fb59e1d7
Merge 8bd591db03 into f51974d698 2024-10-16 20:27:01 +02:00
Robert Hensing f51974d698
Merge pull request #11665 from roberth/fix-Interrupted-falling-out-of-thread
Fix `Interrupted` falling out of thread crash
2024-10-16 20:09:29 +02:00
Robert Hensing ed184f0b61
Typo
Co-authored-by: Cole Helbling <cole.e.helbling@outlook.com>
2024-10-16 19:40:45 +02:00
Eelco Dolstra facc502bc8
Merge pull request #11695 from DeterminateSystems/override-lastModified
path fetcher: Allow the lastModified attribute to be overriden again
2024-10-16 18:03:29 +02:00
Robert Hensing fd8a4a86d9 ThreadPool: don't silently ignore non-std exceptions
Introduced in 8f6b347abd without explanation.

Throwing anything that's not that is a programming mistake that we don't want
to ignore silently. A crash would be ok, because that means we/they can fix
the offending throw.
2024-10-16 17:56:08 +02:00
Robert Hensing 16320f6d24 Handle ThreadPoolShutdown with normal catch 2024-10-16 17:56:08 +02:00
Robert Hensing 3f9ff10786 ThreadPool: catch Interrupted 2024-10-16 17:56:08 +02:00
Robert Hensing de41e46175 Document recursive-nix startDaemon/stopDaemon 2024-10-16 17:56:08 +02:00
Robert Hensing 0e5a5303ad fix: Ignore Interrupted in recursive-nix daemon worker
Otherwise, if checkInterrupt() in any of the supported store operations
would catch onto a user interrupt, the exception would bubble to the thread
start and be handled by std::terminate(): a crash.
2024-10-16 17:56:08 +02:00
Eelco Dolstra de1289229f
Merge pull request #11669 from obsidiansystems/doc-source-rename
Make the subproject dir `src` again
2024-10-16 17:30:40 +02:00
Eelco Dolstra 781ff7672e Add test 2024-10-16 17:18:07 +02:00
Robert Hensing 806a91f7bf
Merge pull request #11688 from roberth/meson-tidy
Clean up the `package.nix` files
2024-10-14 17:40:46 +02:00
John Ericson 379ada42bc Make the subproject dir src again
We got rid of this in c7ec33605e because
of bug https://github.com/mesonbuild/meson/issues/13774, but in the
previous commit we renamed the manual source directory, which avoids it.
Now we can change it back.
2024-10-14 11:21:24 -04:00
John Ericson eb7d7780b1 Rename doc/manual{src -> source}
This is needed to avoid this
https://github.com/mesonbuild/meson/issues/13774 when we go back to
making our subproject directory `src`.
2024-10-14 11:21:24 -04:00
Eelco Dolstra 5d35424445 path fetcher: Allow the lastModified attribute to be overriden again
Fixes #11660.
2024-10-14 16:17:18 +02:00
Eelco Dolstra d5c45952ac
Merge pull request #11690 from DeterminateSystems/non-contiguous-tarballs
Handle tarballs where directory entries are not contiguous
2024-10-14 14:50:31 +02:00
Eelco Dolstra b11c331c53
Merge pull request #11684 from geofft/real-root-mode-0500
libstore: Make our sandbox pivot_root directory accessible to ourself
2024-10-14 14:35:37 +02:00
Eelco Dolstra a7b9877da9 Add a test 2024-10-14 14:10:36 +02:00
Eelco Dolstra 71c2d82302
Merge pull request #11677 from DeterminateSystems/fix-s3-crash
builtins.fetchurl: Fix segfault on s3:// URLs
2024-10-14 13:55:49 +02:00
Eelco Dolstra 4012954b59 Handle tarballs where directory entries are not contiguous
I.e. when not all entries underneath a directory X follow eachother,
but there is some entry Y that isn't a child of X in between.

Fixes #11656.
2024-10-14 13:53:54 +02:00
Eelco Dolstra d2f4d07619 Add assert 2024-10-14 13:15:55 +02:00
Robert Hensing 15e3e1543b packaging: Add mkMeson{Library,Executable}
and:
- move pkg-config out of mkMesonDerivation, for components that don't
  produce any executable code
2024-10-13 23:17:54 +02:00
Robert Hensing e10ff893e5 packaging: Factor out mkPackageBuilder 2024-10-13 22:43:06 +02:00
Robert Hensing 0aef34b790 packaging: Add mesonLayer
... and remove a few unused arguments.

This adds pkg-config to a two or three packages that don't use it,
but we shouldn't let that bother us. It's like our personal stdenv.
2024-10-13 22:39:53 +02:00
Robert Hensing d21026b6f1 packaging: Remove package.nix from libexpr src 2024-10-13 22:18:57 +02:00
Robert Hensing 0a49d1e0d2 refactor: lib.composeManyExtensions 2024-10-13 22:03:52 +02:00
Robert Hensing ab0f9f9089
Merge pull request #11680 from Mic92/git-utils
git-utils: fix x86_64-w64-mingw32 build
2024-10-13 13:09:00 +02:00
Valentin Gagarin de0a34a362
doc: note that nix eval is eager (#11670)
doc: note that `nix eval` is eager

---------

Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2024-10-13 12:31:01 +02:00
Robert Hensing 3c59df412a nix/meson.build: Rename name_suffix -> executable_suffix 2024-10-13 12:29:48 +02:00
Geoffrey Thomas 5a794d9366 libstore: Make our sandbox pivot_root directory accessible to ourself
If you have the Nix store mounted from a nonlocal filesystem whose
exporter is not running as root, making the directory mode 000 makes it
inaccessible to that remote unprivileged user and therefore breaks the
build. (Specifically, I am running into this with a virtiofs mount using
Apple Virtualization.framework as a non-root user, but I expect the
same thing would happen with virtiofs in qemu on Linux as a non-root
user or with various userspace network file servers.)

Make the directory mode 500 (dr-x------) to make the sandbox work in
this use case, which explicitly conveys our intention to read and search
the directory.  The code only works because root can already bypass
directory checks, so this does not actually grant more permissions to
the directory owner / does not make the sandbox less secure.
2024-10-12 19:55:58 -04:00
Robert Hensing 30c4f5eb51
Merge pull request #11682 from NaN-git/opt-str
Remove superfluous `std::string` copy operations
2024-10-12 10:59:40 +02:00
Jörg Thalheim bd1961b7cc meson: fix executable extensions for windows build 2024-10-11 21:50:50 +02:00
Jörg Thalheim 30655dd146 git-utils: fix x86_64-w64-mingw32 build 2024-10-11 21:04:52 +02:00
Eelco Dolstra d38f62f64d Make S3 downloads slightly more interruptable 2024-10-11 14:55:22 +02:00
Eelco Dolstra 0500fba56a builtins.fetchurl: Fix segfault on s3:// URLs
Also, add an activity to show that we're downloading an s3:// file.

Fixes #11674.
2024-10-11 14:32:34 +02:00
Valentin Gagarin dbcd4cd6ba
Merge pull request #11671 from onnimonni/patch-1
Fix deprecated example from distributed-builds.md
2024-10-10 21:19:44 +02:00
Onni Hakala e6db2dafe6
Update distributed-builds.md
Fixes deprecation warning from nix build:

warning: 'nix store ping' is a deprecated alias for 'nix store info'
2024-10-10 20:35:55 +03:00
Eelco Dolstra 4202d4fc81
Merge pull request #11664 from DeterminateSystems/show-sandbox-setup-error
Propagate errors from early sandbox initialization to the parent
2024-10-10 17:01:37 +02:00
Jacek Galowicz 39da9462e9
Document common options in stable nix binaries (#11663) 2024-10-10 09:00:01 +00:00
Robert Hensing 4db9487823
Merge pull request #11650 from obsidiansystems/nix-eval-slight-fs-cleanup
Slightly more `std::filesystem` for `nix eval`
2024-10-09 22:55:58 +02:00
Robert Hensing d4b9977f83
Merge pull request #11224 from NixOS/meson-misc
Build manual with Meson
2024-10-09 22:38:29 +02:00
Eelco Dolstra 0be70469dc Propagate errors from early sandbox initialization to the parent
This should help with issues like
https://github.com/DeterminateSystems/nix-installer/issues/1227, which
currently just print "unable to start build process".
2024-10-09 20:53:43 +02:00
John Ericson 08b59aad31 Build the manual with Meson
Co-Authored-By: Qyriad <qyriad@qyriad.me>
Co-Authored-By: Robert Hensing <robert@roberthensing.nl>
Co-Authored-By: eldritch horrors <pennae@lix.systems>
Co-authored-by: Jörg Thalheim <Mic92@users.noreply.github.com>
Co-authored-by: Tom Bereknyei <tomberek@gmail.com>
2024-10-09 11:58:17 -04:00
John Ericson 8b2ffbae3a
Merge pull request #11662 from obsidiansystems/misc-changes
Misc changes
2024-10-09 11:52:37 -04:00
John Ericson 67a66212c3 Extend Nix repl missing executable error message
Co-Authored-By: Robert Hensing <robert@roberthensing.nl
2024-10-09 11:08:31 -04:00
John Ericson 6594573f3d Remove dead code in the Meson build system
Identified in https://github.com/NixOS/nix/pull/11224#discussion_r1715056429

Co-Authored-By: Robert Hensing <robert@roberthensing.nl>
2024-10-09 11:07:15 -04:00
John Ericson 0db8ff820b More comment rewording as requested
Co-Authored-By: Robert Hensing <robert@roberthensing.nl>
2024-10-09 11:07:15 -04:00
John Ericson f7db612e8b Reword next release release note a bit
This is unrelated to this PR, but requested in https://github.com/NixOS/nix/pull/11224#discussion_r1715031841

Co-Authored-By: Robert Hensing <robert@roberthensing.nl>
2024-10-09 11:07:15 -04:00
John Ericson 57a478572d Rename baseNativeBuildInputs
as requested

Co-Authored-By: Robert Hensing <robert@roberthensing.nl>
2024-10-09 11:07:12 -04:00
Eelco Dolstra c8d49993ec
Merge pull request #11654 from NixOS/dependabot/github_actions/cachix/install-nix-action-30
build(deps): bump cachix/install-nix-action from 29 to 30
2024-10-08 14:45:33 +02:00
Philipp Otterbein a353a99269 cont. cleanup: remove superfluous std::string copies 2024-10-08 02:25:52 +02:00
Philipp Otterbein de96f632f8 std::string_view shall not be null terminated 2024-10-08 02:25:14 +02:00
dependabot[bot] 06255654a7
build(deps): bump cachix/install-nix-action from 29 to 30
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 29 to 30.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v29...v30)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-07 22:41:39 +00:00
John Ericson b5c88650c5 Slightly more std::filesystem for nix eval
Progress on #9205
2024-10-07 12:10:17 -04:00
Robert Hensing 26c3fc11ea
Merge pull request #11609 from yannham/fix/nar-test-zfs
Fix NAR tests on Linux+ZFS+normalize
2024-10-07 16:16:15 +02:00
Robert Hensing 011fa9e085
tests/functional/nars.sh: Fail test if touch fails, comment
Co-authored-by: Jörg Thalheim <Mic92@users.noreply.github.com>
2024-10-07 14:54:35 +02:00
Eelco Dolstra 4dc7946acd
Merge pull request #11610 from Mic92/ssl-fix
fix passing CA files into builtins:fetchurl sandbox
2024-10-07 14:41:32 +02:00
Philipp Otterbein e21c7895eb MacOS built: add workaround for missing view() member of std::ostringstream 2024-10-07 02:05:53 +02:00
Philipp Otterbein caf3b55891 cont. cleanup: remove superfluous std::string copies 2024-10-07 01:15:44 +02:00
Valentin Gagarin 0dc8419c11
Merge pull request #11640 from VinayakKaushikDH/patch-1
Fix typo in uninstall.md
2024-10-06 22:25:41 +02:00
Vinayak Kaushik c88e901096
Fix typo in uninstall.md 2024-10-06 19:26:42 +02:00
Philipp Otterbein 4c0c8e5428 cleanup: remove superfluous std::string copies 2024-10-06 13:43:29 +02:00
John Ericson 5e5c97962c
Merge pull request #11639 from DeterminateSystems/avoid-json-header
experimental-features.hh: Don't include json-utils.hh
2024-10-05 13:44:37 -04:00
Eelco Dolstra 15e5684884 experimental-features.hh: Don't include json-utils.hh
This caused nlohmann/json.hpp to leak into a lot of compilation units,
which is slow (when not using precompiled headers).

Cuts build time from 46m24s to 42m5s (real time with -j24: 2m42s to
2m24s).
2024-10-04 15:59:35 +02:00
Eelco Dolstra 4e8a9e0ed4
Merge pull request #11631 from DeterminateSystems/remove-ca-schema-migrations
Cleanup: Remove migrations for ancient CA schemas
2024-10-03 16:38:05 +02:00
Eelco Dolstra 94f649fad5 Cleanup: Remove migrations for ancient CA schemas
These versions are more than 3 years old and were very early in the
existence of CA derivations support (which was and is experimental),
so they're unlikely to still exist in the real world. So let's get rid
of support for them.
2024-10-03 15:56:30 +02:00
Robert Hensing a6b121ce2d
Merge pull request #11629 from roberth/fix-fragments-1
doc/manual: Fix some broken fragments
2024-10-03 01:48:04 +02:00
Robert Hensing 071ddbed57 doc/manual: Fix some broken fragments 2024-10-03 01:17:53 +02:00
Eelco Dolstra f5a2f2a8f8
Merge pull request #11560 from rhendric/rhendric/deprecate-cursed-or
libexpr: deprecate the bogus "or"-as-variable
2024-10-02 19:11:56 +02:00
Valentin Gagarin 96ba7f9d77
Merge pull request #11626 from fricklerhandwerk/nix-install-instruction
doc: don't use bash substitution in install command
2024-10-01 22:51:10 +02:00
Valentin Gagarin b6656160ba doc: don't use bash substitution in install command 2024-10-01 17:28:43 +02:00
Eelco Dolstra 3e7b42dd89
Merge pull request #11618 from NixOS/ignoreException-interrupt
Split ignoreException for destructors vs interrupt-safe
2024-10-01 17:10:39 +02:00
Eelco Dolstra 96c326a7bf
Merge pull request #11623 from NixOS/dependabot/github_actions/cachix/install-nix-action-v29
Bump cachix/install-nix-action from V28 to 29
2024-10-01 17:03:27 +02:00
Robert Hensing 417d5565b1
Merge pull request #11619 from NaN-git/fix-disable-gc
fix: include missing header when GC is disabled
2024-10-01 14:55:22 +02:00
Robert Hensing dc89eab7f4
Merge pull request #11620 from NaN-git/cleanup-eval
eval: remove superfluous strdup
2024-10-01 14:48:29 +02:00
Valentin Gagarin b7b9acd080
Merge pull request #11621 from kevincox/patch-1
Improve documentation of `nix flake lock`
2024-10-01 08:33:13 +02:00
dependabot[bot] 348cca088c
Bump cachix/install-nix-action from V28 to 29
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from V28 to 29. This release includes the previously tagged commit.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/V28...v29)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-30 22:28:36 +00:00
Kevin Cox d2f627dda9
Improve documentation of nix flake lock
The previous documentation was inaccurate, stating that it would not update existing inputs. However these inputs will be updated if they are outdated (for example the version of an existing input has been changed). The new text properly reflects this behaviour.
2024-09-30 17:27:49 -04:00
Philipp Otterbein 5cf6b2cb75 eval: remove superfluous strdup 2024-09-30 22:15:04 +02:00
Philipp Otterbein c7db10000c fix: include missing header when GC is disabled 2024-09-30 21:27:06 +02:00
tomberek 14f029dbe8
Merge pull request #11489 from bryanhonof/bryanhonof.warn-on-malformed-uri-query
fix: warn on malformed URI query parameter
2024-09-30 12:14:40 -04:00
Yann Hamdaoui f8268cbe16
Fix NAR tests on Linux+ZFS+normalize
A test added recently checks that when trying to deserialize a NAR with
two files that Unicode-normalize to the same result either succeeds on
Linux, or fails with an "already exists" error on Darwin. However,
failing with an "already exists" error can in fact also happen on Linux,
when using ZFS with the proper utf8 and Unicode normalization options
set.

This commit fixes the issue by not assuming the behavior from the
current system, but just by blindly checking that either one of the two
aforementioned possibilities happen, whether on Darwin or on Linux.

Additionally, we check that the Unicode normalization behaviour of
nix-store is the same as the host file system.
2024-09-30 16:29:51 +02:00
Bryan Honof 5150a962f5
test(functional/flakes): add dubious-query
Co-authored-by: Jörg Thalheim <Mic92@users.noreply.github.com>
2024-09-30 14:44:06 +02:00
Bryan Honof 1f024ecfcd
fix: warn on malformed URI query parameter 2024-09-30 14:44:06 +02:00
Robert Hensing c116030605
Merge pull request #11602 from Mic92/macos-test-fix
tests/functional/flakes/run: fix tests in macOS devshell
2024-09-30 13:37:54 +02:00
Robert Hensing 4e31360637
Reference issue in tests/functional/flakes/run.sh 2024-09-30 13:02:51 +02:00
Robert Hensing 3df619339c Split ignoreException for destructors or interrupt-safe 2024-09-30 11:50:25 +02:00
Valentin Gagarin a1415471b8
Merge pull request #11611 from jljusten/spelling-fixes 2024-09-30 01:20:40 +02:00
tomberek 973d4ede84
Merge pull request #11614 from Gerg-L/master
nix-ng: add meta.mainProgram
2024-09-29 18:28:56 -04:00
Gerg-L a614fbb2a2
nix-ng: add meta.mainProgram 2024-09-29 15:04:41 -04:00
Valentin Gagarin 79138183a9
Merge pull request #11613 from NixOS/nix-fmt-doc
doc/nix fmt: Do not document behavior we do not control
2024-09-29 20:48:43 +02:00
Robert Hensing 8c4842de8c doc/nix fmt: Do not document behavior we do not control
This leads to confusion about what the command does.
E.g. https://github.com/NixOS/nix/issues/9359

- Move the description up

- Remove details about the individual formatters
2024-09-29 19:53:36 +02:00
Jordan Justen 3b6cf350e7
doc, src: Fix various spelling typos
Signed-off-by: Jordan Justen <jljusten@gmail.com>
2024-09-28 15:29:15 -07:00
Jörg Thalheim 410853ddcf tests/nixos/fetchurl: drop unused variables 2024-09-28 17:08:18 +02:00
Puck Meerburg c1ecf0bee9 fix passing CA files into builtins:fetchurl sandbox
This patch has been manually adapted from
14dc84ed03

Tested with:

$ NIX_SSL_CERT_FILE=$(nix-build '<nixpkgs>' -A cacert)/etc/ssl/certs/ca-bundle.crt nix-build --store $(mktemp -d) -E 'import <nix/fetchurl.nix> { url = https://google.com; }'
Finished at 16:57:50 after 1s
warning: found empty hash, assuming 'sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA='
this derivation will be built:
nix-output-monitor error: DerivationReadError /nix/store/4qljhy0jj2b0abjzpsbyarpia1bqylwc-google.com.drv: openFile: does not exist (No such file or directory)
  /nix/store/4qljhy0jj2b0abjzpsbyarpia1bqylwc-google.com.drv
nix-output-monitor error: DerivationReadError /nix/store/4qljhy0jj2b0abjzpsbyarpia1bqylwc-google.com.drv: openFile: does not exist (No such file or directory)
nix-output-monitor error: DerivationReadError /nix/store/4qljhy0jj2b0abjzpsbyarpia1bqylwc-google.com.drv: openFile: does not exist (No such file or directory)
nix-output-monitor error: DerivationReadError /nix/store/4qljhy0jj2b0abjzpsbyarpia1bqylwc-google.com.drv: openFile: does not exist (No such file or directory)
google.com> building '/nix/store/4qljhy0jj2b0abjzpsbyarpia1bqylwc-google.com.drv'
nix-output-monitor error: DerivationReadError /nix/store/4qljhy0jj2b0abjzpsbyarpia1bqylwc-google.com.drv: openFile: does not exist (No such file or directory)
google.com> error:
nix-output-monitor error: DerivationReadError /nix/store/4qljhy0jj2b0abjzpsbyarpia1bqylwc-google.com.drv: openFile: does not exist (No such file or directory)
google.com>        … writing file '/nix/store/0zynn4n8yx59bczy1mgh1lq2rnprvvrc-google.com'
nix-output-monitor error: DerivationReadError /nix/store/4qljhy0jj2b0abjzpsbyarpia1bqylwc-google.com.drv: openFile: does not exist (No such file or directory)
google.com>
nix-output-monitor error: DerivationReadError /nix/store/4qljhy0jj2b0abjzpsbyarpia1bqylwc-google.com.drv: openFile: does not exist (No such file or directory)
google.com>        error: unable to download 'https://google.com': Problem with the SSL CA cert (path? access rights?) (77) error setting certificate file: /nix/store/nlgbippbbgn38hynjkp1ghiybcq1dqhx-nss-cacert-3.101.1/etc/ssl/certs/ca-bundle.crt
nix-output-monitor error: DerivationReadError /nix/store/4qljhy0jj2b0abjzpsbyarpia1bqylwc-google.com.drv: openFile: does not exist (No such file or directory)
nix-output-monitor error: DerivationReadError /nix/store/4qljhy0jj2b0abjzpsbyarpia1bqylwc-google.com.drv: openFile: does not exist (No such file or directory)
error: builder for '/nix/store/4qljhy0jj2b0abjzpsbyarpia1bqylwc-google.com.drv' failed with exit code 1

Now returns:

nix-env % NIX_SSL_CERT_FILE=$(nix-build '<nixpkgs>' -A cacert)/etc/ssl/certs/ca-bundle.crt nix-build --store $(mktemp -d) -E 'import <nix/fetchurl.nix> { url = https://google.com; }'
Finished at 17:05:48 after 0s
warning: found empty hash, assuming 'sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA='
this derivation will be built:
nix-output-monitor error: DerivationReadError /nix/store/4qljhy0jj2b0abjzpsbyarpia1bqylwc-google.com.drv: openFile: does not exist (No such file or directory)
  /nix/store/4qljhy0jj2b0abjzpsbyarpia1bqylwc-google.com.drv
nix-output-monitor error: DerivationReadError /nix/store/4qljhy0jj2b0abjzpsbyarpia1bqylwc-google.com.drv: openFile: does not exist (No such file or directory)
nix-output-monitor error: DerivationReadError /nix/store/4qljhy0jj2b0abjzpsbyarpia1bqylwc-google.com.drv: openFile: does not exist (No such file or directory)
nix-output-monitor error: DerivationReadError /nix/store/4qljhy0jj2b0abjzpsbyarpia1bqylwc-google.com.drv: openFile: does not exist (No such file or directory)
google.com> building '/nix/store/4qljhy0jj2b0abjzpsbyarpia1bqylwc-google.com.drv'
nix-output-monitor error: DerivationReadError /nix/store/4qljhy0jj2b0abjzpsbyarpia1bqylwc-google.com.drv: openFile: does not exist (No such file or directory)
nix-output-monitor error: DerivationReadError /nix/store/4qljhy0jj2b0abjzpsbyarpia1bqylwc-google.com.drv: openFile: does not exist (No such file or directory)
error: hash mismatch in fixed-output derivation '/nix/store/4qljhy0jj2b0abjzpsbyarpia1bqylwc-google.com.drv':
         specified: sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
2024-09-28 17:08:16 +02:00
Eelco Dolstra 08deebddf2
Merge pull request #11600 from DeterminateSystems/fix-uncaught-exception
HttpBinaryCacheStore::getFile(): Fix uncaught exception
2024-09-27 12:37:12 +02:00
Eelco Dolstra f8bd7e7e5c
Merge pull request #11598 from joshheinrichs-shopify/fix-http-cache-reference
Fix reference to HTTP Binary Cache Store in docs
2024-09-27 11:43:41 +02:00
Jörg Thalheim 3b0c5ab835 tests/functional/flakes/run: fix tests in macOS devshell
same fix as in 04a47e93f6
2024-09-27 11:07:50 +02:00
Valentin Gagarin aee34e4776
fix location 2024-09-27 11:07:04 +02:00
Eelco Dolstra 4566854981 HttpBinaryCacheStore::getFile(): Fix uncaught exception
This method is marked as `noexcept`, but `enqueueFileTransfer()` can
throw `Interrupted` if the user has hit Ctrl-C or if the `ThreadPool`
that the thread is a part of is shutting down.
2024-09-27 00:16:52 +02:00
Eelco Dolstra 0ed67e5b7e
Merge pull request #11581 from Mic92/git-cache
create git caches atomically
2024-09-26 21:58:22 +02:00
Josh Heinrichs 1271a95b79
Fix reference to HTTP Binary Cache Store in docs 2024-09-26 12:30:41 -06:00
Jörg Thalheim 12d5b2cfa1 create git caches atomically
When working on speeding up the CI,
I triggered a race condition in the creation of the tarball cache.
This code now instead will ensure that half-initialized repositories
are no longer visible to any other nix process.

This is the error message that I got before:

error: opening Git repository '"/Users/runner/.cache/nix/tarball-cache"': could not find repository at '/Users/runner/.cache/nix/tarball-cache'
2024-09-26 17:46:25 +02:00
Jason Yundt a5959aa121
docs: specify that flake.lock files are JSON (#11594)
* docs: specify that flake.lock files are JSON

Recently, I decided that I was going to write some code that would parse
flake.lock files. I went to the Nix Reference Manual in order to look up
information on the format of flake.lock files, and I realized that a key
detail was missing from the Nix Reference Manual: it never says that
flake.lock files are JSON files. This commit fixes that issue.

This commit makes sure to specify that flake.lock files are encoded in
UTF-8. Confusingly, there’s multiple different JSON standards. Neither
ECMA-404, 2nd Edition [1] nor ISO/IEC 21778:2017 [2] mention UTF-8. RFC
8259 requires UTF-8, but only sometimes [3]. I chose to explicitly
specify that flake.lock files are UTF-8 in order to avoid any possible
ambiguities from the JSON standards.

[1]: <https://ecma-international.org/publications-and-standards/standards/ecma-404>
[2]: <https://www.iso.org/standard/71616.html>
[3]: <https://www.rfc-editor.org/rfc/rfc8259.html#section-8.1>
2024-09-26 00:21:33 +00:00
Eelco Dolstra 4dc4e81b1e
Merge pull request #11593 from DeterminateSystems/typo
Fix typo
2024-09-26 00:55:46 +02:00
Eelco Dolstra ef8987955b Typo 2024-09-26 00:15:04 +02:00
Eelco Dolstra 062b4a489e
Merge pull request #11585 from NixOS/verify-tls
builtin:fetchurl: Enable TLS verification
2024-09-25 23:52:25 +02:00
Eelco Dolstra 7b39cd631e Add release note 2024-09-25 23:07:11 +02:00
Valentin Gagarin 6c37d81514
Merge pull request #11584 from Mic92/devdocs 2024-09-25 13:44:49 +02:00
Jörg Thalheim eb3a368a33 docs/testing: add --verbose flag for running single tests
Most of the time people run single tests for debugging reason,
so it's a sane default to have them see all the console output.

This commit still retains the section about running tests directly with
meson, because in some debugging cases it's just nice to have less
abstractions i.e. when using strace.
2024-09-25 09:46:29 +02:00
Eelco Dolstra f2f47fa725 Add a test for builtin:fetchurl cert verification 2024-09-24 16:13:28 +02:00
John Ericson 322d2c767f
Merge pull request #11523 from obsidiansystems/base64Decode-no-leak-private-key-on-error
Ensure error messages don't leak private key
2024-09-23 17:13:32 -04:00
John Ericson 2b6b03d8df Ensure error messages don't leak private key
Since #8766, invalid base64 is rendered in errors, but we don't actually
want to show this in the case of an invalid private keys.

Co-Authored-By: Eelco Dolstra <edolstra@gmail.com>
2024-09-23 16:36:48 -04:00
Eelco Dolstra c04bc17a5a builtin:fetchurl: Enable TLS verification
This is better for privacy and to avoid leaking netrc credentials in a
MITM attack, but also the assumption that we check the hash no longer
holds in some cases (in particular for impure derivations).

Partially reverts 5db358d4d7.
2024-09-23 15:15:43 +02:00
Ryan Hendrickson da332d678e libexpr: deprecate the bogus "or"-as-variable
As a prelude to making "or" work like a normal variable, emit a warning
any time the "fn or" production is used in a context that will change
how it is parsed when that production is refactored.

In detail: in the future, OR_KW will be moved to expr_simple, and the
cursed ExprCall production that is currently part of the expr_select
nonterminal will be generated "normally" in expr_app instead. Any
productions that accept an expr_select will be affected, except for the
expr_app nonterminal itself (because, while expr_app has a production
accepting a bare expr_select, its other production will continue to
accept "fn or" expressions). So all we need to do is emit an appropriate
warning when an expr_simple representing a cursed ExprCall is accepted
in one of those productions without first going through expr_app.

As the warning message describes, users can suppress the warning by
wrapping their problematic "fn or" expressions in parentheses. For
example, "f g or" can be made future-proof by rewriting it as
"f (g or)"; similarly "[ x y or ]" can be rewritten as "[ x (y or) ]",
etc. The parentheses preserve the current grouping behavior, as in the
future "f g or" will be parsed as "(f g) or", just like
"f g anything-else" is grouped. (Mechanically, this suppresses the
warning because the problem ExprCalls go through the
"expr_app : expr_select" production, which resets the cursed status on
the ExprCall.)
2024-09-20 15:57:36 -04:00
John Ericson d0c351bf43 Revert "base64Decode: clearer error message when an invalid character is detected"
We have a safer way of doing this.

This reverts commit dc3ccf02bf.
2024-09-20 10:41:45 -04:00
Eelco Dolstra 68ba6ff470
Merge pull request #11558 from DeterminateSystems/fix-no-gc-build
Fix build without GC
2024-09-20 16:02:08 +02:00
Eelco Dolstra ec47133be3 Fix warning 2024-09-20 15:08:45 +02:00
Eelco Dolstra 088569463b Fix build without GC 2024-09-20 15:01:32 +02:00
Eelco Dolstra c5c68558b5
Merge pull request #11550 from DeterminateSystems/traceable-allocator-alias
Alias traceable_allocator to std::allocator when building without GC
2024-09-20 10:43:31 +02:00
Eelco Dolstra b2bb92ef09 Formatting
Co-authored-by: Jörg Thalheim <Mic92@users.noreply.github.com>
2024-09-19 22:59:42 +02:00
Eelco Dolstra 2f4a7a8301 Add a few more aliases 2024-09-19 21:04:01 +02:00
Eelco Dolstra 589d8f1f2b Move GC-related definitions to eval-gc.hh 2024-09-19 21:04:01 +02:00
Eelco Dolstra 31d408c351 Alias gc_allocator 2024-09-19 21:04:01 +02:00
Eelco Dolstra b9f78abb7f Alias traceable_allocator to std::allocator when building without GC
This allows us to get rid of a bunch of #ifdefs.
2024-09-19 21:04:01 +02:00
Silvan Mosberger 8bd591db03 Implement --raw for nix-instantiate --eval 2023-11-16 07:40:51 +01:00
374 changed files with 1914 additions and 1025 deletions

View file

@ -23,7 +23,7 @@ assignees: ''
- [ ] checked [open documentation issues and pull requests] for possible duplicates
[latest Nix manual]: https://nixos.org/manual/nix/unstable/
[source]: https://github.com/NixOS/nix/tree/master/doc/manual/src
[source]: https://github.com/NixOS/nix/tree/master/doc/manual/source
[open documentation issues and pull requests]: https://github.com/NixOS/nix/labels/documentation
## Priorities

2
.github/labeler.yml vendored
View file

@ -9,7 +9,7 @@
- any-glob-to-any-file: "CONTRIBUTING.md"
- any-glob-to-any-file: ".github/ISSUE_TEMPLATE/*"
- any-glob-to-any-file: ".github/PULL_REQUEST_TEMPLATE.md"
- any-glob-to-any-file: "doc/manual/src/contributing/**"
- any-glob-to-any-file: "doc/manual/source/contributing/**"
"documentation":
- changed-files:

View file

@ -20,7 +20,7 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: cachix/install-nix-action@V28
- uses: cachix/install-nix-action@v30
with:
# The sandbox would otherwise be disabled by default on Darwin
extra_nix_config: "sandbox = true"
@ -89,7 +89,7 @@ jobs:
with:
fetch-depth: 0
- run: echo CACHIX_NAME="$(echo $GITHUB_REPOSITORY-install-tests | tr "[A-Z]/" "[a-z]-")" >> $GITHUB_ENV
- uses: cachix/install-nix-action@V28
- uses: cachix/install-nix-action@v30
with:
install_url: https://releases.nixos.org/nix/nix-2.20.3/install
- uses: cachix/cachix-action@v15
@ -112,7 +112,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- run: echo CACHIX_NAME="$(echo $GITHUB_REPOSITORY-install-tests | tr "[A-Z]/" "[a-z]-")" >> $GITHUB_ENV
- uses: cachix/install-nix-action@V28
- uses: cachix/install-nix-action@v30
with:
install_url: '${{needs.installer.outputs.installerURL}}'
install_options: "--tarball-url-prefix https://${{ env.CACHIX_NAME }}.cachix.org/serve"
@ -142,7 +142,7 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: cachix/install-nix-action@V28
- uses: cachix/install-nix-action@v30
with:
install_url: https://releases.nixos.org/nix/nix-2.20.3/install
- run: echo CACHIX_NAME="$(echo $GITHUB_REPOSITORY-install-tests | tr "[A-Z]/" "[a-z]-")" >> $GITHUB_ENV

22
.gitignore vendored
View file

@ -23,17 +23,17 @@ perl/Makefile.config
/doc/manual/conf-file.json
/doc/manual/language.json
/doc/manual/xp-features.json
/doc/manual/src/SUMMARY.md
/doc/manual/src/SUMMARY-rl-next.md
/doc/manual/src/store/types/*
!/doc/manual/src/store/types/index.md.in
/doc/manual/src/command-ref/new-cli
/doc/manual/src/command-ref/conf-file.md
/doc/manual/src/command-ref/experimental-features-shortlist.md
/doc/manual/src/contributing/experimental-feature-descriptions.md
/doc/manual/src/language/builtins.md
/doc/manual/src/language/builtin-constants.md
/doc/manual/src/release-notes/rl-next.md
/doc/manual/source/SUMMARY.md
/doc/manual/source/SUMMARY-rl-next.md
/doc/manual/source/store/types/*
!/doc/manual/source/store/types/index.md.in
/doc/manual/source/command-ref/new-cli
/doc/manual/source/command-ref/conf-file.md
/doc/manual/source/command-ref/experimental-features-shortlist.md
/doc/manual/source/contributing/experimental-feature-descriptions.md
/doc/manual/source/language/builtins.md
/doc/manual/source/language/builtin-constants.md
/doc/manual/source/release-notes/rl-next.md
# /scripts/
/scripts/nix-profile.sh

View file

@ -79,7 +79,7 @@ Check out the [security policy](https://github.com/NixOS/nix/security/policy).
- Functional tests [`tests/functional/**.sh`](./tests/functional)
- Unit tests [`src/*/tests`](./src/)
- Integration tests [`tests/nixos/*`](./tests/nixos)
- [ ] User documentation in the [manual](./doc/manual/src)
- [ ] User documentation in the [manual](./doc/manual/source)
- [ ] API documentation in header files
- [ ] Code and comments are self-explanatory
- [ ] Commit message explains **why** the change was made
@ -90,7 +90,7 @@ Check out the [security policy](https://github.com/NixOS/nix/security/policy).
## Making changes to the Nix manual
The Nix reference manual is hosted on https://nixos.org/manual/nix.
The underlying source files are located in [`doc/manual/src`](./doc/manual/src).
The underlying source files are located in [`doc/manual/source`](./doc/manual/source).
For small changes you can [use GitHub to edit these files](https://docs.github.com/en/repositories/working-with-files/managing-files/editing-files)
For larger changes see the [Nix reference manual](https://nix.dev/manual/nix/development/development/contributing.html).

View file

@ -1 +1 @@
doc/manual/src/development/building.md
doc/manual/source/development/building.md

1
doc/manual/.version Symbolic link
View file

@ -0,0 +1 @@
../../.version

View file

@ -1,5 +1,6 @@
[book]
title = "Nix Reference Manual"
src = "source"
[output.html]
additional-css = ["custom.css"]
@ -7,9 +8,21 @@ additional-js = ["redirects.js"]
edit-url-template = "https://github.com/NixOS/nix/tree/master/doc/manual/{path}"
git-repository-url = "https://github.com/NixOS/nix"
# Handles replacing @docroot@ with a path to ./source relative to that markdown file,
# {{#include handlebars}}, and the @generated@ syntax used within these. it mostly
# but not entirely replaces the links preprocessor (which we cannot simply use due
# to @generated@ files living in a different directory to make meson happy). we do
# not want to disable the links preprocessor entirely though because that requires
# disabling *all* built-in preprocessors and selectively reenabling those we want.
[preprocessor.substitute]
command = "python3 ./substitute.py"
before = ["anchors", "links"]
[preprocessor.anchors]
renderers = ["html"]
command = "jq --from-file doc/manual/anchors.jq"
command = "jq --from-file ./anchors.jq"
[output.markdown]
[output.linkcheck]
# no Internet during the build (in the sandbox)

22
doc/manual/generate-deps.py Executable file
View file

@ -0,0 +1,22 @@
#!/usr/bin/env python3
import glob
import sys
# meson expects makefile-style dependency declarations, i.e.
#
# target: dependency...
#
# meson seems to pass depfiles straight on to ninja even though
# it also parses the file itself (or at least has code to do so
# in its tree), so we must live by ninja's rules: only slashes,
# spaces and octothorpes can be escaped, anything else is taken
# literally. since the rules for these aren't even the same for
# all three we will just fail when we encounter any of them (if
# asserts are off for some reason the depfile will likely point
# to nonexistant paths, making everything phony and thus fine.)
for path in glob.glob(sys.argv[1] + '/**', recursive=True):
assert '\\' not in path
assert ' ' not in path
assert '#' not in path
print("ignored:", path)

View file

@ -21,7 +21,7 @@ let
"index.md" = replaceStrings
[ "@store-types@" ] [ index ]
(readFile ./src/store/types/index.md.in);
(readFile ./source/store/types/index.md.in);
tableOfContents =
let

View file

@ -4,8 +4,8 @@
doc_nix = $(nix_PATH)
MANUAL_SRCS := \
$(call rwildcard, $(d)/src, *.md) \
$(call rwildcard, $(d)/src, */*.md)
$(call rwildcard, $(d)/source, *.md) \
$(call rwildcard, $(d)/source, */*.md)
man-pages := $(foreach n, \
nix-env.1 nix-store.1 \
@ -18,11 +18,11 @@ man-pages := $(foreach n, \
, $(d)/$(n))
# man pages for subcommands
# convert from `$(d)/src/command-ref/nix-{1}/{2}.md` to `$(d)/nix-{1}-{2}.1`
# convert from `$(d)/source/command-ref/nix-{1}/{2}.md` to `$(d)/nix-{1}-{2}.1`
# FIXME: unify with how nix3-cli man pages are generated
man-pages += $(foreach subcommand, \
$(filter-out %opt-common.md %env-common.md, $(wildcard $(d)/src/command-ref/nix-*/*.md)), \
$(d)/$(subst /,-,$(subst $(d)/src/command-ref/,,$(subst .md,.1,$(subcommand)))))
$(filter-out %opt-common.md %env-common.md, $(wildcard $(d)/source/command-ref/nix-*/*.md)), \
$(d)/$(subst /,-,$(subst $(d)/source/command-ref/,,$(subst .md,.1,$(subcommand)))))
clean-files += $(d)/*.1 $(d)/*.5 $(d)/*.8
@ -49,11 +49,11 @@ define process-includes
done < <(grep '{{#include' $(1))
endef
$(d)/nix-env-%.1: $(d)/src/command-ref/nix-env/%.md
$(d)/nix-env-%.1: $(d)/source/command-ref/nix-env/%.md
@printf "Title: %s\n\n" "$(subst nix-env-,nix-env --,$$(basename "$@" .1))" > $^.tmp
$(render-subcommand)
$(d)/nix-store-%.1: $(d)/src/command-ref/nix-store/%.md
$(d)/nix-store-%.1: $(d)/source/command-ref/nix-store/%.md
@printf -- 'Title: %s\n\n' "$(subst nix-store-,nix-store --,$$(basename "$@" .1))" > $^.tmp
$(render-subcommand)
@ -69,50 +69,50 @@ define render-subcommand
endef
$(d)/%.1: $(d)/src/command-ref/%.md
$(d)/%.1: $(d)/source/command-ref/%.md
@printf "Title: %s\n\n" "$$(basename $@ .1)" > $^.tmp
@cat $^ >> $^.tmp
@$(call process-includes,$^,$^.tmp)
$(trace-gen) lowdown -sT man --nroff-nolinks -M section=1 $^.tmp -o $@
@rm $^.tmp
$(d)/%.8: $(d)/src/command-ref/%.md
$(d)/%.8: $(d)/source/command-ref/%.md
@printf "Title: %s\n\n" "$$(basename $@ .8)" > $^.tmp
@cat $^ >> $^.tmp
$(trace-gen) lowdown -sT man --nroff-nolinks -M section=8 $^.tmp -o $@
@rm $^.tmp
$(d)/nix.conf.5: $(d)/src/command-ref/conf-file.md
$(d)/nix.conf.5: $(d)/source/command-ref/conf-file.md
@printf "Title: %s\n\n" "$$(basename $@ .5)" > $^.tmp
@cat $^ >> $^.tmp
@$(call process-includes,$^,$^.tmp)
$(trace-gen) lowdown -sT man --nroff-nolinks -M section=5 $^.tmp -o $@
@rm $^.tmp
$(d)/nix-profiles.5: $(d)/src/command-ref/files/profiles.md
$(d)/nix-profiles.5: $(d)/source/command-ref/files/profiles.md
@printf "Title: %s\n\n" "$$(basename $@ .5)" > $^.tmp
@cat $^ >> $^.tmp
$(trace-gen) lowdown -sT man --nroff-nolinks -M section=5 $^.tmp -o $@
@rm $^.tmp
$(d)/src/SUMMARY.md: $(d)/src/SUMMARY.md.in $(d)/src/SUMMARY-rl-next.md $(d)/src/store/types $(d)/src/command-ref/new-cli $(d)/src/development/experimental-feature-descriptions.md
$(d)/source/SUMMARY.md: $(d)/source/SUMMARY.md.in $(d)/source/SUMMARY-rl-next.md $(d)/source/store/types $(d)/source/command-ref/new-cli $(d)/source/development/experimental-feature-descriptions.md
@cp $< $@
@$(call process-includes,$@,$@)
$(d)/src/store/types: $(d)/nix.json $(d)/utils.nix $(d)/generate-store-info.nix $(d)/generate-store-types.nix $(d)/src/store/types/index.md.in $(doc_nix)
$(d)/source/store/types: $(d)/nix.json $(d)/utils.nix $(d)/generate-store-info.nix $(d)/generate-store-types.nix $(d)/source/store/types/index.md.in $(doc_nix)
@# FIXME: build out of tree!
@rm -rf $@.tmp
$(trace-gen) $(nix-eval) --write-to $@.tmp --expr 'import doc/manual/generate-store-types.nix (builtins.fromJSON (builtins.readFile $<)).stores'
@# do not destroy existing contents
@mv $@.tmp/* $@/
$(d)/src/command-ref/new-cli: $(d)/nix.json $(d)/utils.nix $(d)/generate-manpage.nix $(d)/generate-settings.nix $(d)/generate-store-info.nix $(doc_nix)
$(d)/source/command-ref/new-cli: $(d)/nix.json $(d)/utils.nix $(d)/generate-manpage.nix $(d)/generate-settings.nix $(d)/generate-store-info.nix $(doc_nix)
@rm -rf $@ $@.tmp
$(trace-gen) $(nix-eval) --write-to $@.tmp --expr 'import doc/manual/generate-manpage.nix true (builtins.readFile $<)'
@mv $@.tmp $@
$(d)/src/command-ref/conf-file.md: $(d)/conf-file.json $(d)/utils.nix $(d)/generate-settings.nix $(d)/src/command-ref/conf-file-prefix.md $(d)/src/command-ref/experimental-features-shortlist.md $(doc_nix)
@cat doc/manual/src/command-ref/conf-file-prefix.md > $@.tmp
$(d)/source/command-ref/conf-file.md: $(d)/conf-file.json $(d)/utils.nix $(d)/generate-settings.nix $(d)/source/command-ref/conf-file-prefix.md $(d)/source/command-ref/experimental-features-shortlist.md $(doc_nix)
@cat doc/manual/source/command-ref/conf-file-prefix.md > $@.tmp
$(trace-gen) $(nix-eval) --expr 'import doc/manual/generate-settings.nix { prefix = "conf"; } (builtins.fromJSON (builtins.readFile $<))' >> $@.tmp;
@mv $@.tmp $@
@ -124,12 +124,12 @@ $(d)/conf-file.json: $(doc_nix)
$(trace-gen) $(dummy-env) $(doc_nix) config show --json --experimental-features nix-command > $@.tmp
@mv $@.tmp $@
$(d)/src/development/experimental-feature-descriptions.md: $(d)/xp-features.json $(d)/utils.nix $(d)/generate-xp-features.nix $(doc_nix)
$(d)/source/development/experimental-feature-descriptions.md: $(d)/xp-features.json $(d)/utils.nix $(d)/generate-xp-features.nix $(doc_nix)
@rm -rf $@ $@.tmp
$(trace-gen) $(nix-eval) --write-to $@.tmp --expr 'import doc/manual/generate-xp-features.nix (builtins.fromJSON (builtins.readFile $<))'
@mv $@.tmp $@
$(d)/src/command-ref/experimental-features-shortlist.md: $(d)/xp-features.json $(d)/utils.nix $(d)/generate-xp-features-shortlist.nix $(doc_nix)
$(d)/source/command-ref/experimental-features-shortlist.md: $(d)/xp-features.json $(d)/utils.nix $(d)/generate-xp-features-shortlist.nix $(doc_nix)
@rm -rf $@ $@.tmp
$(trace-gen) $(nix-eval) --write-to $@.tmp --expr 'import doc/manual/generate-xp-features-shortlist.nix (builtins.fromJSON (builtins.readFile $<))'
@mv $@.tmp $@
@ -138,10 +138,10 @@ $(d)/xp-features.json: $(doc_nix)
$(trace-gen) $(dummy-env) $(doc_nix) __dump-xp-features > $@.tmp
@mv $@.tmp $@
$(d)/src/language/builtins.md: $(d)/language.json $(d)/generate-builtins.nix $(d)/src/language/builtins-prefix.md $(doc_nix)
@cat doc/manual/src/language/builtins-prefix.md > $@.tmp
$(d)/source/language/builtins.md: $(d)/language.json $(d)/generate-builtins.nix $(d)/source/language/builtins-prefix.md $(doc_nix)
@cat doc/manual/source/language/builtins-prefix.md > $@.tmp
$(trace-gen) $(nix-eval) --expr 'import doc/manual/generate-builtins.nix (builtins.fromJSON (builtins.readFile $<))' >> $@.tmp;
@cat doc/manual/src/language/builtins-suffix.md >> $@.tmp
@cat doc/manual/source/language/builtins-suffix.md >> $@.tmp
@mv $@.tmp $@
$(d)/language.json: $(doc_nix)
@ -149,7 +149,7 @@ $(d)/language.json: $(doc_nix)
@mv $@.tmp $@
# Generate "Upcoming release" notes (or clear it and remove from menu)
$(d)/src/release-notes/rl-next.md: $(d)/rl-next $(d)/rl-next/*
$(d)/source/release-notes/rl-next.md: $(d)/rl-next $(d)/rl-next/*
@if type -p changelog-d > /dev/null; then \
echo " GEN " $@; \
changelog-d doc/manual/rl-next > $@; \
@ -158,7 +158,7 @@ $(d)/src/release-notes/rl-next.md: $(d)/rl-next $(d)/rl-next/*
true > $@; \
fi
$(d)/src/SUMMARY-rl-next.md: $(d)/src/release-notes/rl-next.md
$(d)/source/SUMMARY-rl-next.md: $(d)/source/release-notes/rl-next.md
$(trace-gen) true
@if [ -s $< ]; then \
echo ' - [Upcoming release](release-notes/rl-next.md)' > $@; \
@ -194,9 +194,9 @@ $(mandir)/man1/nix3-manpages: doc/manual/generated/man1/nix3-manpages
@mkdir -p $(DESTDIR)$$(dirname $@)
$(trace-install) install -m 0644 $$(dirname $<)/* $(DESTDIR)$$(dirname $@)
doc/manual/generated/man1/nix3-manpages: $(d)/src/command-ref/new-cli
doc/manual/generated/man1/nix3-manpages: $(d)/source/command-ref/new-cli
@mkdir -p $(DESTDIR)$$(dirname $@)
$(trace-gen) for i in doc/manual/src/command-ref/new-cli/*.md; do \
$(trace-gen) for i in doc/manual/source/command-ref/new-cli/*.md; do \
name=$$(basename $$i .md); \
tmpFile=$$(mktemp); \
if [[ $$name = SUMMARY ]]; then continue; fi; \
@ -211,7 +211,7 @@ doc/manual/generated/man1/nix3-manpages: $(d)/src/command-ref/new-cli
# `@docroot@` is to be preserved for documenting the mechanism
# FIXME: maybe contributing guides should live right next to the code
# instead of in the manual
$(docdir)/manual/index.html: $(MANUAL_SRCS) $(d)/book.toml $(d)/anchors.jq $(d)/custom.css $(d)/src/SUMMARY.md $(d)/src/store/types $(d)/src/command-ref/new-cli $(d)/src/development/experimental-feature-descriptions.md $(d)/src/command-ref/conf-file.md $(d)/src/language/builtins.md $(d)/src/release-notes/rl-next.md $(d)/src/figures $(d)/src/favicon.png $(d)/src/favicon.svg
$(docdir)/manual/index.html: $(MANUAL_SRCS) $(d)/book.toml $(d)/anchors.jq $(d)/custom.css $(d)/source/SUMMARY.md $(d)/source/store/types $(d)/source/command-ref/new-cli $(d)/source/development/experimental-feature-descriptions.md $(d)/source/command-ref/conf-file.md $(d)/source/language/builtins.md $(d)/source/release-notes/rl-next.md $(d)/source/figures $(d)/source/favicon.png $(d)/source/favicon.svg
$(trace-gen) \
tmp="$$(mktemp -d)"; \
cp -r doc/manual "$$tmp"; \
@ -219,12 +219,17 @@ $(docdir)/manual/index.html: $(MANUAL_SRCS) $(d)/book.toml $(d)/anchors.jq $(d)/
$(call process-includes,$$file,$$file); \
done; \
find "$$tmp" -name '*.md' ! -name 'documentation.md' | while read -r file; do \
docroot="$$(realpath --relative-to="$$(dirname "$$file")" $$tmp/manual/src)"; \
docroot="$$(realpath --relative-to="$$(dirname "$$file")" $$tmp/manual/source)"; \
sed -i "s,@docroot@,$$docroot,g" "$$file"; \
done; \
set -euo pipefail; \
RUST_LOG=warn mdbook build "$$tmp/manual" -d $(DESTDIR)$(docdir)/manual.tmp 2>&1 \
| { grep -Fv "because fragment resolution isn't implemented" || :; }; \
( \
cd "$$tmp/manual"; \
RUST_LOG=warn \
MDBOOK_SUBSTITUTE_SEARCH=$(d)/source \
mdbook build -d $(DESTDIR)$(docdir)/manual.tmp 2>&1 \
| { grep -Fv "because fragment resolution isn't implemented" || :; } \
); \
rm -rf "$$tmp/manual"
@rm -rf $(DESTDIR)$(docdir)/manual
@mv $(DESTDIR)$(docdir)/manual.tmp/html $(DESTDIR)$(docdir)/manual

353
doc/manual/meson.build Normal file
View file

@ -0,0 +1,353 @@
project('nix-manual',
version : files('.version'),
meson_version : '>= 1.1',
license : 'LGPL-2.1-or-later',
)
nix = find_program('nix', native : true)
mdbook = find_program('mdbook', native : true)
bash = find_program('bash', native : true)
pymod = import('python')
python = pymod.find_installation('python3')
nix_env_for_docs = {
'HOME': '/dummy',
'NIX_CONF_DIR': '/dummy',
'NIX_SSL_CERT_FILE': '/dummy/no-ca-bundle.crt',
'NIX_STATE_DIR': '/dummy',
'NIX_CONFIG': 'cores = 0',
}
nix_for_docs = [nix, '--experimental-features', 'nix-command']
nix_eval_for_docs_common = nix_for_docs + [
'eval',
'-I', 'nix=' + meson.current_source_dir(),
'--store', 'dummy://',
'--impure',
]
nix_eval_for_docs = nix_eval_for_docs_common + '--raw'
conf_file_json = custom_target(
command : nix_for_docs + ['config', 'show', '--json'],
capture : true,
output : 'conf-file.json',
env : nix_env_for_docs,
)
language_json = custom_target(
command: [nix, '__dump-language'],
output : 'language.json',
capture : true,
env : nix_env_for_docs,
)
nix3_cli_json = custom_target(
command : [nix, '__dump-cli'],
capture : true,
output : 'nix.json',
env : nix_env_for_docs,
)
generate_manual_deps = files(
'generate-deps.py',
)
# Generates types
subdir('source/store')
# Generates builtins.md and builtin-constants.md.
subdir('source/language')
# Generates new-cli pages, experimental-features-shortlist.md, and conf-file.md.
subdir('source/command-ref')
# Generates experimental-feature-descriptions.md.
subdir('source/development')
# Generates rl-next-generated.md.
subdir('source/release-notes')
subdir('source')
# Hacky way to figure out if `nix` is an `ExternalProgram` or
# `Exectuable`. Only the latter can occur in custom target input lists.
if nix.full_path().startswith(meson.build_root())
nix_input = nix
else
nix_input = []
endif
manual = custom_target(
'manual',
command : [
bash,
'-euo', 'pipefail',
'-c',
'''
@0@ @INPUT0@ @CURRENT_SOURCE_DIR@ > @DEPFILE@
@0@ @INPUT1@ summary @2@ < @CURRENT_SOURCE_DIR@/source/SUMMARY.md.in > @2@/source/SUMMARY.md
rsync -r --include='*.md' @CURRENT_SOURCE_DIR@/ @2@/
(cd @2@; RUST_LOG=warn @1@ build -d @2@ 3>&2 2>&1 1>&3) | { grep -Fv "because fragment resolution isn't implemented" || :; } 3>&2 2>&1 1>&3
rm -rf @2@/manual
mv @2@/html @2@/manual
find @2@/manual -iname meson.build -delete
'''.format(
python.full_path(),
mdbook.full_path(),
meson.current_build_dir(),
),
],
input : [
generate_manual_deps,
'substitute.py',
'book.toml',
'anchors.jq',
'custom.css',
nix3_cli_files,
experimental_features_shortlist_md,
experimental_feature_descriptions_md,
types_dir,
conf_file_md,
builtins_md,
rl_next_generated,
summary_rl_next,
nix_input,
],
output : [
'manual',
'markdown',
],
depfile : 'manual.d',
env : {
'RUST_LOG': 'info',
'MDBOOK_SUBSTITUTE_SEARCH': meson.current_build_dir() / 'source',
},
)
manual_html = manual[0]
manual_md = manual[1]
install_subdir(
manual_html.full_path(),
install_dir : get_option('datadir') / 'doc/nix',
)
nix_nested_manpages = [
[ 'nix-env',
[
'delete-generations',
'install',
'list-generations',
'query',
'rollback',
'set-flag',
'set',
'switch-generation',
'switch-profile',
'uninstall',
'upgrade',
],
],
[ 'nix-store',
[
'add-fixed',
'add',
'delete',
'dump-db',
'dump',
'export',
'gc',
'generate-binary-cache-key',
'import',
'load-db',
'optimise',
'print-env',
'query',
'read-log',
'realise',
'repair-path',
'restore',
'serve',
'verify',
'verify-path',
],
],
]
foreach command : nix_nested_manpages
foreach page : command[1]
title = command[0] + ' --' + page
section = '1'
custom_target(
command : [
bash,
files('./render-manpage.sh'),
'--out-no-smarty',
title,
section,
'@INPUT0@/command-ref' / command[0] / (page + '.md'),
'@OUTPUT0@',
],
input : [
manual_md,
nix_input,
],
output : command[0] + '-' + page + '.1',
install : true,
install_dir : get_option('mandir') / 'man1',
)
endforeach
endforeach
nix3_manpages = [
'nix3-build',
'nix3-bundle',
'nix3-config',
'nix3-config-show',
'nix3-copy',
'nix3-daemon',
'nix3-derivation-add',
'nix3-derivation',
'nix3-derivation-show',
'nix3-develop',
#'nix3-doctor',
'nix3-edit',
'nix3-eval',
'nix3-flake-archive',
'nix3-flake-check',
'nix3-flake-clone',
'nix3-flake-info',
'nix3-flake-init',
'nix3-flake-lock',
'nix3-flake',
'nix3-flake-metadata',
'nix3-flake-new',
'nix3-flake-prefetch',
'nix3-flake-show',
'nix3-flake-update',
'nix3-fmt',
'nix3-hash-file',
'nix3-hash',
'nix3-hash-path',
'nix3-hash-to-base16',
'nix3-hash-to-base32',
'nix3-hash-to-base64',
'nix3-hash-to-sri',
'nix3-help',
'nix3-help-stores',
'nix3-key-convert-secret-to-public',
'nix3-key-generate-secret',
'nix3-key',
'nix3-log',
'nix3-nar-cat',
'nix3-nar-dump-path',
'nix3-nar-ls',
'nix3-nar',
'nix3-path-info',
'nix3-print-dev-env',
'nix3-profile-diff-closures',
'nix3-profile-history',
'nix3-profile-install',
'nix3-profile-list',
'nix3-profile',
'nix3-profile-remove',
'nix3-profile-rollback',
'nix3-profile-upgrade',
'nix3-profile-wipe-history',
'nix3-realisation-info',
'nix3-realisation',
'nix3-registry-add',
'nix3-registry-list',
'nix3-registry',
'nix3-registry-pin',
'nix3-registry-remove',
'nix3-repl',
'nix3-run',
'nix3-search',
#'nix3-shell',
'nix3-store-add-file',
'nix3-store-add-path',
'nix3-store-cat',
'nix3-store-copy-log',
'nix3-store-copy-sigs',
'nix3-store-delete',
'nix3-store-diff-closures',
'nix3-store-dump-path',
'nix3-store-gc',
'nix3-store-ls',
'nix3-store-make-content-addressed',
'nix3-store',
'nix3-store-optimise',
'nix3-store-path-from-hash-part',
'nix3-store-ping',
'nix3-store-prefetch-file',
'nix3-store-repair',
'nix3-store-sign',
'nix3-store-verify',
'nix3-upgrade-nix',
'nix3-why-depends',
'nix',
]
foreach page : nix3_manpages
section = '1'
custom_target(
command : [
bash,
'@INPUT0@',
page,
section,
'@INPUT1@/command-ref/new-cli/@0@.md'.format(page),
'@OUTPUT@',
],
input : [
files('./render-manpage.sh'),
manual_md,
nix_input,
],
output : page + '.1',
install : true,
install_dir : get_option('mandir') / 'man1',
)
endforeach
nix_manpages = [
[ 'nix-env', 1 ],
[ 'nix-store', 1 ],
[ 'nix-build', 1 ],
[ 'nix-shell', 1 ],
[ 'nix-instantiate', 1 ],
[ 'nix-collect-garbage', 1 ],
[ 'nix-prefetch-url', 1 ],
[ 'nix-channel', 1 ],
[ 'nix-hash', 1 ],
[ 'nix-copy-closure', 1 ],
[ 'nix.conf', 5, conf_file_md.full_path() ],
[ 'nix-daemon', 8 ],
[ 'nix-profiles', 5, 'files/profiles.md' ],
]
foreach entry : nix_manpages
title = entry[0]
# nix.conf.5 and nix-profiles.5 are based off of conf-file.md and files/profiles.md,
# rather than a stem identical to its mdbook source.
# Therefore we use an optional third element of this array to override the name pattern
md_file = entry.get(2, title + '.md')
section = entry[1].to_string()
md_file_resolved = join_paths('@INPUT1@/command-ref/', md_file)
custom_target(
command : [
bash,
'@INPUT0@',
title,
section,
md_file_resolved,
'@OUTPUT@',
],
input : [
files('./render-manpage.sh'),
manual_md,
entry.get(3, []),
nix_input,
],
output : '@0@.@1@'.format(entry[0], entry[1]),
install : true,
install_dir : get_option('mandir') / 'man@0@'.format(entry[1]),
)
endforeach

71
doc/manual/package.nix Normal file
View file

@ -0,0 +1,71 @@
{ lib
, mkMesonDerivation
, meson
, ninja
, lowdown
, mdbook
, mdbook-linkcheck
, jq
, python3
, rsync
, nix-cli
# Configuration Options
, version
}:
let
inherit (lib) fileset;
in
mkMesonDerivation (finalAttrs: {
pname = "nix-manual";
inherit version;
workDir = ./.;
fileset = fileset.difference
(fileset.unions [
../../.version
# Too many different types of files to filter for now
../../doc/manual
./.
])
# Do a blacklist instead
../../doc/manual/package.nix;
# TODO the man pages should probably be separate
outputs = [ "out" "man" ];
# Hack for sake of the dev shell
passthru.externalNativeBuildInputs = [
meson
ninja
(lib.getBin lowdown)
mdbook
mdbook-linkcheck
jq
python3
rsync
];
nativeBuildInputs = finalAttrs.passthru.externalNativeBuildInputs ++ [
nix-cli
];
preConfigure =
''
chmod u+w ./.version
echo ${finalAttrs.version} > ./.version
'';
postInstall = ''
mkdir -p ''$out/nix-support
echo "doc manual ''$out/share/doc/nix/manual" >> ''$out/nix-support/hydra-build-products
'';
meta = {
platforms = lib.platforms.all;
};
})

View file

@ -1,7 +1,7 @@
// redirect rules for URL fragments (client-side) to prevent link rot.
// this must be done on the client side, as web servers do not see the fragment part of the URL.
// it will only work with JavaScript enabled in the browser, but this is the best we can do here.
// see src/_redirects for path redirects (server-side)
// see source/_redirects for path redirects (server-side)
// redirects are declared as follows:
// each entry has as its key a path matching the requested URL path, relative to the mdBook document root.

View file

@ -0,0 +1,33 @@
#!/usr/bin/env python3
import os
import subprocess
import sys
import shutil
import typing as t
def main():
if len(sys.argv) < 4 or '--' not in sys.argv:
print("Usage: remove-before-wrapper <output> -- <nix command...>")
sys.exit(1)
# Extract the parts
output: str = sys.argv[1]
nix_command_idx: int = sys.argv.index('--') + 1
nix_command: t.List[str] = sys.argv[nix_command_idx:]
output_temp: str = output + '.tmp'
# Remove the output and temp output in case they exist
shutil.rmtree(output, ignore_errors=True)
shutil.rmtree(output_temp, ignore_errors=True)
# Execute nix command with `--write-to` tempary output
nix_command_write_to = nix_command + ['--write-to', output_temp]
subprocess.run(nix_command_write_to, check=True)
# Move the temporary output to the intended location
os.rename(output_temp, output)
if __name__ == "__main__":
main()

25
doc/manual/render-manpage.sh Executable file
View file

@ -0,0 +1,25 @@
#!/usr/bin/env bash
set -euo pipefail
lowdown_args=
if [ "$1" = --out-no-smarty ]; then
lowdown_args=--out-no-smarty
shift
fi
[ "$#" = 4 ] || {
echo "wrong number of args passed" >&2
exit 1
}
title="$1"
section="$2"
infile="$3"
outfile="$4"
(
printf "Title: %s\n\n" "$title"
cat "$infile"
) | lowdown -sT man --nroff-nolinks $lowdown_args -M section="$section" -o "$outfile"

View file

@ -16,7 +16,7 @@ This has a small adverse affect on remote building --- the `build-remote` execut
This means that other applications linking `libnixstore` that wish to use remote building must arrange for the `nix` command to be on the PATH (or manually overriding `build-hook`) in order for that to work.
Long term we don't envision this being a downside, because we plan to [get rid of `build-remote` and the build hook setting entirely](https://github.com/NixOS/nix/issues/1221).
There is simply no need to add a second layer of remote-procedure-calling when we want to connect to a remote builder.
There should simply be no need to have an extra, intermediate layer of remote-procedure-calling when we want to connect to a remote builder.
The build hook protocol did in principle support custom ways of remote building, but that can also be accomplished with a custom service for the ssh or daemon/ssh-ng protocols, or with a custom [store type](@docroot@/store/types/index.md) i.e. `Store` subclass. <!-- we normally don't mention classes, but consider that this release note is about a library use case -->
The Perl bindings no longer expose `getBinDir` either, since they libraries those bindings wrap no longer know the location of installed binaries as described above.
The Perl bindings no longer expose `getBinDir` either, since the underlying C++ libraries those bindings wrap no longer know the location of installed binaries as described above.

View file

@ -0,0 +1,8 @@
---
synopsis: "`<nix/fetchurl.nix>` uses TLS verification"
prs: [11585]
---
Previously `<nix/fetchurl.nix>` did not do TLS verification. This was because the Nix sandbox in the past did not have access to TLS certificates, and Nix checks the hash of the fetched file anyway. However, this can expose authentication data from `netrc` and URLs to man-in-the-middle attackers. In addition, Nix now in some cases (such as when using impure derivations) does *not* check the hash. Therefore we have now enabled TLS verification. This means that downloads by `<nix/fetchurl.nix>` will now fail if you're fetching from a HTTPS server that does not have a valid certificate.
`<nix/fetchurl.nix>` is also known as the builtin derivation builder `builtin:fetchurl`. It's not to be confused with the evaluation-time function `builtins.fetchurl`, which was not affected by this issue.

View file

@ -12,14 +12,14 @@ machine is accessible via SSH and that it has Nix installed. You can
test whether connecting to the remote Nix instance works, e.g.
```console
$ nix store ping --store ssh://mac
$ nix store info --store ssh://mac
```
will try to connect to the machine named `mac`. It is possible to
specify an SSH identity file as part of the remote store URI, e.g.
```console
$ nix store ping --store ssh://mac?ssh-key=/home/alice/my-key
$ nix store info --store ssh://mac?ssh-key=/home/alice/my-key
```
Since builds should be non-interactive, the key should not have a

View file

@ -0,0 +1,63 @@
xp_features_json = custom_target(
command : [nix, '__dump-xp-features'],
capture : true,
output : 'xp-features.json',
)
experimental_features_shortlist_md = custom_target(
command : nix_eval_for_docs + [
'--expr',
'import @INPUT0@ (builtins.fromJSON (builtins.readFile ./@INPUT1@))',
],
input : [
'../../generate-xp-features-shortlist.nix',
xp_features_json,
],
output : 'experimental-features-shortlist.md',
capture : true,
env : nix_env_for_docs,
)
nix3_cli_files = custom_target(
command : [
python.full_path(),
'@INPUT0@',
'@OUTPUT@',
'--'
] + nix_eval_for_docs + [
'--expr',
'import @INPUT1@ true (builtins.readFile ./@INPUT2@)',
],
input : [
'../../remove_before_wrapper.py',
'../../generate-manpage.nix',
nix3_cli_json,
],
output : 'new-cli',
env : nix_env_for_docs,
)
conf_file_md_body = custom_target(
command : [
nix_eval_for_docs,
'--expr',
'import @INPUT0@ { prefix = "conf"; } (builtins.fromJSON (builtins.readFile ./@INPUT1@))',
],
capture : true,
input : [
'../../generate-settings.nix',
conf_file_json,
],
output : 'conf-file.body.md',
env : nix_env_for_docs,
)
conf_file_md = custom_target(
command : [ 'cat', '@INPUT0@', '@INPUT1@' ],
capture : true,
input : [
'conf-file-prefix.md',
conf_file_md_body,
],
output : 'conf-file.md',
)

View file

@ -62,7 +62,7 @@ These pages can be viewed offline:
Several operations, such as [`nix-env --query`](./nix-env/query.md) and [`nix-env --install`](./nix-env/install.md), take a list of *arguments* that specify the packages on which to operate.
Packages are identified based on a `name` part and a `version` part of a [symbolic derivation name](@docroot@/language/derivations.md#attr-names):
Packages are identified based on a `name` part and a `version` part of a [symbolic derivation name](@docroot@/language/derivations.md#attr-name):
- `name`: Everything up to but not including the first dash (`-`) that is *not* followed by a letter.
- `version`: The rest, excluding the separating dash.

View file

@ -104,7 +104,7 @@ symlink.
Prints a set of derivation files (`.drv`) which are supposed produce
said paths when realized. Might print nothing, for example for source paths
or paths subsituted from a binary cache.
or paths substituted from a binary cache.
- `--graph`
@ -241,4 +241,3 @@ $ nix-store --query --roots $(which svn)
/nix/var/nix/profiles/default-82-link
/home/eelco/.local/state/nix/profiles/profile-97-link
```

View file

@ -1,3 +1,7 @@
<!-- Some of the options documented here are hardcopied from
src/libcmd/common-eval-args.cc
-->
# Common Options
Most Nix commands accept the following command-line options:
@ -161,6 +165,14 @@ Most Nix commands accept the following command-line options:
You can override this using `--arg`, e.g., `nix-env --install --attr pkgname --arg system \"i686-freebsd\"`.
(Note that since the argument is a Nix string literal, you have to escape the quotes.)
- <span id="opt-arg-from-file">[`--arg-from-file`](#opt-arg-from-file)</span> *name* *path*
Pass the contents of file *path* as the argument *name* to Nix functions.
- <span id="opt-arg-from-stdin">[`--arg-from-stdin`](#opt-arg-from-stdin)</span> *name*
Pass the contents of stdin as the argument *name* to Nix functions.
- <span id="opt-argstr">[`--argstr`](#opt-argstr)</span> *name* *value*
This option is like `--arg`, only the value is not a Nix expression but a string.
@ -179,6 +191,10 @@ Most Nix commands accept the following command-line options:
attribute of the fourth element of the array in the `foo` attribute
of the top-level expression.
- <span id="opt-eval-store">[`--eval-store`](#opt-eval-store)</span> *store-url*
The [URL to the Nix store](@docroot@/store/types/index.md#store-url-format) to use for evaluation, i.e. where to store derivations (`.drv` files) and inputs referenced by them.
- <span id="opt-expr">[`--expr`](#opt-expr)</span> / `-E`
Interpret the command line arguments as a list of Nix expressions to be parsed and evaluated, rather than as a list of file names of Nix expressions.
@ -194,6 +210,10 @@ Most Nix commands accept the following command-line options:
Paths added through `-I` take precedence over the [`nix-path` configuration setting](@docroot@/command-ref/conf-file.md#conf-nix-path) and the [`NIX_PATH` environment variable](@docroot@/command-ref/env-common.md#env-NIX_PATH).
- <span id="opt-impure">[`--impure`](#opt-impure)</span>
Allow access to mutable paths and repositories.
- <span id="opt-option">[`--option`](#opt-option)</span> *name* *value*
Set the Nix configuration option *name* to *value*.

View file

@ -35,7 +35,7 @@ In order to reflect changes to the [Makefile for the manual], clear all generate
[Makefile for the manual]: https://github.com/NixOS/nix/blob/master/doc/manual/local.mk
```console
rm $(git ls-files doc/manual/ -o | grep -F '.md') && rmdir doc/manual/src/command-ref/new-cli && make manual-html -j $NIX_BUILD_CORES
rm $(git ls-files doc/manual/ -o | grep -F '.md') && rmdir doc/manual/source/command-ref/new-cli && make manual-html -j $NIX_BUILD_CORES
```
## Style guide
@ -182,7 +182,7 @@ Please observe these guidelines to ease reviews:
`@docroot@` provides a base path for links that occur in reusable snippets or other documentation that doesn't have a base path of its own.
If a broken link occurs in a snippet that was inserted into multiple generated files in different directories, use `@docroot@` to reference the `doc/manual/src` directory.
If a broken link occurs in a snippet that was inserted into multiple generated files in different directories, use `@docroot@` to reference the `doc/manual/source` directory.
If the `@docroot@` literal appears in an error message from the [`mdbook-linkcheck`] tool, the `@docroot@` replacement needs to be applied to the generated source file that mentions it.
See existing `@docroot@` logic in the [Makefile for the manual].

View file

@ -0,0 +1,12 @@
experimental_feature_descriptions_md = custom_target(
command : nix_eval_for_docs + [
'--expr',
'import @INPUT0@ (builtins.fromJSON (builtins.readFile @INPUT1@))',
],
input : [
'../../generate-xp-features.nix',
xp_features_json,
],
capture : true,
output : 'experimental-feature-descriptions.md',
)

View file

@ -162,7 +162,7 @@ ninja: no work to do.
Individual tests can be run with `meson`:
```shell-session
$ meson test ${testName}
$ meson test --verbose ${testName}
ninja: Entering directory `/home/jcericson/src/nix/master/build'
ninja: no work to do.
1/1 nix-functional-tests:main / ${testName} OK 0.41s
@ -177,7 +177,11 @@ Timeout: 0
Full log written to /home/jcericson/src/nix/master/build/meson-logs/testlog.txt
```
or without `meson`, showing the output:
The `--verbose` flag will make Meson also show the console output of each test for easier debugging.
The test script will then be traced with `set -x` and the output displayed as it happens,
regardless of whether the test succeeds or fails.
Tests can be also run directly without `meson`:
```shell-session
$ TEST_NAME=${testName} NIX_REMOTE='' PS4='+(${BASH_SOURCE[0]-$0}:$LINENO) tests/functional/${testName}.sh
@ -188,8 +192,6 @@ output from bar
...
```
The test script will then be traced with `set -x` and the output displayed as it happens, regardless of whether the test succeeds or fails.
### Debugging failing functional tests
When a functional test fails, it usually does so somewhere in the middle of the script.

View file

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View file

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 83 KiB

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