-
Notifications
You must be signed in to change notification settings - Fork 6
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
Save 1MB by not using charmbracelet/log #119
Conversation
Adding nixos-facter tipped us over the edge for 1GB RAM in nixos-anywhere. Another upside is that less dependencies means less updates.
Now we are at half the binary size that we started with. |
I hope you started by trying to rip things out of To be fair we didn't really need the log and flag features, they're my go to when starting out. What kinda max binary size do we have to work with if we aren't gonna blow nixos-anywhere's budget in the future? |
Oh yeah, we did optimize hard: https://github.com/nix-community/nixos-images/blob/8650b1df8f965bf33dec79351646e19406ff9d50/nix/noninteractive.nix#L17 Ideally we could get rid of perl... but there is still nixos-generate-config.
It's only after I added nixos-facter, when nixos tests starting to go out-of-memory. It might have just put it over the edge. I have to see when we get back into the safe zone. |
These changes take the binary from I'm mindful of #117, which I'll look at in the next day or two and consider what changes it might require. Is there an easy way to test if I've blown the |
Just re-read this and realised you're still unsure about what the budget might be. I'll let you keep working through it. |
I just gave us more breathing space by overriding python with python minimal in various filesystem tools. I would say libraries that add hardware detection should be fine. In the case of lsusb, I briefly studied the code, and I think it would be hard to find a library that handles all the edge cases that it handles. So I would instead suggesting parsing the output of lsusb -v. But in any case having a small binary will make it an easier sell later when we want to replace nixos-generate-config in NixOS as well. |
This now is an easier to read
|
This is now nicer than what we had before.
Good to know. I'm going to give this some focused attention today or tomorrow. |
Adding nixos-facter tipped us over the edge for 1GB RAM in nixos-anywhere. Another upside is that less dependencies means less updates.