cwebp-bin icon indicating copy to clipboard operation
cwebp-bin copied to clipboard

Not working on Node 8.9.1 on Alpine 3.7

Open affixalex opened this issue 7 years ago • 5 comments

https://github.com/hypoalex/reduction - A minimal reduction of the problem is available here, using Docker.

git clone [email protected]:hypoalex/reduction.git
cd reduction && docker build .

It doesn't actually throw an error. It just kinda fails to build.

affixalex avatar Dec 02 '17 18:12 affixalex

Hello! Binary file cwebp-bin/vendor/linux/x64/cwebp is not compatible with Alpine Linux because it used musl lib c. What do you think about adding to the repository additional cwebp binary for musl based systems?

grushikhin avatar Apr 09 '18 09:04 grushikhin

Is there any temporary solution for this? I've yet to find something that points to a solution that works properly. Something like building cwebp on the system itself, using musl.

oprearocks avatar May 21 '18 08:05 oprearocks

Actually found that for me, the reason this wasn't working was due to npm. Yarn seems to properly build the module even on Alpine.

oprearocks avatar May 31 '18 18:05 oprearocks

Why does the bin-wrapper script only link to URLs? Can't use a local package?

polarathene avatar Jan 02 '19 01:01 polarathene

@oprearocks just tried yarn, it silently fails. Appears like it worked fine if you don't use verbose(which shows output you'd get with npm install)

[4/4] Building fresh packages...
verbose 9.242 ⚠ spawn /site/node_modules/cwebp-bin/vendor/cwebp ENOENT
  ⚠ cwebp pre-build test failed
  ℹ compiling from source
  ✖ Error: Command failed: /bin/sh -c ./configure --disable-shared --prefix="/site/node_modules/cwebp-bin/vendor" --bindir="/site/node_modules/cwebp-bin/vendor"
configure: error: in `/tmp/ef7f80d9-d8ef-4c47-b41e-0b2b00202369':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details

checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for style of include used by make... GNU
checking for gcc... no
checking for cc... no
checking for cl.exe... no

    at Promise.all.then.arr (/site/node_modules/execa/index.js:231:11)
    at process._tickCallback (internal/process/next_tick.js:68:7)
success Saved 1 new dependency.
info Direct dependencies
└─ [email protected]
info All dependencies
└─ [email protected]
Done in 9.27s.

In this case I know why it can't compile, but I already have a valid binary(the one this package seems to pull in isn't compatible with Alpine afaik), it just fails to use it by attempting to download it's own binary file from the repo to use.

Difference in my image size if I have to compile is few hundred MB(due to not wanting to copy node_modules into the image file which would be similar bloat).

polarathene avatar Jan 02 '19 02:01 polarathene