Nix Hackers | 994 Members | |
| For people hacking on the Nix package manager itself | 210 Servers |
| Sender | Message | Time |
|---|---|---|
| 20 Sep 2021 | ||
| (I mean any C++ code we wrote, not the security almost-term "arbitrary code") | 12:26:39 | |
Does Nix even use more than that single coroutine in serialise.cc, which does not have a nested yield? In any case, afaiui you cannot have directly yield from inside a nested call with these coroutines, but you can yield to the surrounding coroutine, which then yields to the caller/next coroutine, etc. | 12:34:20 | |
It's like Python before yield from | 12:34:31 | |
* Does Nix even use more than that single coroutine in serialise.cc, which does not have a nested yield? In any case, afaiui you cannot directly yield from inside a nested call with these coroutines, but you can yield to the surrounding coroutine, which then yields to the caller/next coroutine, etc. | 12:35:06 | |
| There is absolutely no stack pointer manipulation with this approach | 12:35:38 | |
| 15:22:23 | ||
| 15:24:44 | ||
| Kha: I'm going to trust you on that | 15:29:53 | |
| A possible issue is that these coroutines are "viral" in the sense that any stack frame between coroutine start and yield must become part of the coroutine. Some of these are virtual method invocations and some might be calls into libraries we don't control (not sure) | 15:31:42 | |
| So those are possible challenges. I would really like for this to work and I suspect that C++20 may be a nicer requirement than boost_context, although I'm blissfully unaware of C++20 maturity | 15:33:08 | |
| You could give it a try | 15:34:26 | |
| It does sound fun. But to be honest, if that one tiny function really remains the only use of coroutines since it was introduced 3 years ago, I feel like the only reasonable approach is to replace it with a hand-written state machine :) . I might try that one first. | 15:46:05 | |
That includes such a code transformation on the nar parser and the Store interface for adding directories to the store with an arbitrary filter function, among potentially other things | 16:47:28 | |
| an async or state machine style nar parser will improve memory consumption in one case iirc, so that alone may be worth it | 16:48:16 | |
|
Does nix have a knob (or could it be tweaked?) to start first required build sooner to get final result faster? It's a bit odd to see 3 hours if prerequisite download and 2 hours of actual build time. Example current state: [0/2091 built, 16/898/1354 copied (9886.6/14818.7 MiB), 4775.8/6830.3 MiB DL] fetching source from https://cache.nixos.org | 17:50:31 | |
| 21 Sep 2021 | ||
| 14:49:28 | ||
I'm probably missing something obvious, but I can't use recursive nix even with recursive-nix in my experimental-features in /etc/nix/nix.conf. It only works if I use single-user mode by specifying a store with --store. | 19:14:22 | |
Nevermind, I can't get it to work at all. I get /nix/var: Permission denied when running nix build. | 19:32:26 | |
I fixed my issue: It has to be in system-features too... | 20:05:48 | |
| 22 Sep 2021 | ||
In reply to @trofi:matrix.orgAFAIR this is because substitution and building uses a common work queue constrained by max-jobs. If they used independent (and ideally differently-sized) pools, building might be able to start sooner. | 09:19:56 | |
In reply to @trofi:matrix.org* AFAIR this is because substitution and building use a common work queue constrained by max-jobs. If they used independent (and ideally differently-sized) pools, building might be able to start sooner. | 09:20:06 | |
| 23 Sep 2021 | ||
| 14:51:43 | ||
| 24 Sep 2021 | ||
| 01:01:26 | ||
| 04:58:06 | ||
| 25 Sep 2021 | ||
Robert Hensing (roberth): Ah, now I get it. The single place where coroutines are used in Nix is in decompression via libarchive, to convert between the non-blocking Sink "push" model used everywhere else and the Source "pull" model because libarchive does not have a non-blocking API. Yikes. | 09:20:32 | |
| we do have some internal use as well, but this kind of forces us to use stackful coroutines | 09:24:51 | |
| threads could be an alternative. On disk buffering probably not desirable | 09:26:57 | |
Ah right, I missed that the other direction, sinkToSource, uses it as well. Which is used, err, everyhwere. | 09:29:27 | |
* Ah right, I missed that the other direction, sinkToSource, uses coroutines as well. Which is used, err, everyhwere. | 09:29:36 | |
| mostly because nar parsing is pull based I believe | 09:31:18 | |