whatwg / html-build

Build scripts for https://github.com/whatwg/html
Other
62 stars 62 forks source link

Docker build fails on M1 MacBook #270

Closed jakearchibald closed 7 months ago

jakearchibald commented 1 year ago

Error is:

qemu-x86_64: Could not open '/lib64/ld-linux-x86-64.so.2': No such file or directory

It can be fixed by changing:

FROM debian:stable-slim

to

FROM --platform=linux/amd64 debian:stable-slim

Although I don't know enough about the build process to know if it's a good idea to add that for everyone.

domenic commented 10 months ago

Sorry for not working on this sooner.

Is anyone with a M1 Mac able to confirm that this is still a problem? I'm wondering if this is something the ecosystem has worked out over time, or whether it's still helpful.

I think this would be a safe change to make, if it's still helpful.

ADKaster commented 7 months ago

On my M2 Max MacBook Pro with macOS Sonoma Version 14.3 (23D56) and Docker version 25.0.2, build 29cf629, this issue doesn't reproduce.

I assume it was related to base images/pacakges not being available with arm64 platforms upstream/on docker.io?

When I ran it just now the debian/stable:slim container seemed to be pulling arm64 packages, anyway.

ADKaster commented 7 months ago

Though actually it looks like the wattsi image is an amd64 one? So maybe me having Rosetta 2 installed was the deciding factor.

image
domenic commented 7 months ago

Let's close this for now then... I don't know if there are best practices for cross platform Docker we should be implementing (isn't Docker supposed to abstract that stuff away??) but it seems like it's working alright at this point.

ADKaster commented 7 months ago

Ah right. I created a PR for wattsi to do that cross-platform Docker stuff https://github.com/whatwg/wattsi/pull/160