dmtrKovalenko / odiff

The fastest pixel-by-pixel image visual difference tool in the world.
MIT License
1.96k stars 73 forks source link

Error related to Rosetta on Macbook M1 Pro in Docker #99

Open Mauladen opened 1 month ago

Mauladen commented 1 month ago

Good afternoon, I use your tool as part of lost-pixel, but there is a nuance - this is the use of Docker, I use an ARM64 Playwright image into which I copy the project to run lost-pixel

Screenshots are taken stably and do not cause errors, and when diff is launched, the error rosetta error: failed to open elf at /lib64/ld-linux-x86-64.so.2 appears

I most likely understand why this happens after studying postinstall.js, since diff defines the target system as linux

For information, the AMD64 image does not have this problem, but it runs slower, just by running the odiff --help command in the Docker container I get the same error

Maybe you will have ideas on how to fix this?

dmtrKovalenko commented 1 month ago

I don’t think that we provide Linux arm binary. OCaml has very hard relationships with cross compilation 😔

In your case I would try to:

  1. Manually run postinstall script from the odiff directory like cd node_modules/odiff && yarn postinstall

  2. It might not work so you will need to remove some directories

  3. If it doesn’t help reinstall odiff after mounting / unmounting the volume

Mauladen commented 1 month ago

I don’t think that we provide Linux arm binary. OCaml has very hard relationships with cross compilation 😔

In your case I would try to:

1. Manually run postinstall script from the odiff directory like cd node_modules/odiff && yarn postinstall

2. It might not work so you will need to remove some directories

3. If it doesn’t help reinstall odiff after mounting / unmounting the volume

Thank you for your answer, I will try your options and give you an answer later

Mauladen commented 1 month ago

Good afternoon, I found a solution and that's what helped me to launch your application

RUN apt-get install -y libc6-amd64-cross
RUN ln -s /usr/x86_64-linux-gnu/lib64/ /lib64
ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/lib64:/usr/x86_64-linux-gnu/lib"

It may be worth specifying this information somewhere, but this is at your discretion