8.5 KiB
Release 2.30.0 (2025-07-07)
-
Reduce the size of value from 24 to 16 bytes #13407
This shaves off a very significant amount of memory used for evaluation (~20% percent reduction in maximum heap size and ~17% in total bytes).
-
builtins.sortuses PeekSort #12623Previously it used libstdc++'s
std::stable_sort(). However, that implementation is not reliable if the user-supplied comparison function is not a strict weak ordering. -
nix replprints which variables were loaded #11406Instead of
Added <n> variablesit now prints the first 10 variables that were added to the global scope. -
nix flake archive: add--no-check-sigsoption #13277This is useful when using
nix flake archivewith the destination set to a remote store. -
Emit warnings for IFDs with
trace-import-from-derivationoption #13279While we have the setting
allow-import-from-derivationto deny import-from-derivation (IFD), sometimes users would like to observe IFDs during CI processes to gradually phase out the idiom. The new settingtrace-import-from-derivation, when set, logs a simple warning to the console. -
build-dirno longer defaults to$TMPDIRThe directory in which temporary build directories are created no longer defaults to
TMPDIRor/tmp, to avoid builders making their directories world-accessible. This behavior allowed escaping the build sandbox and can cause build impurities even when not used maliciously. We now default tobuildsinNIX_STATE_DIR(which is/nix/var/nix/buildsin the default configuration). -
Deprecate manually making structured attrs with
__json = ...;#13220The proper way to create a derivation using structured attrs in the Nix language is by using
__structuredAttrs = truewithbuiltins.derivation. However, by exploiting how structured attrs are implementated, it has also been possible to create them by setting the__jsonenvironment variable to a serialized JSON string. This sneaky alternative method is now deprecated, and may be disallowed in future versions of Nix. -
Add stack sampling evaluation profiler #13220
Nix evaluator now supports stack sampling evaluation profiling via
--eval-profiler flamegraphsetting. It collects collapsed call stack information to output file specified by--eval-profile-file(nix.profileby default) in a format directly consumable byflamegraph.pland compatible tools like speedscope. Sampling frequency can be configured via--eval-profiler-frequency(99 Hz by default).Unlike existing
--trace-function-callsthis profiler includes the name of the function being called when it's available. -
json-log-pathsetting #13003New setting
json-log-paththat sends a copy of all Nix log messages (in JSON format) to a file or Unix domain socket. -
Rename
nix profile installtonix profile add#13224The command
nix profile installhas been renamed tonix profile add(though the former is still available as an alias). This is because the verb "add" is a better antonym for the verb "remove" (i.e.nix profile remove). Nix also does not have install hooks or general behavior often associated with "installing". -
Non-flake inputs now contain a
sourceInfoattribute #13164 #13170Flakes have always had a
sourceInfoattribute which describes the source of the flake. ThesourceInfo.outPathis often identical to the flake'soutPath. However, it can differ when the flake is located in a subdirectory of its source.Non-flake inputs (i.e. inputs with
flake = false) can also be located at some path within a wider source. This usually happens when defining a relative path input within the same source as the parent flake, e.g.inputs.foo.url = ./some-file.nix. Such relative inputs will now inherit their parent'ssourceInfo.This also means it is now possible to use
?dir=subdiron non-flake inputs.This iterates on the work done in 2.26 to improve relative path support (#10089), and resolves a regression introduced in 2.28 relating to nested relative path inputs (#13164).
-
Revert incomplete closure mixed download and build feature #77 #12628 #13176
Since Nix 1.3 (
299141ecbdin 2013) Nix has attempted to mix together upstream fresh builds and downstream substitutions when remote substuters contain an "incomplete closure" (have some store objects, but not the store objects they reference). This feature is now removed.Worst case, removing this feature could cause more building downstream, but it should not cause outright failures, since this is not happening for opaque store objects that we don't know how to build if we decide not to substitute. In practice, however, we doubt even the more building is very likely to happen. Remote stores that are missing dependencies in arbitrary ways (e.g. corruption) don't seem to be very common.
On the contrary, when remote stores fail to implement the closure property, it is usually an intentional choice on the part of the remote store, because it wishes to serve as an "overlay" store over another store, such as
https://cache.nixos.org. If an "incomplete closure" is encountered in that situation, the right fix is not to do some sort of "franken-building" as this feature implemented, but instead to make sure both substituters are enabled in the settings.(In the future, we should make it easier for remote stores to indicate this to clients, to catch settings that won't work in general before a missing dependency is actually encountered.)
Contributors
This release was made possible by the following 32 contributors:
- Robert Hensing (@roberth)
- Jörg Thalheim (@Mic92)
- Egor Konovalov (@egorkonovalov)
- PopeRigby (@poperigby)
- Peder Bergebakken Sundt (@pbsds)
- Farid Zakaria (@fzakaria)
- Gwenn Le Bihan (@gwennlbh)
- Jade Masker (@donottellmetonottellyou)
- Nikita Krasnov (@synalice)
- tomberek (@tomberek)
- Wolfgang Walther (@wolfgangwalther)
- Samuli Thomasson (@SimSaladin)
- h0nIg (@h0nIg)
- Valentin Gagarin (@fricklerhandwerk)
- Vladimír Čunát (@vcunat)
- Graham Christensen (@grahamc)
- kstrafe (@kstrafe)
- gustavderdrache (@gustavderdrache)
- Matt Sturgeon (@MattSturgeon)
- John Ericson (@Ericson2314)
- Tristan Ross (@RossComputerGuy)
- jayeshv (@jayeshv)
- Eelco Dolstra (@edolstra)
- pennae (@pennae)
- Luc Perkins (@lucperkins)
- Cole Helbling (@cole-h)
- Pol Dellaiera (@drupol)
- Sergei Zimmerman (@xokdvium)
- Seth Flynn (@getchoo)
- Jonas Chevalier (@zimbatm)
- Stefan Boca (@stefanboca)
- Jeremy Fleischman (@jfly)
- Philipp Otterbein
- Raito Bezarius