···1212 version
1313 versionSuffix
1414 warn;
1515+ inherit (lib)
1616+ isString
1717+ ;
1518in {
16191720 ## Simple (higher order) functions
···718721 importTOML = path:
719722 builtins.fromTOML (builtins.readFile path);
720723721721- ## Warnings
724724+ /**
722725723723- # See https://github.com/NixOS/nix/issues/749. Eventually we'd like these
724724- # to expand to Nix builtins that carry metadata so that Nix can filter out
725725- # the INFO messages without parsing the message string.
726726- #
727727- # Usage:
728728- # {
729729- # foo = lib.warn "foo is deprecated" oldFoo;
730730- # bar = lib.warnIf (bar == "") "Empty bar is deprecated" bar;
731731- # }
732732- #
733733- # TODO: figure out a clever way to integrate location information from
734734- # something like __unsafeGetAttrPos.
726726+ `warn` *`message`* *`value`*
735727736736- /**
737737- Print a warning before returning the second argument. This function behaves
738738- like `builtins.trace`, but requires a string message and formats it as a
739739- warning, including the `warning: ` prefix.
728728+ Print a warning before returning the second argument.
740729741741- To get a call stack trace and abort evaluation, set the environment variable
742742- `NIX_ABORT_ON_WARN=true` and set the Nix options `--option pure-eval false --show-trace`
730730+ See [`builtins.warn`](https://nix.dev/manual/nix/latest/language/builtins.html#builtins-warn) (Nix >= 2.23).
731731+ On older versions, the Nix 2.23 behavior is emulated with [`builtins.trace`](https://nix.dev/manual/nix/latest/language/builtins.html#builtins-warn), including the [`NIX_ABORT_ON_WARN`](https://nix.dev/manual/nix/latest/command-ref/conf-file#conf-abort-on-warn) behavior, but not the `nix.conf` setting or command line option.
743732744733 # Inputs
745734746746- `msg`
735735+ *`message`* (String)
747736748748- : Warning message to print.
737737+ : Warning message to print before evaluating *`value`*.
749738750750- `val`
739739+ *`value`* (any value)
751740752741 : Value to return as-is.
753742754743 # Type
755744756745 ```
757757- string -> a -> a
746746+ String -> a -> a
758747 ```
759748 */
760749 warn =
761761- if lib.elem (builtins.getEnv "NIX_ABORT_ON_WARN") ["1" "true" "yes"]
762762- then msg: builtins.trace "[1;31mwarning: ${msg}[0m" (abort "NIX_ABORT_ON_WARN=true; warnings are treated as unrecoverable errors.")
763763- else msg: builtins.trace "[1;31mwarning: ${msg}[0m";
750750+ # Since Nix 2.23, https://github.com/NixOS/nix/pull/10592
751751+ builtins.warn or (
752752+ let mustAbort = lib.elem (builtins.getEnv "NIX_ABORT_ON_WARN") ["1" "true" "yes"];
753753+ in
754754+ # Do not eta reduce v, so that we have the same strictness as `builtins.warn`.
755755+ msg: v:
756756+ # `builtins.warn` requires a string message, so we enforce that in our implementation, so that callers aren't accidentally incompatible with newer Nix versions.
757757+ assert isString msg;
758758+ if mustAbort
759759+ then builtins.trace "[1;31mevaluation warning:[0m ${msg}" (abort "NIX_ABORT_ON_WARN=true; warnings are treated as unrecoverable errors.")
760760+ else builtins.trace "[1;35mevaluation warning:[0m ${msg}" v
761761+ );
764762765763 /**
766766- Like warn, but only warn when the first argument is `true`.
767764765765+ `warnIf` *`condition`* *`message`* *`value`*
766766+767767+ Like `warn`, but only warn when the first argument is `true`.
768768769769 # Inputs
770770771771- `cond`
771771+ *`condition`* (Boolean)
772772773773- : 1\. Function argument
773773+ : `true` to trigger the warning before continuing with *`value`*.
774774775775- `msg`
775775+ *`message`* (String)
776776777777- : 2\. Function argument
777777+ : Warning message to print before evaluating
778778779779- `val`
779779+ *`value`* (any value)
780780781781 : Value to return as-is.
782782783783 # Type
784784785785 ```
786786- bool -> string -> a -> a
786786+ Bool -> String -> a -> a
787787 ```
788788 */
789789 warnIf = cond: msg: if cond then warn msg else x: x;
790790791791 /**
792792- Like warnIf, but negated (warn if the first argument is `false`).
793792793793+ `warnIfNot` *`condition`* *`message`* *`value`*
794794+795795+ Like `warnIf`, but negated: warn if the first argument is `false`.
794796795797 # Inputs
796798797797- `cond`
799799+ *`condition`*
798800799799- : 1\. Function argument
801801+ : `false` to trigger the warning before continuing with `val`.
800802801801- `msg`
803803+ *`message`*
802804803803- : 2\. Function argument
805805+ : Warning message to print before evaluating *`value`*.
804806805805- `val`
807807+ *`value`*
806808807809 : Value to return as-is.
808810809811 # Type
810812811813 ```
812812- bool -> string -> a -> a
814814+ Boolean -> String -> a -> a
813815 ```
814816 */
815817 warnIfNot = cond: msg: if cond then x: x else warn msg;
+2
nixos/doc/manual/release-notes/rl-2411.section.md
···56565757- [Apache Tika](https://github.com/apache/tika), a toolkit that detects and extracts metadata and text from over a thousand different file types. Available as [services.tika](option.html#opt-services.tika).
58585959+- [Improved File Manager](https://github.com/misterunknown/ifm), or IFM, a single-file web-based file manager.
6060+5961## Backward Incompatibilities {#sec-release-24.11-incompatibilities}
60626163- `transmission` package has been aliased with a `trace` warning to `transmission_3`. Since [Transmission 4 has been released last year](https://github.com/transmission/transmission/releases/tag/4.0.0), and Transmission 3 will eventually go away, it was decided perform this warning alias to make people aware of the new version. The `services.transmission.package` defaults to `transmission_3` as well because the upgrade can cause data loss in certain specific usage patterns (examples: [#5153](https://github.com/transmission/transmission/issues/5153), [#6796](https://github.com/transmission/transmission/issues/6796)). Please make sure to back up to your data directory per your usage:
···8686 '';
8787 };
88888989- disabledTests = lib.optionals stdenv.isDarwin [
8989+ disabledTests = [
9090+ # flaky, sometimes fail to strip uuid from AIMessageChunk before comparing to test value
9191+ "test_map_stream"
9292+ ]
9393+ ++ lib.optionals stdenv.isDarwin [
9094 # Langchain-core the following tests due to the test comparing execution time with magic values.
9195 "test_queue_for_streaming_via_sync_call"
9296 "test_same_event_loop"