sonicdoe / detect-character-encoding

Detect character encoding using ICU
Other
84 stars 15 forks source link

node:8.12-alpine: utrace_cleanup_59: symbol not found #16

Closed m-abs closed 6 years ago

m-abs commented 6 years ago

Hi,

I'm trying to move our docker images to Alpine, but I've run into a road-block with detect-character-encoding@0.6.0

Reproduce:

> docker run --rm -it node:8.12-alpine sh -c 'apk add python build-base && npm i detect-character-encoding && node -e "require(\"detect-character-encoding\")"'

Output from above command:

fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/community/x86_64/APKINDEX.tar.gz
(1/28) Installing binutils (2.30-r5)
(2/28) Installing libmagic (5.32-r0)
(3/28) Installing file (5.32-r0)
(4/28) Installing gmp (6.1.2-r1)
(5/28) Installing isl (0.18-r0)
(6/28) Installing libgomp (6.4.0-r9)
(7/28) Installing libatomic (6.4.0-r9)
(8/28) Installing pkgconf (1.5.3-r0)
(9/28) Installing mpfr3 (3.1.5-r1)
(10/28) Installing mpc1 (1.0.3-r1)
(11/28) Upgrading libstdc++ (6.4.0-r8 -> 6.4.0-r9)
(12/28) Installing gcc (6.4.0-r9)
(13/28) Installing musl-dev (1.1.19-r10)
(14/28) Installing libc-dev (0.7.1-r0)
(15/28) Installing g++ (6.4.0-r9)
(16/28) Installing make (4.2.1-r2)
(17/28) Installing fortify-headers (0.9-r0)
(18/28) Installing build-base (0.5-r1)
(19/28) Installing libbz2 (1.0.6-r6)
(20/28) Installing expat (2.2.5-r0)
(21/28) Installing libffi (3.2.1-r4)
(22/28) Installing gdbm (1.13-r1)
(23/28) Installing ncurses-terminfo-base (6.1_p20180818-r1)
(24/28) Installing ncurses-terminfo (6.1_p20180818-r1)
(25/28) Installing ncurses-libs (6.1_p20180818-r1)
(26/28) Installing readline (7.0.003-r0)
(27/28) Installing sqlite-libs (3.24.0-r0)
(28/28) Installing python2 (2.7.15-r1)
Executing busybox-1.28.4-r1.trigger
OK: 212 MiB in 42 packages

> detect-character-encoding@0.6.0 install /node_modules/detect-character-encoding
> node-gyp rebuild

make: Entering directory '/node_modules/detect-character-encoding/build'
  TOUCH Release/obj.target/vendor/icu/icu_implementation.stamp
  TOUCH Release/obj.target/vendor/icu/icu_uconfig.stamp
  TOUCH Release/obj.target/vendor/icu/icu_uconfig_target.stamp
  CXX(target) Release/obj.target/icui18n/vendor/icu/i18n/csdetect.o
  CXX(target) Release/obj.target/icui18n/vendor/icu/i18n/csmatch.o
  CXX(target) Release/obj.target/icui18n/vendor/icu/i18n/csr2022.o
  CXX(target) Release/obj.target/icui18n/vendor/icu/i18n/csrecog.o
  CXX(target) Release/obj.target/icui18n/vendor/icu/i18n/csrmbcs.o
  CXX(target) Release/obj.target/icui18n/vendor/icu/i18n/csrsbcs.o
  CXX(target) Release/obj.target/icui18n/vendor/icu/i18n/csrucode.o
  CXX(target) Release/obj.target/icui18n/vendor/icu/i18n/csrutf8.o
  CXX(target) Release/obj.target/icui18n/vendor/icu/i18n/inputext.o
  CXX(target) Release/obj.target/icui18n/vendor/icu/i18n/ucln_in.o
  CXX(target) Release/obj.target/icui18n/vendor/icu/i18n/ucsdet.o
  AR(target) Release/obj.target/vendor/icu/icui18n.a
  COPY Release/icui18n.a
  CXX(target) Release/obj.target/icuucx/vendor/icu/common/cmemory.o
  CXX(target) Release/obj.target/icuucx/vendor/icu/common/uarrsort.o
  CXX(target) Release/obj.target/icuucx/vendor/icu/common/ucln_cmn.o
  CXX(target) Release/obj.target/icuucx/vendor/icu/common/uenum.o
  CXX(target) Release/obj.target/icuucx/vendor/icu/common/umutex.o
  CXX(target) Release/obj.target/icuucx/vendor/icu/common/uobject.o
  CXX(target) Release/obj.target/icuucx/vendor/icu/common/utypes.o
  AR(target) Release/obj.target/vendor/icu/icuucx.a
  COPY Release/icuucx.a
  CXX(target) Release/obj.target/icuWrapper/icuWrapper.o
  SOLINK_MODULE(target) Release/obj.target/icuWrapper.node
  COPY Release/icuWrapper.node
  TOUCH Release/obj.host/vendor/icu/icu_implementation.stamp
  TOUCH Release/obj.host/vendor/icu/icu_uconfig.stamp
  TOUCH Release/obj.host/vendor/icu/icui18n.stamp
make: Leaving directory '/node_modules/detect-character-encoding/build'
npm WARN saveError ENOENT: no such file or directory, open '/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/package.json'
npm WARN !invalid#1 No description
npm WARN !invalid#1 No repository field.
npm WARN !invalid#1 No README data
npm WARN !invalid#1 No license field.

+ detect-character-encoding@0.6.0
added 3 packages from 9 contributors and audited 3 packages in 5.16s
found 0 vulnerabilities

/node_modules/bindings/bindings.js:88
        throw e
        ^

Error: Error relocating /node_modules/detect-character-encoding/build/Release/icuWrapper.node: utrace_cleanup_59: symbol not found
    at Object.Module._extensions..node (module.js:682:18)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at bindings (/node_modules/bindings/bindings.js:81:44)
    at Object.<anonymous> (/node_modules/detect-character-encoding/index.js:3:37)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)

I'm seen the same plus a lot of warnings during on node:10-alpine.

Might be related to #11 but that is for Node v6.

sonicdoe commented 6 years ago

I’m sorry, Alpine Linux support has proven to be quite difficult and I’ve actually dropped support in the latest release (see https://github.com/sonicdoe/detect-character-encoding/commit/5cbba15278428766833dd97c92cdf7f1bead38c1). If you don’t actually need ICU itself, I’d suggest taking a look at ced which works similarly but runs on Alpine Linux.

m-abs commented 6 years ago

Hi,

Thank you for your quick response and your suggestion.

For now we'll just use the node:8-slim image instead of alpine and might be switching to ced at a later point.