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

openmoji has started taking forever to build. #167869

Closed
kevincox opened this issue Apr 8, 2022 · 15 comments · Fixed by #174795
Closed

openmoji has started taking forever to build. #167869

kevincox opened this issue Apr 8, 2022 · 15 comments · Fixed by #174795
Labels
0.kind: bug Something is broken

Comments

@kevincox
Copy link
Contributor

kevincox commented Apr 8, 2022

Describe the bug

openmoji-color and openmoji-black now both take >12h to build. They are timing out on hydra https://hydra.nixos.org/job/nixos/trunk-combined/nixpkgs.openmoji-color.x86_64-linux.

Steps To Reproduce

Steps to reproduce the behavior:

  1. nix-build -A openmoji-color

Notify maintainers

@fgaz

@kevincox kevincox added the 0.kind: bug Something is broken label Apr 8, 2022
@fgaz
Copy link
Member

fgaz commented Apr 8, 2022

Could this be the same as #97871? Should we switch to prebuilt fonts here too?

@kevincox
Copy link
Contributor Author

kevincox commented Apr 8, 2022

It could be. But in the past the build only took a minute or 2. Now it takes basically forever. I'm trying to bisect when this was introduced but bisecting timeouts is slow and error-prone.

@kevincox

This comment was marked as outdated.

@kevincox
Copy link
Contributor Author

kevincox commented Apr 9, 2022

I did a better bisection and got 69da642 (#163439) which is much more helpful. I saw that PR but thought it seemed too old. I guess I forgot how long a staging cycle can take.

cc @evils @jtojnar @erictapen

I don't know what the best approach here is. Report the bug upstream to fontforge or openmoji? There are a lot of warnings and errors in the build so I suspect that it may be an openmoji problem and fontforge was doing its best before and working but now is failing?

The command I used for reference was:

git bisect run zsh -c 'set -x; nix build -f . openmoji-color --max-silent-time 600 |& tee /tmp/out; [[ $pipestatus[1] == 0 ]] && exit 0; grep -- "-openmoji-.*timed out after .* seconds of silence" /tmp/out && exit 1; exit 125'

@evils
Copy link
Member

evils commented Apr 9, 2022

after a brief look at this
fontforge has a reported regression in its ability to remove overlaps (fontforge/fontforge#4859)
but if openmoji is the only font that is failing because of that, maybe they're relying too much on fontforge's abliity to fix things at build time

(with the latest master commits from openmoji and fontforge, the openmoji build also hangs)

@kevincox
Copy link
Contributor Author

I tried diffing the logs but they are basically completely different once scfbuild starts. In case they are helpful to anyone here are the builds before and after that commit. (The after obviously cuts off after the "infinite loop").

before.log
after.log

@fgaz
Copy link
Member

fgaz commented Apr 14, 2022

Great investigation!

Maybe as a short-term fix we could override fontforge for this package?

@kevincox
Copy link
Contributor Author

That sounds like a reasonable mitigation until a patch is available.

@Artturin Artturin mentioned this issue Apr 24, 2022
13 tasks
@OPNA2608
Copy link
Contributor

Bump, would really love to have openmoji available when I upgrade 21.11 -> 22.05!

@fgaz
Copy link
Member

fgaz commented May 26, 2022

@kevincox why the thumbs down?

@kevincox
Copy link
Contributor Author

Bumping issues is not a helpful thing to do.

@fgaz
Copy link
Member

fgaz commented May 26, 2022

In general yes, though in this case it reminded me to fix this before 22.05 :)

Here you go @OPNA2608: #174795

fgaz added a commit to fgaz/nixpkgs that referenced this issue May 26, 2022
@jtojnar
Copy link
Member

jtojnar commented May 27, 2022

I tried running bisection on fontforge itself using nix-bisect after applying the patch below:

$ git bisect start 20220308 20201107
$ extra-bisect run \
  nix-build-status \
    --option max-silent-time 240 \
    -f ~/Projects/nixpkgs \
    openmoji-color

Unfortunately, the automatic bisection did not work for some reason. Possibly because the timeout regex does not match the error message: error: building of '/nix/store/6z3q2pb6frq47ch617nayaambb7rsyxa-openmoji-13.1.0.drv!out' from .drv file timed out after 240 seconds of silence

--- a/pkgs/data/fonts/openmoji/default.nix
+++ b/pkgs/data/fonts/openmoji/default.nix
@@ -3,6 +3,10 @@
 , fetchFromGitHub
 , scfbuild
 , nodejs
+, fontforge
+, libuninameslist
+, fetchpatch
+, patch
 , nodePackages
 , python3Packages
 , variant ? "color" # "color" or "black"
@@ -14,6 +18,30 @@ let
     [ "OpenMoji-Color.ttf" "OpenMoji-Black.ttf" ]
     variant;
 
+    fontforge-bisect = fontforge.overrideAttrs (old: rec {
+      version = "bisect";
+      src = /home/jtojnar/Projects/fontforge;
+      patches = [
+        (fetchpatch {
+          url = "https://salsa.debian.org/fonts-team/fontforge/raw/76bffe6ccf8ab20a0c81476a80a87ad245e2fd1c/debian/patches/0001-add-extra-cmake-install-rules.patch";
+          sha256 = "u3D9od2xLECNEHhZ+8dkuv9818tPkdP6y/Tvd9CADJg=";
+        })
+        # (fetchpatch {
+        #   url = "https://github.com/fontforge/fontforge/commit/69e263b2aff29ad22f97f13935cfa97a1eabf207";
+        #   sha256 = "06yyf90605aq6ppfiz83mqkdmnaq5418axp9jgsjyjq78b00xb29";
+        # })
+      ];
+      prePatch = ''
+        patch() {
+          ${patch}/bin/patch "$@"  || echo 'Failed to apply patch, continuing'
+        }
+      '';
+      buildInputs = old.buildInputs ++ [ libuninameslist ];
+    });
+    scfbuild-with-fontforge-bisect = scfbuild.override (old: {
+      fontforge = fontforge-bisect;
+    });
+
 in stdenv.mkDerivation rec {
   pname = "openmoji";
   version = "13.1.0";
@@ -26,7 +54,7 @@ in stdenv.mkDerivation rec {
   };
 
   nativeBuildInputs = [
-    scfbuild
+    scfbuild-with-fontforge-bisect
     nodejs
     nodePackages.glob
     nodePackages.lodash

github-actions bot pushed a commit that referenced this issue May 28, 2022
...by downgrading fontforge.

Fixes #167869

(cherry picked from commit 6ee6794)
@Artturin
Copy link
Member

needs to be reported upstream

@fgaz
Copy link
Member

fgaz commented May 29, 2022

Which one though? Openmoji or fontforge?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants