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

Build Process Gets Stuck at 557 Pending Tasks #2584

Open
kryzet opened this issue Nov 11, 2024 · 17 comments
Open

Build Process Gets Stuck at 557 Pending Tasks #2584

kryzet opened this issue Nov 11, 2024 · 17 comments
Labels

Comments

@kryzet
Copy link

kryzet commented Nov 11, 2024

The build process gets stuck at 557 pending build tasks and keeps using the CPU and memory without any reported progress.
image


  • Font version: 9df636450d986d17c3dc3328bd4aa342214d45bf
  • Font variant: Iosevka with private-build-plans.toml
  • Operating system: Windows 11 x64 23H2
  • Node.js version: 23.1.0
  • private-build-plans.toml:
    [buildPlans.KryzetSIosevka]
    family = "Kryzet's Iosevka"
    spacing = "normal"
    serifs = "slab"
    noCvSs = false
    exportGlyphNames = true
    
      [buildPlans.KryzetSIosevka.ligations]
      inherits = "dlig"
    
    [buildPlans.KryzetSIosevka.widths.Condensed]
    shape = 500
    menu = 3
    css = "condensed"
    
    [buildPlans.KryzetSIosevka.widths.Normal]
    shape = 600
    menu = 5
    css = "normal"
    
    [buildPlans.KryzetSIosevka.widths.UltraCondensed]
    shape = 416
    menu = 1
    css = "ultra-condensed"
    
    [buildPlans.KryzetSIosevka.widths.ExtraCondensed]
    shape = 456
    menu = 2
    css = "extra-condensed"
    
    [buildPlans.KryzetSIosevka.widths.SemiCondensed]
    shape = 548
    menu = 4
    css = "semi-condensed"
    
    [buildPlans.KryzetSIosevka.widths.SemiExtended]
    shape = 658
    menu = 6
    css = "semi-expanded"
    
    [buildPlans.KryzetSIosevka.widths.Extended]
    shape = 720
    menu = 7
    css = "expanded"
  • The detailed error log:
    Where do I get that?
    
@kryzet
Copy link
Author

kryzet commented Nov 11, 2024

I left the build process for a bit and it went down a bit more, but for some reason when it hits 557 pending tasks, progress becomes really slow.
image

@kryzet
Copy link
Author

kryzet commented Nov 11, 2024

Might be related to #551.

@be5invis
Copy link
Owner

What's your hardware spec? Building Iosevka, especially without a cache, is... slow, due to its complexity.
Setting noCvSs to true could save a lot of time.

@kryzet
Copy link
Author

kryzet commented Nov 12, 2024

What's your hardware spec?

Here are the hardware specs:

Component Details
CPU 12th Gen Intel(R) Core(TM) i5-12450HX, 2400 Mhz, 8 Core(s), 12 Logical Processor(s)
GPU NVIDIA GeForce RTX 3050 6GB Laptop GPU
Installed Physical Memory (RAM) 16.0 GB

Building Iosevka, especially without a cache, is... slow, due to its complexity.

How can I get that?

Setting noCvSs to true could save a lot of time.

I would like to build this font only once and never have to build it again. Building sure is a painful process, and I don't want to run the risk of not having OpenType in the font files and then realize that some random software needs it or it won't do its job properly :)

@be5invis
Copy link
Owner

How can I get that?

Once you have a successful build then you will have a cache.

@kryzet
Copy link
Author

kryzet commented Nov 12, 2024

How can I get that?

Once you have a successful build then you will have a cache.

I already have one. Decided to go with many less widths (specifically 500 (condensed) and 600 (normal) and the build process actually finished within 1 hour and 40-50 minutes.

@kryzet
Copy link
Author

kryzet commented Nov 12, 2024

Building Iosevka, especially without a cache, is... slow, due to its complexity.

Why are you still using JavaScript? 😃
At least use Deno or Bun. Even better, start using Go, especially because you're doing the build process multi-threaded 👌

@be5invis
Copy link
Owner

It may take too long to rewrite everything... The current builder is already multithreaded though.
We could probably do something to optimize geometry ops (which takes the longest time), especially for the boolean operations -- if we do that to migrate to native code, then I will do it in Rust directly...

@kryzet
Copy link
Author

kryzet commented Nov 13, 2024

It may take too long to rewrite everything...

I can imagine... I mean, hey, it's just a suggestion 😉

The current builder is already multithreaded though.

... especially because you're doing the build process multi-threaded...

I know, but then Go would handle that much better, without the transition between the two languages being too jarring.

We could probably do something to optimize geometry ops (which takes the longest time), especially for the boolean operations -- if we do that to migrate to native code, then I will do it in Rust directly...

Yes! Rust for the win 🚀

@kryzet
Copy link
Author

kryzet commented Nov 13, 2024

How can I get that?

Once you have a successful build then you will have a cache.

How can I use my existing build as cache?

@be5invis
Copy link
Owner

Once you have a successful build, the cache will be there, and is applied automatically. Invalidation of cache will happen when version number changes or some significant change are made to the geometry cache system.

@polemon
Copy link

polemon commented Dec 15, 2024

I'm experiencing the same problem, even when running through bun. The process (and I'm building standard ttf::Iosevka) will get stuck at 72% and RAM will slowly fill up and eventually I have to stop it, otherwise it'll lock up. No amount of swap space seem to help.
Is there perhaps some way, I can build just one of the output files?

@jmcwilliams403
Copy link
Contributor

jmcwilliams403 commented Dec 16, 2024

try running with the argument --jCmd=2 (default argument is --jCmd=4)

@kryzet
Copy link
Author

kryzet commented Dec 17, 2024

I don't think the default is 4. When I ran the build Node started 12 threads (number of threads available from my CPU).

@be5invis
Copy link
Owner

try running with the argument --jCmd=2 (default argument is --jCmd=4)

Default argument is how many CPUs you have. On my machine it is 64. I recently added some change to reduce memory use (basically changing how the geometry cache is stored). Using the latest version could somehow help.

@akarzim
Copy link
Contributor

akarzim commented Dec 19, 2024

For those running GNU/Linux, it's possible to ask our programs to be nice 😊

nice -n 1 npm run build -- ttf::IosevkaCustom

nice

Execute a program with a custom scheduling priority (niceness).
Niceness values range from -20 (the highest priority) to 19 (the lowest).

More information: https://www.gnu.org/software/coreutils/nice

Furthermore, it's possible to improve swap memory performance with zram!

zram, formerly called compcache, is a Linux kernel module for creating a compressed block device in RAM, i.e. a RAM disk with on-the-fly disk compression.

Cf. https://www.kernel.org/doc/html/latest/admin-guide/blockdev/zram.html

These two tips were very useful to me! No more freezing!

@kryzet
Copy link
Author

kryzet commented Dec 19, 2024

I wonder if there are equivalents of nice and ZRAM on Windows...

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

No branches or pull requests

5 participants