getsolus / solbuild

The Solus package build system
https://getsol.us
Apache License 2.0
19 stars 12 forks source link

Cargo build takes significantly longer time in solbuild #87

Closed malfisya closed 5 months ago

malfisya commented 5 months ago

When I try to build gnome rust-based apps (snapshot, glycin, loupe) with solbuild, it takes significantly longer time compared without solbuild. There is this long pause (10 min or more) between each steps.

Steps to reproduce:

  1. Using recipe in monorepo, build glycin inside solbuild.
  2. Time it and observe pause between each steps.
  3. Then build glycin without solbuild.
  4. Time it and observe pause between each steps.
  5. Buildingglycin with solbuild takes longer than without it.
GZGavinZhao commented 5 months ago

Try putting unset LD_PRELOAD in the environment section?

ermo commented 5 months ago

Just a note that I can reproduce this, even when using the unset LD_PRELOAD statement in an added environment: | section.

solbuild-cargo-zombie-when-building-glycin1

Solbuild appears to be just waiting for ... something and htop shows no activity for the solbuild process tree and shows cargo as a zombie.

After a few minutes, the build becomes active again. This keeps happening until the build is done it seems. Not a very good UX/DX.

silkeh commented 5 months ago

This seems to be caused by this ninja issue. It is triggered in these packages because cargo spawns an sccache daemon, and ninja waits for it.

It can't easily be fixed in solbuild, but there is a simple workaround:

build      : |
    # Work around for https://github.com/ninja-build/ninja/issues/2052
    sccache --start-server

    %ninja_build
malfisya commented 5 months ago

Maybe add the workaround here https://github.com/getsolus/help-center-docs/issues/411