Commit graph

12590 commits

Author SHA1 Message Date
Eelco Dolstra
15f37eeb5a Merge remote-tracking branch 'origin/master' into lazy-trees 2022-08-04 13:34:38 +02:00
Eelco Dolstra
075bf6e556
Merge pull request #6861 from edolstra/fix-count-calls
Fix NIX_COUNT_CALLS=1
2022-08-03 18:26:01 +02:00
Eelco Dolstra
ccbd906c86 Fix NIX_COUNT_CALLS=1
Also, make the JSON writer support std::string_view.

Fixes #6857.
2022-08-03 17:46:51 +02:00
Eelco Dolstra
55a10576c1 nix repl: Print accessors in paths 2022-08-03 16:36:20 +02:00
Théophane Hufschmitt
7d1ccd9105
Merge pull request #6846 from fricklerhandwerk/values
manual: use subheadings for primitive types
2022-08-03 14:50:41 +02:00
Théophane Hufschmitt
c55bea4204 Fix the html id of the list headers 2022-08-03 14:16:00 +02:00
Valentin Gagarin
ceed4d4142 encode primitive as list with anchors
to make it consistent with builtins and configuration options
2022-08-03 11:25:41 +02:00
Théophane Hufschmitt
780a479386
Merge pull request #6851 from K900/patch-1
doc/distributed-builds: don't use deprecated alias
2022-08-02 07:17:09 +02:00
Eelco Dolstra
71b155b9e6 Move download stuff into tarball.hh 2022-08-01 16:05:58 +02:00
Eelco Dolstra
48012603b3 Move FSInputAccessor into a separate file 2022-08-01 16:00:12 +02:00
Eelco Dolstra
55c63c9b89 Remove InputScheme::fetchToStore()
InputSchemes now only have a getAccessor(). They could be implemented
internally by fetching the input to the store, but in that case they
will just return a FSInputAccessor.
2022-08-01 15:44:40 +02:00
K900
f675ba5331
doc/distributed-builds: don't use deprecated alias
`nix ping-store` -> `nix store ping`.
2022-08-01 13:50:35 +03:00
Rok Garbas
e9178d7d4a
Merge pull request #6844 from centromere/custom-nix-conf
docker.nix: Allow Nix configuration to be customized
2022-07-29 13:47:24 +02:00
Valentin Gagarin
27138f1ec6
manual: use singular in body, too
Co-authored-by: Cole Helbling <cole.e.helbling@outlook.com>
2022-07-28 23:30:07 +02:00
Valentin Gagarin
41a3b315fd manual: values -> data types 2022-07-28 17:25:25 +02:00
Valentin Gagarin
8f4fab8fab manual: use singular for headings 2022-07-28 17:25:18 +02:00
Valentin Gagarin
4ff48854b8 manual: simple values -> primitives
"simple" is a loaded term
2022-07-28 17:23:57 +02:00
Valentin Gagarin
3063e5b94c manual: use subheadings for primitive types
this gives us HTML anchors for each of them
2022-07-28 17:23:57 +02:00
Eelco Dolstra
86fcd4f692
Merge pull request #6845 from fricklerhandwerk/attrset
manual: set -> attribute set
2022-07-28 16:55:03 +02:00
Valentin Gagarin
85cdaebcd6 manual: set -> attribute set
reword description to have shorter sentences.
2022-07-28 16:10:24 +02:00
Valentin Gagarin
be4654c344 manual: fix section title in table of contents 2022-07-28 15:55:41 +02:00
Alex Wied
228028fc1a docker.nix: Allow Nix configuration to be customized 2022-07-28 03:36:39 -04:00
Eelco Dolstra
360a1284db Fix onError 2022-07-27 16:41:26 +02:00
Eelco Dolstra
59a8e05754 Fix test 2022-07-27 14:41:32 +02:00
Eelco Dolstra
f780539406 Add abstract interface for writing files to an Input 2022-07-27 14:26:15 +02:00
Eelco Dolstra
bb4d35dcca Make 'nix edit' etc. work again 2022-07-26 17:06:45 +02:00
Eelco Dolstra
1790698a74 Rename fetch() -> fetchToStore(), lazyFetch() -> getAccessor() 2022-07-25 16:30:50 +02:00
Eelco Dolstra
7a64bb7f1c Rename Input::fetch() to fetchToStore() 2022-07-25 15:48:31 +02:00
Eelco Dolstra
a3427a1478 nix registry pin: Warn if the resolved flake is not locked 2022-07-25 15:48:16 +02:00
Eelco Dolstra
184c6605b0 nix flake pin: Use lazyFetch() 2022-07-25 15:44:45 +02:00
Eelco Dolstra
c0555c8e1f Remove Input::computeStorePath() 2022-07-25 15:35:53 +02:00
Eelco Dolstra
4f8f52ae58 Remove Tree datatype 2022-07-25 15:21:37 +02:00
Eelco Dolstra
e7faf65784 Remove FlakeRef::fetchTree() 2022-07-25 15:12:28 +02:00
Eelco Dolstra
022390af5a Merge remote-tracking branch 'origin/master' into lazy-trees 2022-07-22 15:27:40 +02:00
Eelco Dolstra
f97489e7ab Remove parent hackery from the path fetcher
Relative paths of subflakes are now handled in lockFlake().
2022-07-22 15:24:41 +02:00
Eelco Dolstra
3d27ce36d0 Restore the evaluation cache 2022-07-22 15:19:30 +02:00
Eelco Dolstra
c73a7584fb Fix path display 2022-07-22 15:11:15 +02:00
Théophane Hufschmitt
2805439335
Merge pull request #6814 from amjoseph-nixpkgs/pr/sandbox-error-messages
local-derivation-goal.cc: improve error messages when sandboxing fails
2022-07-22 13:27:52 +02:00
Théophane Hufschmitt
e10807cdbb
Merge pull request #6813 from centromere/cgroup-cpu-detection
libstore/globals.cc: Automatically set cores based on cgroup CPU limit
2022-07-22 10:15:32 +02:00
Eelco Dolstra
7edacb6248 Fix case 2022-07-21 16:06:22 +02:00
Alex Wied
722de8ddcc libstore/globals.cc: Move cgroup detection to libutil 2022-07-19 16:25:53 -04:00
Alex Wied
1af5d798a4 libstore/globals.cc: Automatically set cores based on cgroup CPU limit
By default, Nix sets the "cores" setting to the number of CPUs which are
physically present on the machine. If cgroups are used to limit the CPU
and memory consumption of a large Nix build, the OOM killer may be
invoked.

For example, consider a GitLab CI pipeline which builds a large software
package. The GitLab runner spawns a container whose CPU is limited to 4
cores and whose memory is limited to 16 GiB. If the underlying machine
has 64 cores, Nix will invoke the build with -j64. In many cases, that
level of parallelism will invoke the OOM killer and the build will
completely fail.

This change sets the default value of "cores" to be
ceil(cpu_quota / cpu_period), with a fallback to
std:🧵:hardware_concurrency() if cgroups v2 is not detected.
2022-07-19 16:03:58 -04:00
Adam Joseph
36e1383b6b local-derivation-goal.cc: save global errno to the stack before performing tests which might clobber it 2022-07-19 03:53:20 -07:00
Adam Joseph
a9e75eca00 error.hh: add additional constructor with explicit errno argument 2022-07-19 03:49:33 -07:00
Adam Joseph
99fcc91f67 as requested by @thufschmitt https://github.com/NixOS/nix/pull/6814#discussion_r924275777 2022-07-19 03:33:12 -07:00
Adam Joseph
5f51539f88 change warn() to notice() 2022-07-19 03:30:52 -07:00
Théophane Hufschmitt
fbd0a6c6e2
Merge pull request #6784 from tweag/completion-test
Add some tests for the CLI completion
2022-07-18 20:32:14 +02:00
Eelco Dolstra
2584c151bd
Merge pull request #6812 from lovesegfault/rosetta-paths
fix(libstore): allow Nix to access all Rosetta 2 paths on MacOS
2022-07-18 14:09:54 +02:00
Adam Joseph
c8c6203c2c local-derivation-goal.cc: detect unprivileged_userns_clone failure mode
The workaround for "Some distros patch Linux" mentioned in
local-derivation-goal.cc will not help in the `--option
sandbox-fallback false` case.  To provide the user more helpful
guidance on how to get the sandbox working, let's check to see if the
`/proc` node created by the aforementioned patch is present and
configured in a way that will cause us problems.  If so, give the user
a suggestion for how to troubleshoot the problem.
2022-07-17 01:27:22 -07:00
Adam Joseph
6fc56318bf local-derivation-goal.cc: add comment re: CLONE_NEWUSER
local-derivation-goal.cc contains a comment stating that "Some distros
patch Linux to not allow unprivileged user namespaces."  Let's give a
pointer to a common version of this patch for those who want more
details about this failure mode.
2022-07-17 01:23:32 -07:00