diff options
63 files changed, 541 insertions, 90 deletions
diff --git a/doc/manual/change-authors.yml b/doc/manual/change-authors.yml new file mode 100644 index 000000000..732c459a8 --- /dev/null +++ b/doc/manual/change-authors.yml @@ -0,0 +1,63 @@ +# This file is a mapping of metadata for change authors, sort of like +# maintainer-list.nix in nixpkgs. +# +# It's used for crediting people accurately in release notes. The release notes +# script will link to forgejo, then to GitHub if forgejo is not present. +horrors: + display_name: eldritch horrors + forgejo: pennae + github: pennae + +Qyriad: + forgejo: Qyriad + github: Qyriad + +jade: + forgejo: jade + github: lf- + +iFreilicht: + github: iFreilicht + +ma27: + forgejo: ma27 + github: ma27 + +Lunaphied: + forgejo: Lunaphied + github: Lunaphied + +9999years: + display_name: wiggles + github: 9999years + forgejo: rbt + +matthewbauer: + github: matthewbauer + +raito: + display_name: Raito Bezarius + github: RaitoBezarius + forgejo: raito + +winter: + github: winterqt + forgejo: winter + +Kha: + github: Kha + +Artturin: + github: Artturin + +thufschmitt: + display_name: Théophane Hufschmitt + github: thufschmitt + +edolstra: + display_name: Eelco Dolstra + github: edolstra + +roberth: + display_name: Robert Hensing + github: roberth diff --git a/doc/manual/rclone.conf b/doc/manual/rclone.conf new file mode 100644 index 000000000..c37c12638 --- /dev/null +++ b/doc/manual/rclone.conf @@ -0,0 +1,8 @@ +[lix-docs] +type = s3 +provider = Other +env_auth = true +endpoint = https://s3.lix.systems +location_constraint = garage +region = garage +acl = private diff --git a/doc/manual/rl-next/better-errors-in-nix-repl.md b/doc/manual/rl-next/better-errors-in-nix-repl.md index 14ead8d0c..2f2714a0e 100644 --- a/doc/manual/rl-next/better-errors-in-nix-repl.md +++ b/doc/manual/rl-next/better-errors-in-nix-repl.md @@ -2,6 +2,8 @@ synopsis: Concise error printing in `nix repl` prs: 9928 cls: 811 +category: Improvements +credits: 9999years --- Previously, if an element of a list or attribute set threw an error while diff --git a/doc/manual/rl-next/consistent-nix-build.md b/doc/manual/rl-next/consistent-nix-build.md new file mode 100644 index 000000000..d5929dc8e --- /dev/null +++ b/doc/manual/rl-next/consistent-nix-build.md @@ -0,0 +1,6 @@ +--- +synopsis: Show all FOD errors with `nix build --keep-going` +--- + +`nix build --keep-going` now behaves consistently with `nix-build --keep-going`. This means +that if e.g. multiple FODs fail to build, all hash mismatches are displayed. diff --git a/doc/manual/rl-next/debugger-locals-for-let-expressions.md b/doc/manual/rl-next/debugger-locals-for-let-expressions.md index 048687631..3f0352327 100644 --- a/doc/manual/rl-next/debugger-locals-for-let-expressions.md +++ b/doc/manual/rl-next/debugger-locals-for-let-expressions.md @@ -2,6 +2,8 @@ synopsis: "`--debugger` can now access bindings from `let` expressions" prs: 9918 issues: 8827 +category: Fixes +credits: 9999years --- Breakpoints and errors in the bindings of a `let` expression can now access diff --git a/doc/manual/rl-next/debugger-on-trace.md b/doc/manual/rl-next/debugger-on-trace.md index 721928550..131d85377 100644 --- a/doc/manual/rl-next/debugger-on-trace.md +++ b/doc/manual/rl-next/debugger-on-trace.md @@ -1,6 +1,8 @@ --- synopsis: Enter the `--debugger` when `builtins.trace` is called if `debugger-on-trace` is set prs: 9914 +category: Features +credits: 9999years --- If the `debugger-on-trace` option is set and `--debugger` is given, diff --git a/doc/manual/rl-next/drop-vendored-toml11.md b/doc/manual/rl-next/drop-vendored-toml11.md index 83bffac31..3e5e44e0d 100644 --- a/doc/manual/rl-next/drop-vendored-toml11.md +++ b/doc/manual/rl-next/drop-vendored-toml11.md @@ -1,6 +1,8 @@ --- synopsis: Stop vendoring toml11 cls: 675 +category: Packaging +credits: winter --- We don't apply any patches to it, and vendoring it locks users into diff --git a/doc/manual/rl-next/drv-string-parse-hang.md b/doc/manual/rl-next/drv-string-parse-hang.md index 1e041d3e9..ab1f17306 100644 --- a/doc/manual/rl-next/drv-string-parse-hang.md +++ b/doc/manual/rl-next/drv-string-parse-hang.md @@ -1,6 +1,8 @@ --- synopsis: Fix handling of truncated `.drv` files. prs: 9673 +category: Fixes +credits: horrors --- Previously a `.drv` that was truncated in the middle of a string would case nix to enter an infinite loop, eventually exhausting all memory and crashing. diff --git a/doc/manual/rl-next/dup-attr-errors.md b/doc/manual/rl-next/dup-attr-errors.md index cce3d9f30..2b8a4fd09 100644 --- a/doc/manual/rl-next/dup-attr-errors.md +++ b/doc/manual/rl-next/dup-attr-errors.md @@ -1,6 +1,8 @@ --- synopsis: Duplicate attribute reports are more accurate cls: 557 +credits: horrors +category: Improvements --- Duplicate attribute errors are now more accurate, showing the path at which an error was detected rather than the full, possibly longer, path that caused the error. diff --git a/doc/manual/rl-next/empty-search-regex.md b/doc/manual/rl-next/empty-search-regex.md index 5f3f293d3..b5e38207a 100644 --- a/doc/manual/rl-next/empty-search-regex.md +++ b/doc/manual/rl-next/empty-search-regex.md @@ -1,6 +1,8 @@ --- synopsis: Disallow empty search regex in `nix search` prs: 9481 +credits: [iFreilicht, horrors] +category: Miscellany --- [`nix search`](@docroot@/command-ref/new-cli/nix3-search.md) now requires a search regex to be passed. To show all packages, use `^`. diff --git a/doc/manual/rl-next/enter-debugger-more-reliably-in-let-and-calls.md b/doc/manual/rl-next/enter-debugger-more-reliably-in-let-and-calls.md index 49e6c1cc8..b94bea3c0 100644 --- a/doc/manual/rl-next/enter-debugger-more-reliably-in-let-and-calls.md +++ b/doc/manual/rl-next/enter-debugger-more-reliably-in-let-and-calls.md @@ -2,6 +2,8 @@ synopsis: The `--debugger` will start more reliably in `let` expressions and function calls prs: 9917 issues: 6649 +credits: [9999years, horrors] +category: Fixes --- Previously, if you attempted to evaluate this file with the debugger: diff --git a/doc/manual/rl-next/env-size-reduction.md b/doc/manual/rl-next/env-size-reduction.md index 40a58bc28..3367e5f91 100644 --- a/doc/manual/rl-next/env-size-reduction.md +++ b/doc/manual/rl-next/env-size-reduction.md @@ -1,6 +1,9 @@ --- synopsis: Reduce eval memory usage and wall time prs: 9658 +cls: 207 +credits: horrors +category: Improvements --- Reduce the size of the `Env` struct used in the evaluator by a pointer, or 8 bytes on most modern machines. diff --git a/doc/manual/rl-next/eval-system.md b/doc/manual/rl-next/eval-system.md index 54456cd6c..d0fd66175 100644 --- a/doc/manual/rl-next/eval-system.md +++ b/doc/manual/rl-next/eval-system.md @@ -1,6 +1,8 @@ --- synopsis: Add new `eval-system` setting prs: 4093 +credits: [matthewbauer, horrors] +category: Features --- Add a new `eval-system` option. diff --git a/doc/manual/rl-next/fchmodat2-sandbox.md b/doc/manual/rl-next/fchmodat2-sandbox.md index 82429a93d..aaa499ccb 100644 --- a/doc/manual/rl-next/fchmodat2-sandbox.md +++ b/doc/manual/rl-next/fchmodat2-sandbox.md @@ -1,6 +1,8 @@ --- synopsis: Creating setuid/setgid binaries with fchmodat2 is now prohibited by the build sandbox prs: 10501 +credits: ma27 +category: Fixes --- The build sandbox blocks any attempt to create setuid/setgid binaries, but didn't check diff --git a/doc/manual/rl-next/fix-nested-follows.md b/doc/manual/rl-next/fix-nested-follows.md index d4a381ba4..5ef655c03 100644 --- a/doc/manual/rl-next/fix-nested-follows.md +++ b/doc/manual/rl-next/fix-nested-follows.md @@ -2,6 +2,9 @@ synopsis: Fix nested flake input `follows` prs: 6621 cls: 994 +credits: [Kha, ma27] +category: Fixes +significance: significant --- Previously nested-input overrides were ignored; that is, the following did not diff --git a/doc/manual/rl-next/forbid-nested-debuggers.md b/doc/manual/rl-next/forbid-nested-debuggers.md index a5924b24f..c96440572 100644 --- a/doc/manual/rl-next/forbid-nested-debuggers.md +++ b/doc/manual/rl-next/forbid-nested-debuggers.md @@ -1,6 +1,8 @@ --- synopsis: Nested debuggers are no longer supported prs: 9920 +credits: 9999years +category: Improvements --- Previously, evaluating an expression that throws an error in the debugger would diff --git a/doc/manual/rl-next/formal-order.md b/doc/manual/rl-next/formal-order.md index 12628e318..7b1922784 100644 --- a/doc/manual/rl-next/formal-order.md +++ b/doc/manual/rl-next/formal-order.md @@ -1,6 +1,8 @@ --- synopsis: consistent order of lambda formals in printed expressions prs: 9874 +credits: horrors +category: Fixes --- Always print lambda formals in lexicographic order rather than the internal, creation-time based symbol order. diff --git a/doc/manual/rl-next/inherit-error-positions.md b/doc/manual/rl-next/inherit-error-positions.md index 643080e9e..b840433fb 100644 --- a/doc/manual/rl-next/inherit-error-positions.md +++ b/doc/manual/rl-next/inherit-error-positions.md @@ -1,6 +1,8 @@ --- synopsis: fix duplicate attribute error positions for `inherit` prs: 9874 +credits: horrors +category: Fixes --- -When an inherit caused a duplicate attribute error the position of the error was not reported correctly, placing the error with the inherit itself or at the start of the bindings block instead of the offending attribute name. +When an inherit caused a duplicate attribute error, the position of the error was not reported correctly, placing the error with the inherit itself or at the start of the bindings block instead of the offending attribute name. diff --git a/doc/manual/rl-next/inherit-from-by-need.md b/doc/manual/rl-next/inherit-from-by-need.md index 67c2cdedf..d198cf314 100644 --- a/doc/manual/rl-next/inherit-from-by-need.md +++ b/doc/manual/rl-next/inherit-from-by-need.md @@ -1,6 +1,8 @@ --- synopsis: "`inherit (x) ...` evaluates `x` only once" prs: 9847 +category: Fixes +credits: horrors --- `inherit (x) a b ...` now evaluates the expression `x` only once for all inherited attributes rather than once for each inherited attribute. diff --git a/doc/manual/rl-next/leading-period.md b/doc/manual/rl-next/leading-period.md index 7a2fd1f67..4b7f6c189 100644 --- a/doc/manual/rl-next/leading-period.md +++ b/doc/manual/rl-next/leading-period.md @@ -2,6 +2,8 @@ synopsis: Store paths are allowed to start with `.` issues: 912 prs: [9867, 9091, 9095, 9120, 9121, 9122, 9130, 9219, 9224] +credits: [roberth, horrors] +category: Fixes --- Leading periods were allowed by accident in Nix 2.4. The Nix team has considered this to be a bug, but this behavior has since been relied on by users, leading to unnecessary difficulties. diff --git a/doc/manual/rl-next/new-assertions.md b/doc/manual/rl-next/new-assertions.md index efaaeb306..15cc2ad88 100644 --- a/doc/manual/rl-next/new-assertions.md +++ b/doc/manual/rl-next/new-assertions.md @@ -1,6 +1,9 @@ --- synopsis: Lix turns more internal bugs into crashes cls: [797, 626] +credits: jade +category: Packaging +significance: significant --- Lix now enables build options such as trapping on signed overflow and enabling diff --git a/doc/manual/rl-next/nix-config-show.md b/doc/manual/rl-next/nix-config-show.md index 1e7545e73..d162f9c3a 100644 --- a/doc/manual/rl-next/nix-config-show.md +++ b/doc/manual/rl-next/nix-config-show.md @@ -2,6 +2,11 @@ synopsis: rename 'nix show-config' to 'nix config show' issues: 7672 prs: 9477 +cls: 993 +credits: [thufschmitt, ma27] +category: Improvements --- `nix show-config` was renamed to `nix config show` to be more consistent with the rest of the command-line interface. + +Running `nix show-config` will now print a deprecation warning saying to use `nix config show` instead. diff --git a/doc/manual/rl-next/nix-env-json-drv-path.md b/doc/manual/rl-next/nix-env-json-drv-path.md index 734cefd1b..c98bd9ee2 100644 --- a/doc/manual/rl-next/nix-env-json-drv-path.md +++ b/doc/manual/rl-next/nix-env-json-drv-path.md @@ -1,6 +1,8 @@ --- synopsis: Fix `nix-env --query --drv-path --json` prs: 9257 +credits: [Artturin, horrors] +category: Fixes --- Fixed a bug where `nix-env --query` ignored `--drv-path` when `--json` was set. diff --git a/doc/manual/rl-next/nix-flake-check-logs-actions.md b/doc/manual/rl-next/nix-flake-check-logs-actions.md index 01ec56a3a..c38826e89 100644 --- a/doc/manual/rl-next/nix-flake-check-logs-actions.md +++ b/doc/manual/rl-next/nix-flake-check-logs-actions.md @@ -2,6 +2,10 @@ synopsis: "`nix flake check` logs the checks" issues: 8882 prs: 8893 +cls: [259, 260, 261, 262] +credits: [9999years, raito, horrors] +category: Improvements +significance: significant --- `nix flake check` now logs the checks it runs and the derivations it evaluates: diff --git a/doc/manual/rl-next/nix-flake-update-ux.md b/doc/manual/rl-next/nix-flake-update-ux.md index 82f00f542..3c17ee32d 100644 --- a/doc/manual/rl-next/nix-flake-update-ux.md +++ b/doc/manual/rl-next/nix-flake-update-ux.md @@ -1,6 +1,8 @@ --- -synopsis: "`Overhaul `nix flake update` and `nix flake lock` UX" +synopsis: "Overhaul `nix flake update` and `nix flake lock` UX" prs: 8817 +credits: [iFreilicht, Lunaphied, thufschmitt] +category: Breaking Changes --- The interface for creating and updating lock files has been overhauled: diff --git a/doc/manual/rl-next/nix-profile-names.md b/doc/manual/rl-next/nix-profile-names.md index 0b2cd35d9..9f87bcf20 100644 --- a/doc/manual/rl-next/nix-profile-names.md +++ b/doc/manual/rl-next/nix-profile-names.md @@ -2,6 +2,8 @@ synopsis: "`nix profile` now allows referring to elements by human-readable name, and no longer accepts indices" prs: 8678 cls: [978, 980] +category: Breaking Changes +credits: [iFreilicht, Qyriad, edolstra] --- [`nix profile`](@docroot@/command-ref/new-cli/nix3-profile.md) now uses names to refer to installed packages when running [`list`](@docroot@/command-ref/new-cli/nix3-profile-list.md), [`remove`](@docroot@/command-ref/new-cli/nix3-profile-remove.md) or [`upgrade`](@docroot@/command-ref/new-cli/nix3-profile-upgrade.md) as opposed to indices. Indices have been removed. Profile element names are generated when a package is installed and remain the same until the package is removed. diff --git a/doc/manual/rl-next/nixversion-fake.md b/doc/manual/rl-next/nixversion-fake.md index 6e42b2bd2..725b8e609 100644 --- a/doc/manual/rl-next/nixversion-fake.md +++ b/doc/manual/rl-next/nixversion-fake.md @@ -1,11 +1,17 @@ --- -synopsis: "`builtins.nixVersion` now returns a fixed value \"2.18.3-lix\"" -cls: 558 +synopsis: "`builtins.nixVersion` and `builtins.langVersion` return fixed values" +cls: [558, 1144] +credits: jade +category: Breaking Changes --- -`builtins.nixVersion` now returns a fixed value `"2.18.3-lix"`. This prevents -feature detection assuming that features that exist in Nix post-Lix-branch-off -might exist, even though the Lix version is greater than the Nix version. +`builtins.nixVersion` now returns a fixed value `"2.18.3-lix"`. + +`builtins.langVersion` returns a fixed value `6`, matching CppNix 2.18. + +This prevents feature detection assuming that features that exist in Nix +post-Lix-branch-off might exist, even though the Lix version is greater than +the Nix version. In the future, check for builtins for feature detection. If a feature cannot be detected by *those* means, please file a Lix bug. diff --git a/doc/manual/rl-next/no-cache-eval-errors.md b/doc/manual/rl-next/no-cache-eval-errors.md index c80d96dba..b82b571e3 100644 --- a/doc/manual/rl-next/no-cache-eval-errors.md +++ b/doc/manual/rl-next/no-cache-eval-errors.md @@ -1,6 +1,8 @@ --- synopsis: re-evaluate cached evaluation errors cls: 771 +credits: Qyriad +category: Fixes --- "cached failure of [expr]" errors have been removed: expressions already in the diff --git a/doc/manual/rl-next/print-value-in-coercion-error.md b/doc/manual/rl-next/print-value-in-coercion-error.md index cbd6caee6..03ec5b26f 100644 --- a/doc/manual/rl-next/print-value-in-coercion-error.md +++ b/doc/manual/rl-next/print-value-in-coercion-error.md @@ -2,6 +2,8 @@ synopsis: Coercion errors include the failing value issues: 561 prs: 9754 +credits: [9999years, horrors] +category: Improvements --- The `error: cannot coerce a <TYPE> to a string` message now includes the value diff --git a/doc/manual/rl-next/print-value-in-type-error.md b/doc/manual/rl-next/print-value-in-type-error.md index cbd3b7b7f..3d07f156d 100644 --- a/doc/manual/rl-next/print-value-in-type-error.md +++ b/doc/manual/rl-next/print-value-in-type-error.md @@ -2,6 +2,8 @@ synopsis: Type errors include the failing value issues: 561 prs: 9753 +credits: [9999years, horrors] +category: Improvements --- In errors like `value is an integer while a list was expected`, the message now diff --git a/doc/manual/rl-next/reduce-debugger-clutter.md b/doc/manual/rl-next/reduce-debugger-clutter.md index 9bc902eee..c310804fd 100644 --- a/doc/manual/rl-next/reduce-debugger-clutter.md +++ b/doc/manual/rl-next/reduce-debugger-clutter.md @@ -1,6 +1,8 @@ --- synopsis: "Visual clutter in `--debugger` is reduced" prs: 9919 +category: Improvements +credits: [9999years, horrors] --- Before: diff --git a/doc/manual/rl-next/repl-doc-command.md b/doc/manual/rl-next/repl-doc-command.md index 84aaa0802..765e8de50 100644 --- a/doc/manual/rl-next/repl-doc-command.md +++ b/doc/manual/rl-next/repl-doc-command.md @@ -1,6 +1,9 @@ --- synopsis: Experimental REPL support for documentation comments using `:doc` cls: 564 +category: Features +credits: [Lunaphied, jade] +significance: significant --- Using `:doc` in the REPL now supports showing documentation comments when defined on a function. diff --git a/doc/manual/rl-next/repl-interrupt.md b/doc/manual/rl-next/repl-interrupt.md new file mode 100644 index 000000000..61a8ab71e --- /dev/null +++ b/doc/manual/rl-next/repl-interrupt.md @@ -0,0 +1,8 @@ +--- +synopsis: Interrupting builds in the REPL works more than once +cls: 1097 +--- + +Builds in the REPL can be interrupted by pressing Ctrl+C. +Previously, this only worked once per REPL session; further attempts would be ignored. +This issue is now fixed, so that builds can be canceled consistently. diff --git a/doc/manual/rl-next/repl-overlays.md b/doc/manual/rl-next/repl-overlays.md index 9f48cf381..da69efdca 100644 --- a/doc/manual/rl-next/repl-overlays.md +++ b/doc/manual/rl-next/repl-overlays.md @@ -2,6 +2,9 @@ synopsis: Add `repl-overlays` option prs: 10203 cls: 504 +credits: 9999years +significance: significant +category: Features --- A `repl-overlays` option has been added, which specifies files that can overlay diff --git a/doc/manual/rl-next/short-expr-flag.md b/doc/manual/rl-next/short-expr-flag.md index 5fddd3a25..61ceff24b 100644 --- a/doc/manual/rl-next/short-expr-flag.md +++ b/doc/manual/rl-next/short-expr-flag.md @@ -1,9 +1,11 @@ --- synopsis: reintroduce shortened `-E` form for `--expr` to new CLI cls: 605 +credits: Lunaphied +category: Improvements --- -In the past, it was possible to supply a shorter `-E` flag instead of fully +In the old CLI, it was possible to supply a shorter `-E` flag instead of fully specifying `--expr` every time you wished to provide an expression that would be evaluated to produce the given command's input. This was retained for the `--file` flag when the new CLI utilities were written with `-f`, but `-E` was diff --git a/doc/manual/rl-next/source-location-in-while-evaluating-attribute.md b/doc/manual/rl-next/source-location-in-while-evaluating-attribute.md index 0e0b74c5a..b72241862 100644 --- a/doc/manual/rl-next/source-location-in-while-evaluating-attribute.md +++ b/doc/manual/rl-next/source-location-in-while-evaluating-attribute.md @@ -1,6 +1,8 @@ --- synopsis: "In the debugger, `while evaluating the attribute` errors now include position information" prs: 9915 +credits: 9999years +category: Fixes --- Before: diff --git a/doc/manual/rl-next/source-positions-in-errors.md b/doc/manual/rl-next/source-positions-in-errors.md index 1556f8b64..a9de87f28 100644 --- a/doc/manual/rl-next/source-positions-in-errors.md +++ b/doc/manual/rl-next/source-positions-in-errors.md @@ -2,6 +2,8 @@ synopsis: Source locations are printed more consistently in errors issues: 561 prs: 9555 +credits: [9999years, horrors] +category: Improvements --- Source location information is now included in error messages more diff --git a/doc/manual/rl-next/stack-overflow-segfaults.md b/doc/manual/rl-next/stack-overflow-segfaults.md index 3d9753248..24d62ea1e 100644 --- a/doc/manual/rl-next/stack-overflow-segfaults.md +++ b/doc/manual/rl-next/stack-overflow-segfaults.md @@ -2,6 +2,9 @@ synopsis: Some stack overflow segfaults are fixed issues: 9616 prs: 9617 +cls: 205 +category: Improvements +credits: [9999years, horrors] --- The number of nested function calls has been restricted, to detect and report diff --git a/doc/manual/rl-next/upgrade-nix-override.md b/doc/manual/rl-next/upgrade-nix-override.md index d3046ff13..819f7e7f8 100644 --- a/doc/manual/rl-next/upgrade-nix-override.md +++ b/doc/manual/rl-next/upgrade-nix-override.md @@ -1,6 +1,8 @@ --- -synopsis: add --store-path argument to `nix upgrade-nix`, to manually specify the Nix to upgrade to +synopsis: add `--store-path` argument to `nix upgrade-nix`, to manually specify the Nix to upgrade to cls: 953 +credits: Qyriad +category: Features --- `nix upgrade-nix` by default downloads a manifest to find the new Nix version to upgrade to, but now you can specify `--store-path` to upgrade Nix to an arbitrary version from the Nix store. diff --git a/doc/manual/rl-next/upgrade-nix-profile-compat.md b/doc/manual/rl-next/upgrade-nix-profile-compat.md index df9879c6f..012d0e7e5 100644 --- a/doc/manual/rl-next/upgrade-nix-profile-compat.md +++ b/doc/manual/rl-next/upgrade-nix-profile-compat.md @@ -1,6 +1,8 @@ --- synopsis: using `nix profile` on `/nix/var/nix/profiles/default` no longer breaks `nix upgrade-nix` cls: 952 +credits: Qyriad +category: Fixes --- On non-NixOS, Nix is conventionally installed into a `nix-env` style profile at /nix/var/nix/profiles/default. diff --git a/doc/manual/rl-next/upstart-removal.md b/doc/manual/rl-next/upstart-removal.md index b1b7ad176..5166d6b15 100644 --- a/doc/manual/rl-next/upstart-removal.md +++ b/doc/manual/rl-next/upstart-removal.md @@ -1,6 +1,8 @@ --- synopsis: Upstart scripts removed cls: 574 +category: Packaging +credits: jade --- Upstart scripts have been removed from Lix, since Upstart is obsolete and has diff --git a/doc/manual/rl-next/with-error-reporting.md b/doc/manual/rl-next/with-error-reporting.md index f6c4a36fe..8258fd51b 100644 --- a/doc/manual/rl-next/with-error-reporting.md +++ b/doc/manual/rl-next/with-error-reporting.md @@ -1,6 +1,9 @@ --- synopsis: Better error reporting for `with` expressions prs: 9658 +cls: 207 +credits: horrors +category: Improvements --- `with` expressions using non-attrset values to resolve variables are now reported with proper positions. diff --git a/doc/manual/src/release-notes/meson.build b/doc/manual/src/release-notes/meson.build index 87e74c248..d9ce7bdda 100644 --- a/doc/manual/src/release-notes/meson.build +++ b/doc/manual/src/release-notes/meson.build @@ -1,12 +1,14 @@ rl_next_generated = custom_target( command : [ 'bash', + '-euo', + 'pipefail', '-c', ''' if type -p build-release-notes > /dev/null; then - build-release-notes @CURRENT_SOURCE_DIR@ + build-release-notes --change-authors @CURRENT_SOURCE_DIR@/../../change-authors.yml @CURRENT_SOURCE_DIR@/../../rl-next fi - @0@ @INPUT0@ @CURRENT_SOURCE_DIR@ > @DEPFILE@ + @0@ @INPUT0@ @CURRENT_SOURCE_DIR@/../../rl-next > @DEPFILE@ '''.format( python.full_path(), ), @@ -57,7 +57,7 @@ officialRelease = false; # Set to true to build the release notes for the next release. - buildUnreleasedNotes = false; + buildUnreleasedNotes = true; version = lib.fileContents ./.version + versionSuffix; versionSuffix = @@ -222,7 +222,7 @@ pkgs = nixpkgsFor.${system}.native; in pkgs.buildPackages.runCommand "test-${name}-release-notes" { } '' - LANG=C.UTF-8 ${lib.getExe pkgs.build-release-notes} ${dir} >$out + LANG=C.UTF-8 ${lib.getExe pkgs.build-release-notes} --change-authors ${./doc/manual/change-authors.yml} ${dir} >$out ''; in { diff --git a/maintainers/build-release-notes.py b/maintainers/build-release-notes.py index 2a154a61e..45d5d6ff9 100644 --- a/maintainers/build-release-notes.py +++ b/maintainers/build-release-notes.py @@ -1,25 +1,78 @@ +from collections import defaultdict import frontmatter import sys import pathlib import textwrap +from typing import Any, Tuple +import dataclasses +import yaml -GH_BASE = "https://github.com/NixOS/nix" -FORGEJO_BASE = "https://git.lix.systems/lix-project/lix" +GH_ROOT = "https://github.com/" +GH_REPO_BASE = "https://github.com/NixOS/nix" +FORGEJO_REPO_BASE = "https://git.lix.systems/lix-project/lix" +FORGEJO_ROOT = "https://git.lix.systems/" GERRIT_BASE = "https://gerrit.lix.systems/c/lix/+" +KNOWN_KEYS = ('synopsis', 'cls', 'issues', 'prs', 'significance', 'category', 'credits') SIGNIFICANCECES = { None: 0, 'significant': 10, } +# This is just hardcoded for better validation. If you think there should be +# more of them, feel free to add more. +CATEGORIES = [ + 'Breaking Changes', + 'Features', + 'Improvements', + 'Fixes', + 'Packaging', + 'Miscellany', +] + + +@dataclasses.dataclass +class AuthorInfo: + name: str + github: str | None = None + forgejo: str | None = None + display_name: str | None = None + + def show_name(self) -> str: + return self.display_name or self.name + + def __str__(self) -> str: + if self.forgejo: + return f'[{self.show_name()}]({FORGEJO_ROOT}{self.forgejo})' + elif self.github: + return f'[{self.show_name()}]({GH_ROOT}{self.github})' + else: + return self.show_name() + + +class AuthorInfoDB: + def __init__(self, author_info: dict[str, dict], throw_on_missing: bool): + self.author_info = {name: AuthorInfo(name=name, **d) for (name, d) in author_info.items()} + self.throw_on_missing = throw_on_missing + + def __getitem__(self, name) -> str: + if name in self.author_info: + return str(self.author_info[name]) + else: + if self.throw_on_missing: + raise Exception(f'Missing author info for author {name}') + else: + return name + + def format_link(ident: str, gh_part: str, fj_part: str) -> str: # FIXME: deprecate github as default if ident.isdigit(): - num, link, base = int(ident), f"#{ident}", f"{GH_BASE}/{gh_part}" + num, link, base = int(ident), f"#{ident}", f"{GH_REPO_BASE}/{gh_part}" elif ident.startswith("gh#"): - num, link, base = int(ident[3:]), ident, f"{GH_BASE}/{gh_part}" + num, link, base = int(ident[3:]), ident, f"{GH_REPO_BASE}/{gh_part}" elif ident.startswith("fj#"): - num, link, base = int(ident[3:]), ident, f"{FORGEJO_BASE}/{fj_part}" + num, link, base = int(ident[3:]), ident, f"{FORGEJO_REPO_BASE}/{fj_part}" else: raise Exception("unrecognized reference format", ident) return f"[{link}]({base}/{num})" @@ -31,28 +84,20 @@ def format_pr(pr: str) -> str: def format_cl(clid: int) -> str: return f"[cl/{clid}]({GERRIT_BASE}/{clid})" -def run_on_dir(d): - paths = pathlib.Path(d).glob('*.md') - entries = [] - for p in paths: - try: - e = frontmatter.load(p) - if 'synopsis' not in e.metadata: - raise Exception('missing synopsis') - unknownKeys = set(e.metadata.keys()) - set(('synopsis', 'cls', 'issues', 'prs', 'significance')) - if unknownKeys: - raise Exception('unknown keys', unknownKeys) - entries.append((p, e)) - except Exception as e: - e.add_note(f"in {p}") - raise +def plural_list(strs: list[str]) -> str: + if len(strs) <= 1: + return ''.join(strs) + else: + comma = ',' if len(strs) >= 3 else '' + return '{}{} and {}'.format(', '.join(strs[:-1]), comma, strs[-1]) - def listify(l: list | int) -> list: - if not isinstance(l, list): - return [l] - else: - return l +def listify(l: list | int) -> list: + if not isinstance(l, list): + return [l] + else: + return l +def do_category(author_info: AuthorInfoDB, entries: list[Tuple[pathlib.Path, Any]]): for p, entry in sorted(entries, key=lambda e: (-SIGNIFICANCECES[e[1].metadata.get('significance')], e[0])): try: header = entry.metadata['synopsis'] @@ -66,11 +111,57 @@ def run_on_dir(d): print(f"- {header}") print() print(textwrap.indent(entry.content, ' ')) - print() + if credits := listify(entry.metadata.get('credits', [])): + print() + print(textwrap.indent('Many thanks to {} for this.'.format(plural_list(list(author_info[c] for c in credits))), ' ')) except Exception as e: e.add_note(f"in {p}") raise + +def run_on_dir(author_info: AuthorInfoDB, d): + d = pathlib.Path(d) + if not d.is_dir(): + raise ValueError(f'provided path {d} is not a directory') + paths = pathlib.Path(d).glob('*.md') + entries = defaultdict(list) + for p in paths: + try: + e = frontmatter.load(p) + if 'synopsis' not in e.metadata: + raise Exception('missing synopsis') + unknownKeys = set(e.metadata.keys()) - set(KNOWN_KEYS) + if unknownKeys: + raise Exception('unknown keys', unknownKeys) + category = e.metadata.get('category', 'Miscellany') + if category not in CATEGORIES: + raise Exception('unknown category', category) + entries[category].append((p, e)) + except Exception as e: + e.add_note(f"in {p}") + raise + + for category in CATEGORIES: + if entries[category]: + print('\n#', category) + do_category(author_info, entries[category]) + +def main(): + import argparse + + ap = argparse.ArgumentParser() + ap.add_argument('--change-authors', help='File name of the change authors metadata YAML file', type=argparse.FileType('r')) + ap.add_argument('dirs', help='Directories to run on', nargs='+') + + args = ap.parse_args() + + author_info = AuthorInfoDB(yaml.safe_load(args.change_authors), throw_on_missing=True) \ + if args.change_authors \ + else AuthorInfoDB({}, throw_on_missing=False) + + for d in args.dirs: + run_on_dir(author_info, d) + + if __name__ == '__main__': - for d in sys.argv[1:]: - run_on_dir(d) + main() diff --git a/maintainers/release-notes b/maintainers/release-notes index 477df31f1..51864cbc2 100755 --- a/maintainers/release-notes +++ b/maintainers/release-notes @@ -152,7 +152,7 @@ section_title="Release $version_full ($DATE)" # TODO add minor number, and append? echo "# $section_title" echo - build-release-notes doc/manual/rl-next + build-release-notes --change-authors doc/manual/change-authors.yml doc/manual/rl-next ) | tee -a $file log "Wrote $file" diff --git a/maintainers/upload_manual.sh b/maintainers/upload_manual.sh new file mode 100755 index 000000000..f50520490 --- /dev/null +++ b/maintainers/upload_manual.sh @@ -0,0 +1,40 @@ +#!/usr/bin/env bash +set -euo pipefail + +cd "$(dirname -- "$0")/.." + +# This script uploads the Lix manual to the Lix s3 store. +# It expects credentials to be configured like so: +# +# ~/.aws/credentials: +# +# [default] +# aws_access_key_id = SOMEACCESSKEY +# aws_secret_access_key = SOMESECRETKEY +# +# default can also be replaced by some other string if AWS_PROFILE is set in +# environment. +# +# See: https://rclone.org/s3/#authentication +# +# To obtain such a key, log into the garage host and run: +# (obtain GARAGE_RPC_SECRET into environment perhaps by systemctl cat garage) +# garage key create SOME-KEY-NAME +# garage bucket allow --read --write docs --key SOME-KEY-NAME + +if [[ ! -f result-doc/share/doc/nix/manual/index.html ]]; then + echo -e "result-doc does not appear to contain a Lix manual. You can build one with:\n nix build '.#default^*'" >&2 + exit 1 +fi + +# --checksum: https://rclone.org/s3/#avoiding-head-requests-to-read-the-modification-time +# By default rclone uses the modification time to determine if something needs +# syncing. This is actually very bad for our use case, since we have small +# files that have meaningless (Unix epoch) local modification time data. We can +# make it go both 16x faster and more correct by using md5s instead. +rclone \ + --config doc/manual/rclone.conf \ + -vv \ + sync \ + --checksum \ + result-doc/share/doc/nix/manual/ lix-docs:docs/manual/nightly/ diff --git a/misc/pre-commit.nix b/misc/pre-commit.nix index b287f3cec..ea39bc21d 100644 --- a/misc/pre-commit.nix +++ b/misc/pre-commit.nix @@ -60,10 +60,10 @@ pre-commit-run { release-notes = { enable = true; package = pkgs.build-release-notes; - files = "^doc/manual/rl-next(-dev)?"; + files = ''^doc/manual/(change-authors\.yml|rl-next(-dev)?)''; pass_filenames = false; entry = '' - ${lib.getExe pkgs.build-release-notes} doc/manual/rl-next doc/manual/rl-next-dev + ${lib.getExe pkgs.build-release-notes} --change-authors doc/manual/change-authors.yml doc/manual/rl-next doc/manual/rl-next-dev ''; }; check-headers = { diff --git a/package.nix b/package.nix index 0186b7472..83a4411ec 100644 --- a/package.nix +++ b/package.nix @@ -51,9 +51,9 @@ pname ? "nix", versionSuffix ? "", - officialRelease ? true, + officialRelease ? false, # Set to true to build the release notes for the next release. - buildUnreleasedNotes ? false, + buildUnreleasedNotes ? true, internalApiDocs ? false, # Not a real argument, just the only way to approximate let-binding some diff --git a/src/libcmd/installables.cc b/src/libcmd/installables.cc index dca17555a..2c18653e4 100644 --- a/src/libcmd/installables.cc +++ b/src/libcmd/installables.cc @@ -547,6 +547,37 @@ std::vector<BuiltPathWithResult> Installable::build( return res; } +static void throwBuildErrors( + std::vector<KeyedBuildResult> & buildResults, + const Store & store) +{ + std::vector<KeyedBuildResult> failed; + for (auto & buildResult : buildResults) { + if (!buildResult.success()) { + failed.push_back(buildResult); + } + } + + auto failedResult = failed.begin(); + if (failedResult != failed.end()) { + if (failed.size() == 1) { + failedResult->rethrow(); + } else { + StringSet failedPaths; + for (; failedResult != failed.end(); failedResult++) { + if (!failedResult->errorMsg.empty()) { + logError(ErrorInfo{ + .level = lvlError, + .msg = failedResult->errorMsg, + }); + } + failedPaths.insert(failedResult->path.to_string(store)); + } + throw Error("build of %s failed", concatStringsSep(", ", quoteStrings(failedPaths))); + } + } +} + std::vector<std::pair<ref<Installable>, BuiltPathWithResult>> Installable::build2( ref<Store> evalStore, ref<Store> store, @@ -608,10 +639,9 @@ std::vector<std::pair<ref<Installable>, BuiltPathWithResult>> Installable::build if (settings.printMissing) printMissing(store, pathsToBuild, lvlInfo); - for (auto & buildResult : store->buildPathsWithResults(pathsToBuild, bMode, evalStore)) { - if (!buildResult.success()) - buildResult.rethrow(); - + auto buildResults = store->buildPathsWithResults(pathsToBuild, bMode, evalStore); + throwBuildErrors(buildResults, *store); + for (auto & buildResult : buildResults) { for (auto & aux : backmap[buildResult.path]) { std::visit(overloaded { [&](const DerivedPath::Built & bfd) { diff --git a/src/libcmd/repl.cc b/src/libcmd/repl.cc index 696bb3c12..525c25560 100644 --- a/src/libcmd/repl.cc +++ b/src/libcmd/repl.cc @@ -141,7 +141,11 @@ struct NixRepl * Note: This is `shared_ptr` to avoid garbage collection. */ std::shared_ptr<Value *> replOverlaysEvalFunction = + #if HAVE_BOEHMGC std::allocate_shared<Value *>(traceable_allocator<Value *>(), nullptr); + #else + std::make_shared<Value *>(nullptr); + #endif /** * Get the `info` AttrSet that's passed as the first argument to each @@ -262,6 +266,8 @@ ReplExitStatus NixRepl::mainLoop() std::string input; while (true) { + _isInterrupted = false; + // When continuing input from previous lines, don't print a prompt, just align to the same // number of chars as the prompt. if (!interacter->getLine(input, input.empty() ? ReplPromptType::ReplPrompt : ReplPromptType::ContinuationPrompt)) { @@ -424,8 +430,6 @@ ProcessLineResult NixRepl::processLine(std::string line) if (line.empty()) return ProcessLineResult::PromptAgain; - _isInterrupted = false; - std::string command, arg; if (line[0] == ':') { diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc index 33a2688f1..e36b800c3 100644 --- a/src/libexpr/primops.cc +++ b/src/libexpr/primops.cc @@ -4355,10 +4355,13 @@ void EvalState::createBaseEnv() .doc = R"( Legacy version of Nix. Always returns "2.18.3-lix" on Lix. - To determine if features exist, Nix scripts should instead use direct - means of feature detection, such as checking for existence of - builtins they want to use. Doing so allows for much better compatibility - across implementations. + Code in the Nix language should use other means of feature detection + like detecting the presence of builtins, rather than trying to find + the version of the Nix implementation, as there may be other Nix + implementations with different feature combinations. + + If the feature you want to write compatibility code for cannot be + detected by any means, please file a Lix bug. )", }); @@ -4377,15 +4380,23 @@ void EvalState::createBaseEnv() )", }); - /* Language version. This should be increased every time a new - language feature gets added. It's not necessary to increase it - when primops get added, because you can just use `builtins ? - primOp' to check. */ + /* Legacy language version. + * This is fixed at 6, and will never change in the future on Lix. + * A better language versioning construct needs to be built instead. */ v.mkInt(6); addConstant("__langVersion", v, { .type = nInt, .doc = R"( - The current version of the Nix language. + The legacy version of the Nix language. Always is `6` on Lix, + matching Nix 2.18. + + Code in the Nix language should use other means of feature detection + like detecting the presence of builtins, rather than trying to find + the version of the Nix implementation, as there may be other Nix + implementations with different feature combinations. + + If the feature you want to write compatibility code for cannot be + detected by any means, please file a Lix bug. )", }); diff --git a/src/libmain/shared.cc b/src/libmain/shared.cc index 9d4dd41ed..96ecbac8f 100644 --- a/src/libmain/shared.cc +++ b/src/libmain/shared.cc @@ -320,16 +320,7 @@ int handleExceptions(const std::string & programName, std::function<void()> fun) std::string error = ANSI_RED "error:" ANSI_NORMAL " "; try { - try { - fun(); - } catch (...) { - /* Subtle: we have to make sure that any `interrupted' - condition is discharged before we reach printMsg() - below, since otherwise it will throw an (uncaught) - exception. */ - setInterruptThrown(); - throw; - } + fun(); } catch (Exit & e) { return e.status; } catch (UsageError & e) { diff --git a/src/libstore/build/local-derivation-goal.cc b/src/libstore/build/local-derivation-goal.cc index e7a1e0147..3429afafa 100644 --- a/src/libstore/build/local-derivation-goal.cc +++ b/src/libstore/build/local-derivation-goal.cc @@ -174,6 +174,10 @@ void LocalDerivationGoal::killSandbox(bool getStats) void LocalDerivationGoal::tryLocalBuild() { +#if __APPLE__ + additionalSandboxProfile = parsedDrv->getStringAttr("__sandboxProfile").value_or(""); +#endif + unsigned int curBuilds = worker.getNrLocalBuilds(); if (curBuilds >= settings.maxBuildJobs) { state = &DerivationGoal::tryToBuild; @@ -192,7 +196,6 @@ void LocalDerivationGoal::tryLocalBuild() throw Error("derivation '%s' has '__noChroot' set, " "but that's not allowed when 'sandbox' is 'true'", worker.store.printStorePath(drvPath)); #if __APPLE__ - additionalSandboxProfile = parsedDrv->getStringAttr("__sandboxProfile").value_or(""); if (additionalSandboxProfile != "") throw Error("derivation '%s' specifies a sandbox profile, " "but this is only allowed when 'sandbox' is 'relaxed'", worker.store.printStorePath(drvPath)); diff --git a/src/libutil/signals.cc b/src/libutil/signals.cc index f5c79b325..41fdc9dc8 100644 --- a/src/libutil/signals.cc +++ b/src/libutil/signals.cc @@ -9,21 +9,14 @@ namespace nix { std::atomic<bool> _isInterrupted = false; -static thread_local bool interruptThrown = false; thread_local std::function<bool()> interruptCheck; -void setInterruptThrown() -{ - interruptThrown = true; -} - void _interrupted() { /* Block user interrupts while an exception is being handled. Throwing an exception while another exception is being handled kills the program! */ - if (!interruptThrown && !std::uncaught_exceptions()) { - interruptThrown = true; + if (!std::uncaught_exceptions()) { throw Interrupted("interrupted by the user"); } } diff --git a/src/libutil/signals.hh b/src/libutil/signals.hh index c58dc37cf..71593df95 100644 --- a/src/libutil/signals.hh +++ b/src/libutil/signals.hh @@ -22,8 +22,6 @@ extern std::atomic<bool> _isInterrupted; extern thread_local std::function<bool()> interruptCheck; -void setInterruptThrown(); - void _interrupted(); void inline checkInterrupt() diff --git a/tests/functional/build.sh b/tests/functional/build.sh index 7fbdb0f07..95a20dc6a 100644 --- a/tests/functional/build.sh +++ b/tests/functional/build.sh @@ -133,3 +133,35 @@ nix build --impure -f multiple-outputs.nix --json e --no-link | jq --exit-status # Make sure that `--stdin` works and does not apply any defaults printf "" | nix build --no-link --stdin --json | jq --exit-status '. == []' printf "%s\n" "$drv^*" | nix build --no-link --stdin --json | jq --exit-status '.[0]|has("drvPath")' + +# --keep-going and FOD +out="$(nix build -f fod-failing.nix -L 2>&1)" && status=0 || status=$? +test "$status" = 1 +# one "hash mismatch" error, one "build of ... failed" +test "$(<<<"$out" grep -E '^error:' | wc -l)" = 2 +<<<"$out" grepQuiet -E "hash mismatch in fixed-output derivation '.*-x1\\.drv'" +<<<"$out" grepQuiet -vE "hash mismatch in fixed-output derivation '.*-x3\\.drv'" +<<<"$out" grepQuiet -vE "hash mismatch in fixed-output derivation '.*-x2\\.drv'" +<<<"$out" grepQuiet -E "error: build of '.*-x[1-4]\\.drv\\^out', '.*-x[1-4]\\.drv\\^out', '.*-x[1-4]\\.drv\\^out', '.*-x[1-4]\\.drv\\^out' failed" + +out="$(nix build -f fod-failing.nix -L x1 x2 x3 --keep-going 2>&1)" && status=0 || status=$? +test "$status" = 1 +# three "hash mismatch" errors - for each failing fod, one "build of ... failed" +test "$(<<<"$out" grep -E '^error:' | wc -l)" = 4 +<<<"$out" grepQuiet -E "hash mismatch in fixed-output derivation '.*-x1\\.drv'" +<<<"$out" grepQuiet -E "hash mismatch in fixed-output derivation '.*-x3\\.drv'" +<<<"$out" grepQuiet -E "hash mismatch in fixed-output derivation '.*-x2\\.drv'" +<<<"$out" grepQuiet -E "error: build of '.*-x[1-3]\\.drv\\^out', '.*-x[1-3]\\.drv\\^out', '.*-x[1-3]\\.drv\\^out' failed" + +out="$(nix build -f fod-failing.nix -L x4 2>&1)" && status=0 || status=$? +test "$status" = 1 +test "$(<<<"$out" grep -E '^error:' | wc -l)" = 2 +<<<"$out" grepQuiet -E "error: 1 dependencies of derivation '.*-x4\\.drv' failed to build" +<<<"$out" grepQuiet -E "hash mismatch in fixed-output derivation '.*-x2\\.drv'" + +out="$(nix build -f fod-failing.nix -L x4 --keep-going 2>&1)" && status=0 || status=$? +test "$status" = 1 +test "$(<<<"$out" grep -E '^error:' | wc -l)" = 3 +<<<"$out" grepQuiet -E "error: 2 dependencies of derivation '.*-x4\\.drv' failed to build" +<<<"$out" grepQuiet -vE "hash mismatch in fixed-output derivation '.*-x3\\.drv'" +<<<"$out" grepQuiet -vE "hash mismatch in fixed-output derivation '.*-x2\\.drv'" diff --git a/tests/functional/common/vars-and-functions.sh.in b/tests/functional/common/vars-and-functions.sh.in index 3d2e44024..3b343b720 100644 --- a/tests/functional/common/vars-and-functions.sh.in +++ b/tests/functional/common/vars-and-functions.sh.in @@ -54,8 +54,6 @@ export busybox="@sandbox_shell@" export version=@PACKAGE_VERSION@ export system=@system@ -export BUILD_SHARED_LIBS=@BUILD_SHARED_LIBS@ - export IMPURE_VAR1=foo export IMPURE_VAR2=bar diff --git a/tests/functional/extra-sandbox-profile.nix b/tests/functional/extra-sandbox-profile.nix new file mode 100644 index 000000000..aa680b918 --- /dev/null +++ b/tests/functional/extra-sandbox-profile.nix @@ -0,0 +1,19 @@ +{ destFile, seed }: + +with import ./config.nix; + +mkDerivation { + name = "simple"; + __sandboxProfile = '' + # Allow writing any file in the filesystem + (allow file*) + ''; + inherit seed; + buildCommand = '' + ( + set -x + touch ${destFile} + touch $out + ) + ''; +} diff --git a/tests/functional/extra-sandbox-profile.sh b/tests/functional/extra-sandbox-profile.sh new file mode 100644 index 000000000..ac3ca036f --- /dev/null +++ b/tests/functional/extra-sandbox-profile.sh @@ -0,0 +1,23 @@ +source common.sh + +if [[ $(uname) != Darwin ]]; then skipTest "Need Darwin"; fi + +DEST_FILE="${TEST_ROOT}/foo" + +testSandboxProfile () ( + set -e + + sandboxMode="$1" + + rm -f "${DEST_FILE}" + nix-build --no-out-link ./extra-sandbox-profile.nix \ + --option sandbox "$sandboxMode" \ + --argstr seed "$RANDOM" \ + --argstr destFile "${DEST_FILE}" + + ls -l "${DEST_FILE}" +) + +testSandboxProfile "false" +expectStderr 2 testSandboxProfile "true" +testSandboxProfile "relaxed" diff --git a/tests/functional/fod-failing.nix b/tests/functional/fod-failing.nix new file mode 100644 index 000000000..37c04fe12 --- /dev/null +++ b/tests/functional/fod-failing.nix @@ -0,0 +1,39 @@ +with import ./config.nix; +rec { + x1 = mkDerivation { + name = "x1"; + builder = builtins.toFile "builder.sh" + '' + echo $name > $out + ''; + outputHashMode = "recursive"; + outputHash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="; + }; + x2 = mkDerivation { + name = "x2"; + builder = builtins.toFile "builder.sh" + '' + echo $name > $out + ''; + outputHashMode = "recursive"; + outputHash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="; + }; + x3 = mkDerivation { + name = "x3"; + builder = builtins.toFile "builder.sh" + '' + echo $name > $out + ''; + outputHashMode = "recursive"; + outputHash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="; + }; + x4 = mkDerivation { + name = "x4"; + inherit x2 x3; + builder = builtins.toFile "builder.sh" + '' + echo $x2 $x3 + exit 1 + ''; + }; +} diff --git a/tests/functional/meson.build b/tests/functional/meson.build index 3f4a970a7..1e68cfe8c 100644 --- a/tests/functional/meson.build +++ b/tests/functional/meson.build @@ -7,7 +7,6 @@ test_confdata = { 'sandbox_shell': busybox.found() ? busybox.full_path() : '', 'PACKAGE_VERSION': meson.project_version(), 'system': host_system, - 'BUILD_SHARED_LIBS': '1', # XXX(Qyriad): detect this! } # Just configures `common/vars-and-functions.sh.in`. @@ -180,10 +179,15 @@ functional_tests_scripts = [ 'read-only-store.sh', 'nested-sandboxing.sh', 'debugger.sh', - 'plugins.sh', 'test-libstoreconsumer.sh', + 'extra-sandbox-profile.sh', ] +# Plugin tests require shared libraries support. +if get_option('default_library') != 'static' + functional_tests_scripts += ['plugins.sh'] +endif + # TODO(Qyriad): this will hopefully be able to be removed when we remove the autoconf+Make # buildsystem. See the comments at the top of setup-functional-tests.py for why this is here. meson.add_install_script( diff --git a/tests/functional/plugins.sh b/tests/functional/plugins.sh index 5934b9b0c..1b6528f3b 100644 --- a/tests/functional/plugins.sh +++ b/tests/functional/plugins.sh @@ -1,9 +1,5 @@ source common.sh -if [[ $BUILD_SHARED_LIBS != 1 ]]; then - skipTest "Plugins are not supported" -fi - # FIXME(Qyriad): this is working around Meson putting `libplugintest.so.p` in the same place # as `libplugintest.so`, so `libplugintest.*` grabs both. libext=so |