1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-24 19:29:36 +01:00
Commit graph

20125 commits

Author SHA1 Message Date
mergify[bot]
b0169fdc5f
Merge pull request #13633 from NixOS/mergify/bp/2.29-maintenance/pr-13360
libexpr: Remove non-const overload of `listElems` (backport #13360)
2025-07-31 02:11:56 +00:00
mergify[bot]
7b08e8d20e
Merge pull request #13610 from NixOS/mergify/bp/2.29-maintenance/pr-13304
Fix overriding gtest with gmock (backport #13304)
2025-07-31 02:11:52 +00:00
mergify[bot]
aabe327111
Merge pull request #13646 from NixOS/mergify/bp/2.29-maintenance/pr-13382
Update docs (backport #13382)
2025-07-31 02:11:49 +00:00
mergify[bot]
ab4951588b
Merge pull request #13620 from NixOS/mergify/bp/2.29-maintenance/pr-13326
docker.nix: Prevent double copy of nixpkgs source tree (backport #13326)
2025-07-31 02:11:46 +00:00
mergify[bot]
b41101c815
Merge pull request #13628 from NixOS/mergify/bp/2.29-maintenance/pr-13351
docker: make sure `nix config check` works (backport #13351)
2025-07-31 01:53:07 +00:00
mergify[bot]
cb73841205
Merge pull request #13626 from NixOS/mergify/bp/2.29-maintenance/pr-13347
Fix broken link in configuration description (backport #13347)
2025-07-31 01:53:04 +00:00
mergify[bot]
931ca7d11a
Merge pull request #13635 from NixOS/mergify/bp/2.29-maintenance/pr-13361
Fix a minor typo (backport #13361)
2025-07-31 01:53:01 +00:00
mergify[bot]
b5efc9ac56
Merge pull request #13618 from NixOS/mergify/bp/2.29-maintenance/pr-13321
Modify docker.nix to use mapAttrsToList instead of mapAttrsFlatten (backport #13321)
2025-07-31 01:52:59 +00:00
mergify[bot]
012f429104
Merge pull request #13639 from NixOS/mergify/bp/2.29-maintenance/pr-13373
Fix typo (backport #13373)
2025-07-31 01:52:55 +00:00
mergify[bot]
830dfc3b60
Merge pull request #13641 from NixOS/mergify/bp/2.29-maintenance/pr-13372
Fix broken link (backport #13372)
2025-07-31 01:49:41 +00:00
mergify[bot]
2968e18d37
Merge pull request #13637 from NixOS/mergify/bp/2.29-maintenance/pr-13368
libstore: fix race condition when creating state directories (backport #13368)
2025-07-31 01:49:39 +00:00
mergify[bot]
66a379a6de
Merge pull request #13596 from NixOS/mergify/bp/2.29-maintenance/pr-13257
Make the S3 test more robust (backport #13257)
2025-07-31 01:49:36 +00:00
mergify[bot]
1dcd12b819
Merge pull request #13592 from NixOS/mergify/bp/2.29-maintenance/pr-13245
nix-profile{,-daemon}.fish: check for profile in XDG_DATA_HOME (backport #13245)
2025-07-31 01:49:33 +00:00
mergify[bot]
2298df294b
Merge pull request #13602 from NixOS/mergify/bp/2.29-maintenance/pr-13277
nix flake archive: add --no-check-sigs option (backport #13277)
2025-07-31 01:49:30 +00:00
mergify[bot]
b4cd61900b
Merge pull request #13586 from NixOS/mergify/bp/2.29-maintenance/pr-13232
docs: add another equivalence for the implication operator (backport #13232)
2025-07-30 19:32:55 +00:00
mergify[bot]
2c258dd275
Merge pull request #13594 from NixOS/mergify/bp/2.29-maintenance/pr-13253
export/meson: Don't require `-std=c++2a` for -c libraries in `.pc` files (backport #13253)
2025-07-30 19:13:31 +00:00
mergify[bot]
75bece800d
Merge pull request #13599 from NixOS/mergify/bp/2.29-maintenance/pr-13275
Remove propagated-build-inputs when static (backport #13275)
2025-07-30 19:11:57 +00:00
mergify[bot]
582caa9d8f
Merge pull request #13580 from NixOS/mergify/bp/2.29-maintenance/pr-13211
libexpr: Actually cache line information in PosTable (backport #13211)
2025-07-30 19:11:53 +00:00
mergify[bot]
8a3d3b2dce
Merge pull request #13590 from NixOS/mergify/bp/2.29-maintenance/pr-13244
nix-profile{,-daemon}.fish: fix do not source twice (backport #13244)
2025-07-30 19:06:05 +00:00
mergify[bot]
56069a968b
Merge pull request #13582 from NixOS/mergify/bp/2.29-maintenance/pr-13213
docs: fix duplicate anchor (backport #13213)
2025-07-30 13:44:44 +00:00
Nikita Krasnov
ceb4d561fa Update docs
(cherry picked from commit 785f3867fd)
2025-07-30 13:00:38 +00:00
Nikita Krasnov
5d58ab8042 Fix broken link
(cherry picked from commit da76bc0cac)
2025-07-30 12:59:29 +00:00
Nikita Krasnov
27a8b457b8 Fix typo
(cherry picked from commit 86dda9884a)
2025-07-30 12:58:23 +00:00
Wolfgang Walther
229e97195a libstore: fix race condition when creating state directories
Running parallel nix in nix can lead to multiple instances trying to
create the state directories and failing on the `createSymlink` step,
because the link already exists.

`replaceSymlink` is already idempotent, so let's use that.

Resolves #2706

(cherry picked from commit d64c922164)
2025-07-30 12:56:36 +00:00
jayeshv
e3f4cef054 Fix a minor typo
(cherry picked from commit 699db04df3)
2025-07-30 12:55:32 +00:00
Sergei Zimmerman
223d3222b3 libexpr: Remove non-const overload of listElems
This overload isn't actually necessary anywhere and
doesn't make much sense. The pointers to `Value`s are
themselves const, but the `Value`s are mutable.
A non-const member function implies that the object itself
can be modified but this doesn't make much sense considering
the return type: `Value * const * `, which is a pointer
to a constant array of pointers to mutable values.

(cherry picked from commit 7b46eb9958)
2025-07-30 12:54:33 +00:00
Pol Dellaiera
a98f742d67 docker: make sure nix config check works
(cherry picked from commit 57c72dee9b)
2025-07-30 12:45:49 +00:00
Luc Perkins
e0ceebe2ee Fix broken link in configuration description
(cherry picked from commit 525078c59d)
2025-07-30 12:43:45 +00:00
Eelco Dolstra
bb0e9b20aa Prevent double copy of nixpkgs source tree
(cherry picked from commit 0a87ba0e39)
2025-07-30 12:40:33 +00:00
PopeRigby
d7ed70841a Modify docker.nix to use mapAttrsToList instead of mapAttrsFlatten
The latter alias is deprecated in favor of the former, and produces a
warning.

(cherry picked from commit cfc15d6921)
2025-07-30 12:39:36 +00:00
Farid Zakaria
82fa307ca6 Overriding gtest with gmock
How did this work before...

* Added .direnv/ to gitignore

(cherry picked from commit 58e34a2d27)
2025-07-30 12:35:28 +00:00
zimbatm
ee39380c12 nix flake archive: add --no-check-sigs option
Allows to copy the archive to a remote host and not get

    error: cannot add path '/nix/store/01x2k4nlxcpyd85nnr0b9gm89rm8ff4x-source' because it lacks a signature by a trusted key

(cherry picked from commit 80a4293486)
2025-07-30 12:24:10 +00:00
Tristan Ross
47ce401222 Remove propagated-build-inputs when static
(cherry picked from commit d07852b5f3)
2025-07-30 12:20:06 +00:00
Eelco Dolstra
78ac959e4c Make the S3 test more robust
Waiting for the minio unit is apparently not reliable enough, so let's
also wait for the port.

(cherry picked from commit ca9696748a)
2025-07-30 12:13:34 +00:00
Sergei Zimmerman
709349b118 export/meson: Don't require -std=c++2a for -c libraries in .pc files
(cherry picked from commit d8da8f0cd6)
2025-07-30 12:11:58 +00:00
Stefan Boca
9106a0b73a nix-profile{,-daemon}.fish: check for profile in XDG_DATA_HOME
...and also NIX_STATE_HOME in nix-profile.fish. This is directly
translated from the bash scripts and makes the fish scripts equivalent
in functionality to the bash scripts.

Note that nix-profile.fish checks for NIX_STATE_HOME and
nix-profile-daemon.fish does not, so the two scripts are no longer
identical.

(cherry picked from commit 751f50f4ad)
2025-07-30 12:04:56 +00:00
Stefan Boca
1b97d7409a nix-profile{,-daemon}.fish: fix do not source twice
Commit b36637c8f7 set
`__ETC_PROFILE_NIX_SOURCED` globally, but this is not enough to prevent
the script from being run again by child shells, because the
variable was not exported and thus not inherited by any child process.
Exporting the variable also agrees with the bash scripts.

Notably, the old behavior broke `nix develop -c fish` in some cases,
because the profile bin directory got prepended to the path, causing
binaries from the profile to override binareis from the devshell.

(cherry picked from commit b9ed3ae36e)
2025-07-30 12:03:51 +00:00
Stefan Boca
ab95054e64 nix-profile{,-daemon}.fish: format with fish_indent
(cherry picked from commit f627b8c721)
2025-07-30 12:03:50 +00:00
Gwenn Le Bihan
a5deed32f7 docs: add another equivalence for the implication operator
the second equivalence, using a if-else expression, aligns much closer to how most humans think about implication, adding it might help some people :)

(cherry picked from commit 51151c2c28)
2025-07-30 12:00:08 +00:00
Peder Bergebakken Sundt
94723d5b72 docs: fix duplicate anchor
`#deriving-path-encoding` is defined in two places, I _think_ this is the correct one to change.

(cherry picked from commit 4c50cf798e)
2025-07-30 11:53:57 +00:00
Sergei Zimmerman
ef8dc34bd0 libexpr: Actually cache line information in PosTable
Previous code had a sneaky bug due to which no caching
actually happened:

```cpp
auto linesForInput = (*lines)[origin->offset];
```

That should have been:
```cpp
auto & linesForInput = (*lines)[origin->offset];
```

See [1].

Now that it also makes sense to make the cache bound in side
in order not to memoize all the sources without freeing any memory.
The default cache size has been chosen somewhat arbitrarily to be ~64k
origins. For reference, 25.05 nixpkgs has ~50k .nix files.

Simple benchmark:

```nix
let
  pkgs = import <nixpkgs> { };
in
builtins.foldl' (acc: el: acc + el.line) 0 (
  builtins.genList (x: builtins.unsafeGetAttrPos "gcc" pkgs) 10000
)
```

(After)

```
$ hyperfine "result/bin/nix eval -f ./test.nix"
Benchmark 1: result/bin/nix eval -f ./test.nix
  Time (mean ± σ):     292.7 ms ±   3.9 ms    [User: 131.0 ms, System: 120.5 ms]
  Range (min … max):   288.1 ms … 300.5 ms    10 runs
```

(Before)

```
hyperfine "nix eval -f ./test.nix"
Benchmark 1: nix eval -f ./test.nix
  Time (mean ± σ):     666.7 ms ±   6.4 ms    [User: 428.3 ms, System: 191.2 ms]
  Range (min … max):   659.7 ms … 681.3 ms    10 runs
```

If the origin happens to be a `all-packages.nix` or similar in size then the
difference is much more dramatic.

[1]: 22e3f0e987

(cherry picked from commit 5ea81f5b8f)
2025-07-30 11:51:53 +00:00
Sergei Zimmerman
bb8b50e4f3 libutil: Add LRUCache::getOrNullptr
For heavier objects it doesn't make sense to return
a std::optional with the copy of the data, when it
can be used by const reference.

(cherry picked from commit 4711720efe)
2025-07-30 11:51:53 +00:00
mergify[bot]
0877680b08
Merge pull request #13561 from NixOS/mergify/bp/2.29-maintenance/pr-13558
meson: Fix `nix_system_cpu` for MIPS and 32 bit ARM systems (backport #13558)
2025-07-27 00:10:00 +00:00
Sergei Zimmerman
e37fce3899 meson: Fix nix_system_cpu for MIPS and 32 bit ARM systems
Prior patches in 54dc5314e8
and 6db6190002 fixed the default
system double for i686 and ppc/ppc64. This also patch also covers
32 bit arm and mips. ARM cpu names are taken from host_machine.cpu()
for a lack of a better option, but host_machine.cpu_family() is
preferred, since that is supposed to be somewhat standard for cross
files. Endianness is handled correctly by looking at host_machine.endian().

This also updates the documentation to be up to date to how system cpu
is translated from the host_machine specification.

(cherry picked from commit 60d124b36e)
2025-07-26 23:29:28 +00:00
Eelco Dolstra
c1f54da018
Merge pull request #13540 from NixOS/mergify/bp/2.29-maintenance/pr-13535
Fix nix_system_cpu on i686-linux (backport #13535)
2025-07-25 02:08:52 +02:00
Eelco Dolstra
a1efe99f5b
Fix nix_system_cpu on i686-linux
Fixes #13532.

(cherry picked from commit 54dc5314e8)
2025-07-25 02:53:50 +03:00
Sergei Zimmerman
359227ad14
meson: Correctly handle endianness for PowerPC CPU families
I've missed this while reviewing 6db6190002.
I only built big endian ppc64, so that didn't occur to me.

From meson manual:

> Those porting from autotools should note that Meson does not add
> endianness to the name of the cpu_family. For example, autotools will
> call little endian PPC64 "ppc64le", Meson will not, you must also check
> the .endian() value of the machine for this information.

This code should handle that correctly.

(cherry picked from commit ebd311b7b7)
2025-07-25 02:53:49 +03:00
Sergei Zimmerman
e0d2cf5a89
Merge pull request #13548 from NixOS/mergify/bp/2.29-maintenance/pr-13546
ci: Make it actually possible to disable dogfooding (backport #13546)
2025-07-25 02:53:03 +03:00
Sergei Zimmerman
da770a89e6
ci: Roll back default nix to 2.29.1 in install-nix-action
Daemon tests are broken in 2.30.1 Darwin sandbox and there's
no point release with the fix yet.
2025-07-25 02:22:07 +03:00
Sergei Zimmerman
58c71ed812 ci: Make it actually possible to disable dogfooding
Github composite actions are a real treat. Boolean inputs
are not actually booleans but rather strings [1].

[1]: https://www.github.com/actions/runner/issues/2238

(cherry picked from commit f0695e177f)
2025-07-24 23:18:36 +00:00