lovell / avif-cli

Command line utility to convert images to AVIF
Apache License 2.0
165 stars 18 forks source link

Illegal instruction (core dumped) #12

Closed rabollig closed 1 year ago

rabollig commented 1 year ago

This feels like it's a pretty generic error that might be due to something else... but I'll ask anyway.

Building a fresh environment with this Dockerfile:

FROM ubuntu:latest

RUN apt-get update && apt-get -y upgrade && apt-get -y  install curl && \ 
    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash && \
    export NVM_DIR="$HOME/.nvm" && \
    [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \
    [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" && \
   nvm install node && \ 
   npx -y avif # install avif

I get the following at the end of the procedure:

Downloading and installing node v19.5.0...
Downloading https://nodejs.org/dist/v19.5.0/node-v19.5.0-linux-x64.tar.gz...
######################################################################## 100.0%
Computing checksum with sha256sum
Checksums matched!
Now using node v19.5.0 (npm v9.3.1)
Creating default alias: default -> node (-> v19.5.0 *)
Illegal instruction (core dumped)

I've tried doing it step-by-step as well. NPM otherwise seems to be responding correctly, though I'm more of a PHP person and might be missing something really obvious.

What information might be helpful to further diagnose?

lovell commented 1 year ago

Hi, you'll need to ensure the machine meets the prerequisites at https://sharp.pixelplumbing.com/install#prerequisites , which includes "CPU with SSE4.2".

What is the output of running npx envinfo --system within the container?

rabollig commented 1 year ago

Thanks! Yeah, it's a pretty old CPU...

  System:
    OS: Linux 4.4 Ubuntu 20.04.5 LTS (Focal Fossa)
    CPU: (2) x64 Pentium(R) Dual-Core  CPU      E6600  @ 3.06GHz
    Memory: 2.54 GB / 3.83 GB
    Container: Yes
    Shell: 5.0.17 - /bin/bash

I tried it on a modern MacBook and it works just fine.

I'll send a PR your way with a Dockerfile once it get it smooth.

It's quite amazing!

Thanks!