msdf-bmfont-xml: Linux bin execution error

When calling your package from a JS script, I get the following error on linux (Ubuntu 16.04.6):

Error: Command failed: /mnt/c/Users/ext_valencia.and/Dev/harp-font-resources/node_modules/msdf-bmfont-xml/bin/linux/msdfgen.linux msdf -format text -stdout -size 11 16 -translate 2 26 -pxrange 8 -defineshape "{2.4, -13.664; 1.92, -22.048; 5.088, -22.048; 4.608, -13.664; 2.4, -13.664; }"
/mnt/c/Users/ext_valencia.and/Dev/harp-font-resources/node_modules/msdf-bmfont-xml/bin/linux/msdfgen.linux: 9: /mnt/c/Users/ext_valencia.and/Dev/harp-font-resources/node_modules/msdf-bmfont-xml/bin/linux/msdfgen.linux: Syntax error: ")" unexpected

(node:61) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'slice' of undefined
    at MaxRectsPacker.sort (/mnt/c/Users/ext_valencia.and/Dev/harp-font-resources/node_modules/maxrects-packer/src/maxrects_packer.ts:125:22)
    at MaxRectsPacker.addArray (/mnt/c/Users/ext_valencia.and/Dev/harp-font-resources/node_modules/maxrects-packer/src/maxrects_packer.ts:70:14)
    at mapLimit (/mnt/c/Users/ext_valencia.and/Dev/harp-font-resources/node_modules/msdf-bmfont-xml/index.js:174:12)
    at f (/mnt/c/Users/ext_valencia.and/Dev/harp-font-resources/node_modules/map-limit/node_modules/once/once.js:17:25)
    at abort (/mnt/c/Users/ext_valencia.and/Dev/harp-font-resources/node_modules/map-limit/index.js:38:12)
    at /mnt/c/Users/ext_valencia.and/Dev/harp-font-resources/node_modules/map-limit/index.js:47:23
    at generateImage (/mnt/c/Users/ext_valencia.and/Dev/harp-font-resources/node_modules/msdf-bmfont-xml/index.js:166:23)
    at exec (/mnt/c/Users/ext_valencia.and/Dev/harp-font-resources/node_modules/msdf-bmfont-xml/index.js:329:21)
    at ChildProcess.exithandler (child_process.js:296:5)
    at ChildProcess.emit (events.js:182:13)

Any idea of why this might be happening? Only happens locally, and runs fine on a xenial docker image.

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Comments: 15 (6 by maintainers)

Most upvoted comments

@amsgames94, @zellm, @soimy I had the same issue and build msdfgen from latest mainline and it works. (also strip is working). Should I create a PR with the updated binary I build?

@soimy Have you ever tried to set rpath when building msdfgen instead of patching it after building it? I will try this if I find time.

PR is here: https://github.com/soimy/msdf-bmfont-xml/pull/37 but Travis is also failing for me: https://travis-ci.org/soimy/msdf-bmfont-xml/builds/534678791?utm_source=github_status&utm_medium=notification

Can you point me to how I have to patch the binary with patchelf. I tried the following but the libraries did not change:

$ patchelf --replace-needed /usr/lib/x86_64-linux-gnu/libfreetype.so.6 ./lib/libfreetype.so.6 msdfgen.linux
$ ldd msdfgen.linux
        linux-vdso.so.1 (0x00007ffff0d05000)
        libfreetype.so.6 => /usr/lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007fdc088d0000)
        libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fdc08540000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fdc081a0000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fdc07f80000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fdc07b80000)
        libpng16.so.16 => /usr/lib/x86_64-linux-gnu/libpng16.so.16 (0x00007fdc07940000)
        libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fdc07710000)
        lib/libfreetype.so.6 => /lib64/ld-linux-x86-64.so.2 (0x00007fdc09000000)

Could we not just take the libraries from the system and update the ones used in Travis?