aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-04-11meson: fix log-direldritch horrors
the make build system sets this with an extra /nix segment. Change-Id: Iedf464843196faeae5b59698837faca3a4f23586
2024-04-11manual: build docs with dummy envseldritch horrors
this was previously used because the macOS docs build would otherwise pull files out of the host nix store. or something. not sure about it Change-Id: I76b51eac1ebc5de5f00e2e4be086dd8db3eeb8e6
2024-04-11libcmd: install generated headers as welleldritch horrors
these seem to have been forgotten. Change-Id: I6a084827d087f8098c19b62f2060a874d87202a1
2024-04-11docs: redo content generation for mdbook and manualeldritch horrors
manpages can be rendered using the markdown output of mdbook, the rest of the manual can generated out of the main doc/manual source tree. we still use lowdown to actually render manpages instead of eg mdbook-man because lowdown does generate reasonably good manpages (though that is also somewhat debatable, but they're a lot better than mdbook-man). doing this not only lets us drastically simplify the lowdown pipeline, but also remove all custom {{#include}} handling since now mdbook does all of it, even for the manpage builds. even the lowdown wrapper isn't entirely necessary because lowdown can take all wrapper arguments with command line flags rather than bits of input file content. This also implements running mdbook in Meson, in order to generate the manpages. The mdbook outputs are also installed in the usual location. Co-authored-by: Qyriad <qyriad@qyriad.me> Change-Id: I60193f9fd0f15d48872f071af35855cda2a0f40b
2024-04-11libstore: fix glossary link in documentationeldritch horrors
this should be a link, not an anchor. it should also point to the `gloss-store` element, not the `#gloss-store` element. Change-Id: I1f2803093179549637e10f917ad73399a419131b
2024-04-10Merge "Print top-level errors normally in `nix repl`" into mainrebecca “wiggles” turner
2024-04-10Merge "docs: generalize manpage generation script as json-to-tree.py" into mainQyriad
2024-04-10docs: generalize manpage generation script as json-to-tree.pyQyriad
This should be capable of replacing every invocation of nix eval --write-to. Change-Id: I60387bc9b0fc54a91244eddb639beaa64d705878
2024-04-09Print top-level errors normally in `nix repl`Rebecca Turner
Previously, errors while printing values in `nix repl` would be printed in `«error: ...»` brackets rather than displayed normally: ``` nix-repl> legacyPackages.aarch64-darwin.pythonPackages.APScheduler «error: Package ‘python-2.7.18.7’ in /nix/store/6s0m1qc31zw3l3kq0q4wd5cp3lqpkq0q-source/pkgs/development/interpreters/python/cpython/2.7/default.nix:335 is marked as insecure, refusing to evaluate.» ``` Now, errors will be displayed normally if they're emitted at the top-level of an expression: ``` nix-repl> legacyPackages.aarch64-darwin.pythonPackages.APScheduler error: … in the condition of the assert statement at /nix/store/6s0m1qc31zw3l3kq0q4wd5cp3lqpkq0q-source/lib/customisation.nix:268:17: 267| in commonAttrs // { 268| drvPath = assert condition; drv.drvPath; | ^ 269| outPath = assert condition; drv.outPath; … in the left operand of the OR (||) operator at /nix/store/6s0m1qc31zw3l3kq0q4wd5cp3lqpkq0q-source/pkgs/development/interpreters/python/passthrufun.nix:28:45: 27| if lib.isDerivation value then 28| lib.extendDerivation (valid value || throw "${name} should use `buildPythonPackage` or `toPythonModule` if it is to be part of the Python packages set.") {} value | ^ 29| else (stack trace truncated; use '--show-trace' to show the full trace) error: Package ‘python-2.7.18.7’ in /nix/store/6s0m1qc31zw3l3kq0q4wd5cp3lqpkq0q-source/pkgs/development/interpreters/python/cpython/2.7/default.nix:335 is marked as insecure, refusing to evaluate. ``` Errors emitted in nested structures (like e.g. when printing `nixpkgs`) will still be printed in brackets. Change-Id: I25aeddf08c017582718cb9772a677bf51b9fc2ad
2024-04-09meson: correctly differentiate $profiledir and $sysconfdir/profile.dQyriad
The configured sysconfdir is used to look for nix.conf, so it needs to be /etc, and not $out/etc, so we separate out the place where shell profile files are installed, which is the only other place sysconfdir is at all used. See https://git.lix.systems/lix-project/lix/issues/231#issuecomment-1989 for more info. Change-Id: Idbed8ba82e711b8a9d6b6127904befa27d58e279
2024-04-09meson: correctly set NIX_CONF_DIR to $sysconfdir/nixQyriad
Instead of $sysconfdir. Fixes #231, but there's more to do in following commits to make Meson-built Lix actually look in /etc/nix. Change-Id: Ia8d627070f405843add46e05cff5134b76b8eb48
2024-04-09format repl-overlays.nix to fix pre-commit checksQyriad
Change-Id: I9487f5832160c1093d8752f883c1be85f8310e0f
2024-04-09Merge "Add `repl-overlays`" into mainrebecca “wiggles” turner
2024-04-09Merge "Add benchmarking scripts" into mainjade
2024-04-08Add benchmarking scriptsJade Lovelace
These scripts were originally written by horrors, and have since been hacked up a lot by jade. We are putting them up as a CL since it is better to have checked in benchmarking scripts than to not have benchmarking scripts. cc: https://git.lix.systems/lix-project/lix/issues/23 Co-authored-by: eldritch horrors <pennae@lix.systems> Change-Id: I95c2f9d24753ac468944c5781deec9508fd5cb8c
2024-04-09docs: put the manual build into a known tmpdireldritch horrors
this isn't strictly necessary, but it'll make it a lot easier to put the generated files used by the autoconf build system in this directory too. doing this now already will make the meson transition a lot easier later Change-Id: I5fb39eade2ff88b6093c9ee436c9e8db793e9448
2024-04-09docs: don't compute SUMMARY.md during buildeldritch horrors
this would make meson build compatibility unnecessarily hard and the cli does not change often enough to justify this complexity. Change-Id: I17b1870cdf8538feeaa01a9945db97af2175a642
2024-04-09docs: don't compute rl-next.md during buildeldritch horrors
not sure why this was done the way it was considering that includes are a feature the doc toolchain had previously. let's just always have some kind of entry for the upcoming release in the dev manual builds even if that means having a completely empty release notes chapter. the release notes generation script isn't entirely functional right now due to pre-commit hooks, but it's good enough for time being. we need a better release process for notes anyway. Change-Id: Ifda6912cf5233db013f72a30247a62d6f22b1565 Change-Id: I9eb347ec4aabc5be2b816ff0fd3e4be45f93b934
2024-04-09docs: skip do custom include processing for mdbookeldritch horrors
mdbook already does include processing of its own, and the custom processing code has always admitted as much. we don't need it for the mdbook build at this point if we run our preprocessors in the right order, and maybe we can even have mdbook to return complete pages to us that we only have to pass to lowdown without any more preprocessing of our own. Change-Id: Icd978acbc3b1e215fee8f062c53ab2cb2a222ab1
2024-04-09docs: remove many link-to-selfeldritch horrors
for some reason these three were anchors, not links, but had they been links they wouldn't've worked because they're not defined anywhere but here. in the print version of the manual they're duplicated many times over (creating id collisions), so we should better remove them anyway. Change-Id: I8988a7c32c812dee0f0b6d4953faa7cd1255228d
2024-04-08Add `repl-overlays`Rebecca Turner
Adds a `repl-overlays` option, which specifies files that can overlay and modify the top-level bindings in `nix repl`. For example, with the following contents in `~/.config/nix/repl.nix`: info: final: prev: let optionalAttrs = predicate: attrs: if predicate then attrs else {}; in optionalAttrs (prev ? legacyPackages && prev.legacyPackages ? ${info.currentSystem}) { pkgs = prev.legacyPackages.${info.currentSystem}; } We can run `nix repl` and use `pkgs` to refer to `legacyPackages.${currentSystem}`: $ nix repl --repl-overlays ~/.config/nix/repl.nix nixpkgs Lix 2.90.0 Type :? for help. Loading installable 'flake:nixpkgs#'... Added 5 variables. Loading 'repl-overlays'... Added 6 variables. nix-repl> pkgs.bash «derivation /nix/store/g08b5vkwwh0j8ic9rkmd8mpj878rk62z-bash-5.2p26.drv» Change-Id: Ic12e0f2f210b2f46e920c33088dfe1083f42391a
2024-04-08pre-commit check for pragma once and ///@fileJade Lovelace
This is in our style guide, we can cheaply enforce it, let's do it. ``` $ pre-commit check-case-conflicts.....................................................Passed check-executables-have-shebangs..........................................Passed check-headers............................................................Failed - hook id: check-headers - exit code: 1 Missing pattern @file in file src/libexpr/value.hh We found some header files that don't conform to the style guide. The Lix style guide requests that header files: - Begin with `#pragma once` so they only get parsed once - Contain a doxygen comment (`/**` or `///`) containing `@file`, for example, `///@file`, which will make doxygen generate docs for them. When adding that, consider also adding a `@brief` with a sentence explaining what the header is for. For more details: https://wiki.lix.systems/link/3#bkmrk-header-files check-merge-conflicts....................................................Passed check-shebang-scripts-are-executable.....................................Passed check-symlinks.......................................(no files to check)Skipped end-of-file-fixer........................................................Passed mixed-line-endings.......................................................Passed no-commit-to-branch......................................................Passed release-notes........................................(no files to check)Skipped treefmt..................................................................Passed trim-trailing-whitespace.................................................Passed ``` Fixes: https://git.lix.systems/lix-project/lix/issues/233 Change-Id: I77150b9298c844ffedd0f85cc5250ae9208502e3
2024-04-08pragma once and ///@file everything missing itJade Lovelace
Change-Id: Ia1a72348336794b5fb9f2694dd750266089b904e
2024-04-08"but doctor, I AM the untrusted store": nix doctor had wrong trustednessJade Lovelace
This probably snuck in in a refactor using truthiness or so. The trustedness flag was having the optional fullness checked, rather than the actual contained trust level. Also adds some tests. ``` m1@6876551b-255d-4cb0-af02-8a4f17b27e2e ~ % nix store ping warning: 'nix store ping' is a deprecated alias for 'nix store info' Store URL: daemon Version: 2.20.4 Trusted: 0 m1@6876551b-255d-4cb0-af02-8a4f17b27e2e ~ % nix doctor warning: 'doctor' is a deprecated alias for 'config check' [PASS] PATH contains only one nix version. [PASS] All profiles are gcroots. [PASS] Client protocol matches store protocol. [INFO] You are trusted by store uri: daemon ``` Fixes: https://git.lix.systems/lix-project/lix/issues/232 Change-Id: I21576e2a0a755036edf8814133345987617ba3d0
2024-04-08build: enable libstdc++ assertionsJade Lovelace
Benchmarks say that it does not regress performance by more than 1% (which is where it gets really hard to measure accurately anyhow). Meson appears to be planning to do this for us without asking us in a release we will get in the future, and it seems good enough to ship today: https://mesonbuild.com/Release-notes-for-1-4-0.html#ndebug-setting-now-controls-c-stdlib-assertions Benchmarks: | Command | Mean [ms] | Min [ms] | Max [ms] | Relative | |:---|---:|---:|---:|---:| | `result-asserts/bin/nix --extra-experimental-features 'nix-command flakes' eval -f ../nixpkgs/pkgs/development/haskell-modules/hackage-packages.nix` | 418.4 ± 25.0 | 396.9 | 451.2 | 1.01 ± 0.08 | | `result/bin/nix --extra-experimental-features 'nix-command flakes' eval -f ../nixpkgs/pkgs/development/haskell-modules/hackage-packages.nix` | 416.1 ± 23.9 | 397.1 | 445.4 | 1.00 | | Command | Mean [s] | Min [s] | Max [s] | Relative | |:---|---:|---:|---:|---:| | `GC_INITIAL_HEAP_SIZE=10g result-asserts/bin/nix eval --extra-experimental-features 'nix-command flakes' --raw --impure --expr 'with import <nixpkgs/nixos> {}; system'` | 4.147 ± 0.021 | 4.123 | 4.195 | 1.00 | | `GC_INITIAL_HEAP_SIZE=10g result/bin/nix eval --extra-experimental-features 'nix-command flakes' --raw --impure --expr 'with import <nixpkgs/nixos> {}; system'` | 4.149 ± 0.027 | 4.126 | 4.215 | 1.00 ± 0.01 | | Command | Mean [s] | Min [s] | Max [s] | Relative | |:---|---:|---:|---:|---:| | `result-asserts/bin/nix --extra-experimental-features 'nix-command flakes' eval --raw --impure --expr 'with import <nixpkgs/nixos> {}; system'` | 5.838 ± 0.023 | 5.799 | 5.867 | 1.01 ± 0.01 | | `result/bin/nix --extra-experimental-features 'nix-command flakes' eval --raw --impure --expr 'with import <nixpkgs/nixos> {}; system'` | 5.788 ± 0.044 | 5.715 | 5.876 | 1.00 | | Command | Mean [s] | Min [s] | Max [s] | Relative | |:---|---:|---:|---:|---:| | `result-asserts/bin/nix --extra-experimental-features 'nix-command flakes' search --no-eval-cache github:nixos/nixpkgs/e1fa12d4f6c6fe19ccb59cac54b5b3f25e160870 hello` | 15.993 ± 0.081 | 15.829 | 16.096 | 1.01 ± 0.01 | | `result/bin/nix --extra-experimental-features 'nix-command flakes' search --no-eval-cache github:nixos/nixpkgs/e1fa12d4f6c6fe19ccb59cac54b5b3f25e160870 hello` | 15.897 ± 0.075 | 15.807 | 16.047 | 1.00 | Fixes: https://git.lix.systems/lix-project/lix/issues/4 Change-Id: Id3a6f38274ba94d5d10b09edd19dfd96bc3e7d5f
2024-04-08release-notes: check with pre-commitJade Lovelace
This required making the build-release-notes script understand how to check multiple directories. Change-Id: I057f5f636155ab6c6fb5755da5217b7e72249ece
2024-04-08pre-commit: stop using the flakeJade Lovelace
The flake for pre-commit-checks is rather questionable. We ignored it so it uses our own nixpkgs and doesn't reimport nixpkgs. This should save a couple of seconds of eval time! Change-Id: I4584982beb32e0122f791fa29f6a544bdbb9e201
2024-04-08build-release-notes: support multiple PRs/CLsJade Lovelace
Change-Id: I923e4af099d02d2324777cc9f7e6d38b130aac10
2024-04-08Merge "Don't run libstore unit tests in project root" into mainrebecca “wiggles” turner
2024-04-08Merge "Fix REPL test parser nits" into mainrebecca “wiggles” turner
2024-04-08Format Nix code with `nixfmt`Rebecca Turner
Change-Id: I61efeb666ff7481c05fcb247168290e86a250151
2024-04-08Don't run libstore unit tests in project rootRebecca Turner
This keeps the libstore unit tests from writing `libstore-unit-tests.xml` to the project root. Change-Id: I0d9909aabf9f3574cc1e72a5ae81daefba9a394b
2024-04-08Fix REPL test parser nitsRebecca Turner
Follow-up to https://gerrit.lix.systems/c/lix/+/546 Change-Id: Ie603f01e5520329bf879e061cea9e3fba45213fd
2024-04-08Add `nixfmt`Rebecca Turner
Change-Id: I7f21695e3971cfd02b2cce0dd016ff6eb3389905
2024-04-08Merge "nix-doc -> lix-doc, make self-contained in package.nix" into mainjade
2024-04-08Merge "Rename some parse failure tests to `parse-fail-*`" into mainrebecca “wiggles” turner
2024-04-08Merge "Add `PathsSetting`" into mainrebecca “wiggles” turner
2024-04-08nix-doc -> lix-doc, make self-contained in package.nixJade Lovelace
package.nix previously needed this callPackage'd externally, which didn't make a lot of sense to us since this is an internal dependency. Thus we changed it to make it more self contained. Change-Id: I4935bc0bc80e1a132bc9b1519e917791da95037c
2024-04-07Merge pull request #10208 from 9999years/print-strings-directlyRobert Hensing
`:print` strings directly in `nix repl` (cherry picked from commit 3539172fd2f7cee639ce46423c58beca4231f2db) Change-Id: I1972f3bf3b56312851f38288509d371d37f21677 Upstream-PR: https://github.com/NixOS/nix/pull/10208
2024-04-07Add `PathsSetting`Rebecca Turner
Change-Id: I1165f6ef033a5f757ca3716d3f8008ba36b01fd0
2024-04-07flake: remove dead codeJade Lovelace
Some of this code existed for installer tests, and indeed its removal is an indication that our daemon cross-compatibility tests were removed. Although these are not like, super critical tests, we would like to restore them. See: https://git.lix.systems/lix-project/lix/issues/33 Change-Id: I75c733b25c00eca3a9676d498703bbfc1d6ec21b
2024-04-07Merge "flake: fix rl-next and rl-next-dev checks after 32eaa8a29 (fix nix ↵Qyriad
flake check)" into main
2024-04-07package: just use fileset from libQyriad
The following command is now sufficient to build Lix from outside of the flake: nix-build -E 'let pkgs = import <nixpkgs> { }; in pkgs.callPackage ./package.nix { build-release-notes = false; nix-doc = pkgs.callPackage ./nix-doc/package.nix { }; }' Change-Id: Ie6b14b446480ac07c7266d4fba20042b04cc35b9
2024-04-07flake: fix rl-next and rl-next-dev checks after 32eaa8a29 (fix nix flake check)Qyriad
follow-up to 32eaa8a29[1] "flake: move release note checks to hydraJobs", this commit fixes a load-bearing typo for`checks.rl-next` and `checks.rl-next-dev`. [1]: 32eaa8a2910793538deab31f85534faf7e722ef7 Change-Id: I9383ed21f7eccc337c0c2f65525418b735a94a1d
2024-04-07package: put boehmgc patch logic in package.nixQyriad
In our view it really doesn't make sense to not have this in in package.nix in some way. These patches aren't just for performance or something -- Lix flat out doesn't build without these patches. (Arguably that makes them a buildsystem responsibility as well, but that can wait for when we're ready to start adding subproject fallback dependency resolution to Meson.) This is a step towards making `package.nix` more self-sufficient and `callPackage`able without excessive external logic. With this change the following command is enough to build Lix from out of the flake: nix-build -E 'let pkgs = import <nixpkgs> { }; in pkgs.callPackage ./package.nix { build-release-notes = false; inherit (pkgs.lib) fileset; nix-doc = pkgs.callPackage ./nix-doc/package.nix { }; }' Change-Id: Ia37fe8171f87d3293033de8be07d9bab12716f1d
2024-04-06Merge "Rewrite REPL test parser" into mainrebecca “wiggles” turner
2024-04-06meson: fix warm nix3 CLI manual generationQyriad
`nix eval --write-to` refuses to write to a directory that exists at all, so now we generate in a temporary directory, and copy the generated tree to the build directory. This is equivalent to what the Make buildsystem did, actually, but hopefully more robust. Future work: documenting the doc generation architecture in the top-level meson.build outline comment. Change-Id: Ic3eb6d26e3cc249a1c042fd3ced22d637ac66a69
2024-04-06flake: move release note checks to hydraJobseldritch horrors
having them in checks only does not run them in CI, which can cause broken release notes entries to pass. fixes #228 Change-Id: If0ba7b1be0b6525fc884a27e941cbc84b5a160f9
2024-04-06avoid markdown which the repl's :doc cannot handlestuebinm
code blocks, if not surrounded by empty lines, have the language tags (in these cases, always `nix`) show up in the output of :doc. for example: nix-repl> :doc builtins.parseFlakeRef Synopsis: builtins.parseFlakeRef flake-ref Parse a flake reference, and return its exploded form. For example: nix builtins.parseFlakeRef "github:NixOS/nixpkgs/23.05?dir=lib" evaluates to: nix { dir = "lib"; owner = "NixOS"; ref = "23.05"; repo = "nixpkgs"; type = "github"; } is now instead: nix-repl> :doc builtins.parseFlakeRef Synopsis: builtins.parseFlakeRef flake-ref Parse a flake reference, and return its exploded form. For example: | builtins.parseFlakeRef "github:NixOS/nixpkgs/23.05?dir=lib" evaluates to: | { dir = "lib"; owner = "NixOS"; ref = "23.05"; repo = "nixpkgs"; type = "github"; } (closes #225) Change-Id: I0741aeb1006a5376bb2f663d202c7a4da7e38cce
2024-04-06Merge "package: add python to nativeBuildInputs" into mainQyriad