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
Building ISO takes excessive amounts of time+memory #57984
Comments
This occurs here too. ulimit seems ineffective in preventing the freeze, but SysRq+F (may need SysRq+R too) is useful to invoke the OOM-killer manually. I tested it against nixos-19.03, so it's not particular to nixos-unstable. |
Can you try out 18.09 to see if this has been introduced recently? |
|
So I just tried this on an EC2 m5a.24xlarge instance to see if it would actually complete. It maxed out all 371GB of memory and only used a single core. After about ~30 minutes it finally crashed from a stack overflow. I should also note that the issue does not occur if the overlay line is removed from the configuration. |
Ah ok! It's probably an issue in pkgsi686Linux. |
This can be resolved with this simple patch:
but I'd like to hear also @oxij's opinion, as he was last to touch this code. |
…lays Consider example: $ nix-instantiate ./nixos -A system --arg configuration ' { boot.isContainer = true; nixpkgs.overlays = [ (self: super: { nix = self.pkgsStatic.nix; }) ]; }' When resolving package through overlays, we figure out that nix == self.pkgsStatic.nix => nix == (import <nixpkgs> { inherit overlays; }).nix => nix == (import <nixpkgs> { overlays = [(self: super: { nix = self.pkgsStatic.nix; })];}).nix and we enter infinite recursion of nixpkgs evaluations. The proper fix should terminate recursion by assigning self fixpoint to inner custom package set. But I get infinite recursion somehow, so I use `super`. It is less correct modulo deep custom overrides, but behaves correctly for simple cases and doesn't OOM evaluator. Fixes NixOS#57984
…lays Consider example: $ nix-instantiate ./nixos -A system --arg configuration ' { boot.isContainer = true; nixpkgs.overlays = [ (self: super: { nix = self.pkgsStatic.nix; }) ]; }' When resolving package through overlays, we figure out that nix == self.pkgsStatic.nix => nix == (import <nixpkgs> { inherit overlays; }).nix => nix == (import <nixpkgs> { overlays = [(self: super: { nix = self.pkgsStatic.nix; })];}).nix and we enter infinite recursion of nixpkgs evaluations. The proper fix should terminate recursion by assigning self fixpoint to inner custom package set. But I get infinite recursion somehow, so I use `super`. It is less correct modulo deep custom overrides, but behaves correctly for simple cases and doesn't OOM evaluator. Fixes #57984
Hey @Slabity! The issue is fixed in nixpkgs master and 19.03, but if you need it on 18.09, there is workaround:
|
Issue description
When trying to build an ISO image, my system memory (~12GB) and swap space (~16GB) gets completely filled. The build seems to freeze on the following:
evaluating file '/nix/store/*/nixos/lib/systems/platform.nix'
Steps to reproduce
Using the following system configuration (file named iso.nix):
Then run the following:
Technical details
"x86_64-linux"
Linux 5.0.2, NixOS, 19.09pre173080.1222e289b50 (Loris)
yes
yes
nix-env (Nix) 2.2
Appears to affect 19.03 channel as well.
The text was updated successfully, but these errors were encountered: