In future Summer of Nix editions, we would like to reduce the time spent on builds on participants’ machines to a minimum. Particularly, but not only because of the apparent success of the mob programming format in this program.
Yes, one way to achieve this would be some cloud build infrastructure, and suggestions in this direction are very welcome. And that may be the most effective and practical solution.
And yet what we are currently trying to come up with at the moment is a one-liner or a script that would — ideally use nix to — run some sort of build benchmark. For example, building some nixpkgs Linux kernel. For the purpose of specifying and validating minimum system requirements for participation in the program. Something like “your system must be able to build the Linux kernel in n minutes”.
And we’re totally failing at that. You can imagine how we might be failing. And I can imagine there are some flags we could be using to skip cache. But then I’m thinking there’s also a build-time dependency tree, which we wouldn’t mind being downloaded for the sake of this benchmark. We’re looking for a command that would do the same compute every time and have a way to exclude the time spent downloading. Anyway, I’m just babbling here. I know there are experts around who’d think of all these considerations and hopefully point us at the right direction.
1 Like
nix build github:nixos/nixpkgs?rev=ba429b3a64f02b7539cfb0caa70b1303356aeb54#hello && time nix build --rebuild github:nixos/nixpkgs?rev=ba429b3a64f02b7539cfb0caa70b1303356aeb54#hello
That seems to get us quite near our target. Is there a way to avoid the initial build?
The initial build is to get all the dependencies, so i suspect yo can not omit it if you just want to benchmark the final build.
That said, in the first build you may replace hello
with hello.inputDerivation
.
So, I ran
$ nix build 'github:nixos/nixpkgs?tag=23.05#linux.inputDerivation'
Which downloaded linux-6.1.55.tar.xz
which seems to be the source.
And then
$ nix build 'github:nixos/nixpkgs?tag=23.05#linux' --rebuild
And the latter seems to download linux-6.1.55
which also seems to be the source. Does this make sense?
1 Like
I don’t think it’s a good idea. It would make more sense buying a machine you would keep for all the next years and add it to the pool of community builders, when, SoN comes, you onboard everyone on that machine and let folks build on it, when it’s done, you can revoke or keep folks on that machine for the rest of the year if they continue doing contributions.
Other than that, I would find it sad to impose minimal system requirements on SoN participants, as long as they have somewhat of a machine, no matter what the architecture, and they can use an editor, it’s all good.
If they don’t have a fast enough Internet to use remote builders, they can build on the target directly and work on the target directly, home-manager being a thing.
3 Likes
I just checked: the second download is not the source but the binary blob from the cache. If you pass --offline
it immediately starts to build. The --rebuild
flag forces a build, even if the the build result is present in the local store.
1 Like
Perfect. Thank you. This seems to provide us with what we need.