compass-rs/sass-rs

Starts dozens (sometimes hundreds) of build processes

Closed this issue · 8 comments

When building sass-sys, a huge number of cc1plus processes are started, to the point that my entire computer starts to lag and every CPU gets pinned at 100%. The number doesn't change even if I specify MAKE_LIBSASS_JOBS.

The title says "sometimes" because the number of jobs changes over time, possibly as make starts compiling new files/finishes with old ones, and I couldn't get a consistent number. It was always in the same range, though.

At least ctrl+C works fairly quickly to kill the entire bundle.

Platform: WSL (Ubuntu); rustc 1.36.0

Keats commented

That's weird, can you try to run the commands from sass-sys build.rs manually to see what happens?

@Keats Finally actually got around to doing what I said I'd do... Sorry it took so long. I kept distracting myself.

Running make --jobs 8 does indeed do the same thing as running build.rs, strangely enough. Maybe a bug in the WSL make, ignoring --jobs? Doesn't seem to be a bug in this, though, unlike I originally thought.

I think https://github.com/sass/libsass/blob/4d229af5500be1023883c38c4a675f0ed919839d/Makefile#L22 is responsible, and is overriding the --jobs argument in some cases...

I can reproduce this phonemenon with regular make on Ubuntu 18.04:

/src/test/make-test# make --jobs 1
sleep infinity
sleep infinity
sleep infinity
sleep infinity
sleep infinity
sleep infinity
sleep infinity
sleep infinity
sleep infinity
sleep infinity
sleep infinity

with a Makefile of:

MAKEFLAGS += "-j 0"

all: a b c d e f g h i j k

a b c d e f g h i j k:
        sleep infinity
sass-rs = "0.2"
sass-sys = "=0.4.8"

is sufficient to avoid this.

That's reverted in sass/libsass#2977, so the next step is an updated version of sass-sys.

Keats commented

Good find! I've asked if they can cut a release and I'll update asap

Wow, I... genuinely didn't expect this to move so fast. Is there any ETA, or will it just happen whenever the libsass folks cut their next release?

Keats commented

They just released a new version, can anyone try #57 to see if it fixes it?