-
Notifications
You must be signed in to change notification settings - Fork 52
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
Support for ARM architecture? #124
Comments
Hey @kingjerod – you ever get this figured out? It appears the module adds a junk file with unicode in the name at some point during the pre/post install... |
I did not. I ended up just removing the package from my app. I did not find a suitable replacement either. |
Hey, @kingjerod @amiller-gh - Were you able to figure this out? The junk file is still there. |
I'm having different issues, using imagemin 8.0.0 on Ubuntu Linux 20.04 on M1 architecture. Installing again without first removing node_modules folder gives this error: npm ERR! A complete log of this run can be found in: |
TL;DR;
After digging a bit, I found that the weird empty file is created at this point. Because the file name is not a valid utf-8 string it makes yarn 1 crash at linking step, but yarn 2 (berry) seems to be fine with it and can proceed normally (like npm). The
So this creates the file named after the weird random bytes following the And indeed, if you run:
on Ubuntu/Debian and aarch64, you'll see the dangling file created. Apparently, falling back to a shell in case exec* errors with ENOEXEC is what's specified in POSIX and what's implemented in glibc. The shell however may refuse to run such file, but there is no guarantee. bash does this well and refuses to execute the file, but dash (which is the default shell on debian based distros) doesn't and happily starts to execute it, behaving in an undefined way. Indeed, you can just run Also, it seems that bin-wrapper uses os-file-obj to match available executables with the current platform and architecture, and should therefore have prevented the execution of the file in the first place. Unfortunately, os-file-obj still has undefined behavior with non-intel architecture and wrongfully returns the x64 binary as compatible, which leads to the execution of the file. To make matters worse, os-file-obj looks rather unmaintained (just like bin-wrapper and bin-check), so I'm not expecting a fix in there… I think the simplest workaround for the sake of this project would be to throw an error before calling It also might be worth discussing the usage of bin-wrapper and bin-check libraries as they seem unmaintained, dubious security-wise (downloading binary files from the internet when it's already available locally is not a good idea), and don't support modern architectures. At least providing binaries for a few other architectures and not downloading them from GitHub when they're available locally would be helpful. By the way, other projects from the imagemin workspace are affected by this same bug (at least optipng, pngquant and cwebp, maybe others). Update: I've opened the following PRs to fix this issue on various imagemin projects:
|
I don't know if this is the same issue, I do see the PR mentioning this thread in the pngquant-bin repo. I was getting a similar error while trying to install pngquant using yarn:
When I switched from yarn to npm, it just worked. So try switching to npm! |
@kingjerod yes, it is the same issue, and I also submitted a PR here: imagemin/pngquant-bin#140 |
I'm not sure if this is a problem with ARM. I'm trying to install gifsicle on a Docker image running an an ARM (AWS t4g server). This is the Dockerfile image:
Server is running Amazon Linux 2. Public AMI is
ami-02b1ab520319e74be
The error I get when adding the package:
Edit:
I'm able to install it in the image using
apt-get install
and then run it on the command line. Just something about this NPM package.The text was updated successfully, but these errors were encountered: