Skip to content
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

compile cosmic-applets individually? #34

Open
MrMonotone opened this issue Mar 19, 2024 · 7 comments
Open

compile cosmic-applets individually? #34

MrMonotone opened this issue Mar 19, 2024 · 7 comments

Comments

@MrMonotone
Copy link

Would it be possible to have each applet build as it own job to lower the ram requirements when compiling locally? This would make it convenient to add flags for the ones that you want as well.

@lilyinstarlight
Copy link
Owner

Yeah this could probably technically be done! Just curious, are you building the applets yourself because you aren't using the binary cache? (e.g. all binaries here should be cached for x86_64-linux and aarch64-linux on cosmic.cachix.org and once this is merged back into nixpkgs, cache.nixos.org)

@MrMonotone
Copy link
Author

The cache works great. I just tried to build without it and I ran out of ram with 32GB of it. I tried limiting the jobs to 1 and still ran out. It is not a priority but it would be nice for someone who wants to build locally.

@lilyinstarlight
Copy link
Owner

lilyinstarlight commented Mar 19, 2024

The cache works great. I just tried to build without it and I ran out of ram with 32GB of it. I tried limiting the jobs to 1 and still ran out. It is not a priority but it would be nice for someone who wants to build locally.

Limiting jobs likely won't help alone, but also using --cores 1 or some similar number to reduce build parallelism probably will help

But either way, making the derivation take a list argument or something to define which applets to build is probably doable

@MrMonotone
Copy link
Author

MrMonotone commented Mar 19, 2024

But either way, making the derivation take a list argument or something to define which applets to build is probably doable

Would it be possible to build each as an individual job?

@lilyinstarlight
Copy link
Owner

Possibly? Idk, it would be a lot more wasted compiling (especially compared to --cores 1). But I'm not too opposed

@atagen
Copy link
Contributor

atagen commented Apr 12, 2024

had same issue testing #64 . I'm for whatever helps the cache work best since 99% of the time that's what I'll be using too, but it was an unpleasant surprise to OOM while testing a one line nix-side change 😄

@lilyinstarlight
Copy link
Owner

lilyinstarlight commented Apr 12, 2024

had same issue testing #64 . I'm for whatever helps the cache work best since 99% of the time that's what I'll be using too, but it was an unpleasant surprise to OOM while testing a one line nix-side change 😄

I'm still not too opposed to doing this. It's just a tradeoff between wasting shared compilation units by splitting it up versus just setting a parallelism amount (--cores [n]) that won't OOM for however much RAM you do have on your system (which is just a general Nix thing not necessarily specific to Rust or COSMIC, e.g. highly templated C++ apps do it too which is why they actually have a separate set of systems in Hydra with tons of RAM to build some derivations with "big-parallel" set)

Alternatively we could just disable parallel compilation just for cosmic-applets too in the derivation, which would solve the OOM problem and just be a little slower for people who do have enough RAM (but tbh not much slower, so it's definitely viable)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants