-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lazy trees #6530
base: master
Are you sure you want to change the base?
Lazy trees #6530
Changes from 1 commit
37d859b
a115c4f
91aea15
13c0db4
def7b25
034340a
f95c425
30be644
7da3a30
301f388
440214f
89f1021
120bec5
8a43eaa
7c1bdff
c0dd35a
2d5cfca
3667cf5
b293b33
48a5879
1b8065f
85c1959
432a3a1
2a1c63c
28b62dd
a291e37
c3c0682
cbade16
241dd54
5c8d67d
0286edb
1483c56
7317196
5115909
12dd8d4
e2353b9
0402dd0
1683872
e424a8b
a653e98
f02da62
b275aa4
8342317
4072024
64a69b4
561440b
b27cd88
515b908
39a783f
116acc1
fcdca3d
730f6bf
57397a3
d162222
6d104bb
f620184
d950e3a
12c554a
a322306
d8620d7
8becbb0
3bcaa7d
210cd8c
81a4516
880a72b
15d2e0e
b48e641
5e3cd3e
29dff7e
20a0a74
fa5af1e
9286b1a
9512afa
3621d07
3522978
f4f0f8a
37b4a9e
31bb875
aaf8b1b
b14830b
5c29abc
4142982
ca26ce9
219510b
7b1cda9
00b746d
bb421ac
12f1413
02d5c54
26ff9c1
f4009fd
ece20d5
5d1e5a0
c8f7ca2
273df09
21f0a98
03618bb
56a845d
98a90cc
430bfcf
13e8d70
23806db
ab2b0fb
8c8f242
579ecd3
1b0b3b1
834d878
1017b11
86ca2c5
e952d36
d6cdb07
334348f
733861d
3a1a33d
b19534a
854a311
b8218b5
f21e1cf
aa823c2
d7d49fd
bb72d1b
6192fd0
4f1b0d7
cdb946e
7052e19
2f1a90b
0671807
b2a205e
ccd2ad2
2a4462e
f432967
f23b969
2ffa909
4b9215c
9a15ec8
870e750
64b9e50
2154084
a0b0cac
a1501cf
8ee59d7
791e222
5b2be3a
0dfc214
91aefbd
d102273
39079dd
2b9ded5
a9d4780
2dc2f58
ac73702
3c4d678
e59caad
2f18e78
f355c34
56272db
3494c29
4e16d5e
6b70509
eaa785e
ea5c2e3
b219d76
0e48afb
0b72b31
6513f69
94c028f
e350f84
fa8618f
144987e
6a95ff9
b4df104
601de7f
c677ea7
aa85359
ddca787
ec272de
b39148e
3099b51
0aa13b6
be1543e
653c100
575902b
d38f4d9
dab2be3
2055e28
c0b1df7
748567b
5558d65
d022bce
7eb3ba0
d9cfae2
43de535
0d02a63
d2292a1
edcd6ce
793a838
1c56bdd
49f9099
ce23764
3369a81
3f70f20
1abf058
147593d
c6b4f01
cf02c6a
4a9b7c8
0efcbbf
c4cd4cd
93cf285
2fec506
5ddd8e4
1302bfa
9c10fcf
71575a2
333d35a
0950094
2101916
fc4d948
db6c219
a65c8a9
c5ae41d
ea54be0
a435a40
7332321
299d0b7
3a96ba0
25635e5
b5be3b0
2409e6b
44d20c3
4133514
2cb003c
8fc36e2
bcb1be4
f0cf5d8
a123f87
26f1431
b7255f8
584fece
4d39908
e255be6
a33aad3
35bbd85
b6be10d
57e1692
57b2cc2
1b20945
53fabdc
34e4a61
0d3a157
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,48 @@ | |
a context just because they are read from a store path | ||
([#7260](https://github.com/NixOS/nix/pull/7260)). | ||
|
||
* Nix can now automatically pick UIDs for builds, removing the need to | ||
create `nixbld*` user accounts. These UIDs are allocated starting at | ||
872415232 (0x34000000) on Linux and 56930 on macOS. | ||
|
||
This is an experimental feature. To enable it, add the following to | ||
`nix.conf`: | ||
|
||
``` | ||
extra-experimental-features = auto-allocate-uids | ||
auto-allocate-uids = true | ||
``` | ||
|
||
* On Linux, Nix can now run builds in a user namespace where the build | ||
runs as root (UID 0) and has 65,536 UIDs available. This is | ||
primarily useful for running containers such as `systemd-nspawn` | ||
inside a Nix build. For an example, see | ||
https://github.com/NixOS/nix/blob/67bcb99700a0da1395fa063d7c6586740b304598/tests/systemd-nspawn.nix. | ||
|
||
A build can enable this by requiring the `uid-range` system feature, | ||
i.e. by setting the derivation attribute | ||
|
||
``` | ||
requiredSystemFeatures = [ "uid-range" ]; | ||
``` | ||
|
||
The `uid-range` system feature requires the `auto-allocate-uids` | ||
setting to be enabled (see above). | ||
|
||
* On Linux, Nix has experimental support for running builds inside a | ||
cgroup. It can be enabled by adding | ||
|
||
``` | ||
extra-experimental-features = cgroups | ||
use-cgroups = true | ||
``` | ||
|
||
to `nix.conf`. Cgroups are required for derivations that require the | ||
`uid-range` system feature. | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Relatedly,
But this does make sense, because the lazy path root essentially acts like a filesystem root, and the directory of a filesystem root is the root itself, which Nix also does with
So I don't think this needs any fixes, but it would be good to write a note about this in the docs. |
||
* `nix build --json` now prints some statistics about top-level | ||
derivations, such as CPU statistics when cgroups are enabled. | ||
|
||
* You can now use flake references in the old CLI, e.g. | ||
|
||
``` | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2482,9 +2482,9 @@ void EvalState::printStats() | |
obj["name"] = nullptr; | ||
if (auto pos = positions[fun->pos]) { | ||
if (auto path = std::get_if<SourcePath>(&pos.origin)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it would be nice to cover the other variants (or at least stdin and string) in some way here too -- maybe even add some further metadata to allow distinguishing |
||
obj.attr("file", path->to_string()); | ||
obj.attr("line", pos.line); | ||
obj.attr("column", pos.column); | ||
obj["file"] = path->to_string(); | ||
obj["line"] = pos.line; | ||
obj["column"] = pos.column; | ||
} | ||
obj["count"] = count; | ||
list.push_back(obj); | ||
|
@@ -2497,9 +2497,9 @@ void EvalState::printStats() | |
json obj = json::object(); | ||
if (auto pos = positions[i.first]) { | ||
if (auto path = std::get_if<SourcePath>(&pos.origin)) | ||
obj.attr("file", path->to_string()); | ||
obj.attr("line", pos.line); | ||
obj.attr("column", pos.column); | ||
obj["file"] = path->to_string(); | ||
obj["line"] = pos.line; | ||
obj["column"] = pos.column; | ||
} | ||
obj["count"] = i.second; | ||
list.push_back(obj); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another problem I just discovered:
baseNameOf
return the virtual path string for lazy path roots:It should really throw an error, it doesn't make sense to get the base name of a lazy path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is again similar to the basename of the filesystem root.
It would be more consistent for
baseNameOf lazy
to return""
, but I'm not sure which is better.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just found a piece of code that would use
baseNameOf
on flake paths and whose behavior would change silently with this PR. While there's problems with that piece of code (inspecting store paths isn't great), and this was pointed out, it still shows how easy it is for this PR to break code in unintentional ways. I still thinkbaseNameOf
should give an error or as suggested by @roberth at least be consistent withbaseNameOf /. == ""
. This also relates to my thinking that lazy paths shouldn't betoString
'able at all: #6530 (comment)