
Issue #19434 has been updated by bkuhlmann (Brooke Kuhlmann). Hey Maxime. So, after you mentioned the cross-compiling issue, I got worried and ended up rebuilding my *Docker Alpine Base* image and then rebuilding my *Docker Alpine Ruby* on top of that build. I'm not exactly sure what went wrong in the build process but something must have failed when building the original image (despite no errors issued). I'm definitely cross-compiling when doing this. Here's the full command if you are curious: ``` bash docker build --platform linux/arm64,linux/amd64 . ``` This [image](https://hub.docker.com/layers/bkuhlmann/alpine-ruby/latest/images/sha256-587...) is fully built on Alpine Linux 3.17.2 with Ruby 3.2.1 plus YJIT enabled. I have no errors now. Feel free to close this issue due to user error. Sorry for the trouble but thanks for the prompt to help me resolve this. 🙇🏻♂️ ---------------------------------------- Bug #19434: Fix YJIT compilation for Alpine Linux 3.17.2 https://bugs.ruby-lang.org/issues/19434#change-101865 * Author: bkuhlmann (Brooke Kuhlmann) * Status: Open * Priority: Normal * Assignee: yjit * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN ---------------------------------------- ## Overview Hello. 👋 With the recent [Alpine Linux 3.17.2](https://www.alpinelinux.org/posts/Alpine-3.17.2-released.html) patch release -- which includes OpenSSL security patches -- I'm no longer able to build an Alpine Linux Docker image with YJIT enabled for Ruby. Prior to the 3.17.2 patch release, I could build Ruby + YJIT without issue. Here's the error I'm seeing when building locally: ``` #0 409.6 gcc (Alpine 12.2.1_git20220924-r4) 12.2.1 20220924 #0 409.6 Copyright (C) 2022 Free Software Foundation, Inc. #0 409.6 This is free software; see the source for copying conditions. There is NO #0 409.6 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #0 409.6 #0 409.7 compiling ./main.c #0 409.7 compiling dmydln.c #0 409.7 compiling miniinit.c #0 409.7 compiling dmyext.c #0 410.1 making dummy probes.h #0 410.2 compiling ast.c #0 410.7 compiling bignum.c #0 410.8 compiling class.c #0 411.8 compiling compar.c #0 414.1 compiling compile.c #0 414.9 compiling complex.c #0 421.0 compiling cont.c #0 421.7 In file included from cont.c:38: #0 421.7 yjit.h:24:3: error: #error YJIT unsupported platform #0 421.7 24 | # error YJIT unsupported platform #0 421.7 | ^~~~~ ``` ...but what I see in the `yjit.h` source code is: ``` // We generate x86 assembly #if defined(_WIN32) ? defined(_M_AMD64) : defined(__x86_64__) // x86_64 platforms without mingw/msys or x64-mswin #else # error YJIT unsupported platform #endif ``` ...so AMD 64 should still be supported. ## Steps to Recreate Probably the simplest way to recreate this, locally, is to use my Docker project: 1. Run: `git clone https://github.com/bkuhlmann/docker-alpine-ruby` 1. Run: `cd docker-alpine-ruby` 1. Edit the top of the `Dockerfile` so it says: `FROM bkuhlmann/alpine-base:2.0.3` (this ensures Alpine Linux 3.17.2 is being used). 1. Run `docker build --platform linux/amd64 .` 1. Wait for the build to fail. ## Environment **macOS** `macOS 13.2` **Docker** ``` Client: Cloud integration: v1.0.29 Version: 20.10.22 API version: 1.41 Go version: go1.18.9 Git commit: 3a2c30b Built: Thu Dec 15 22:28:41 2022 OS/Arch: darwin/arm64 Context: default Experimental: true Server: Docker Desktop 4.16.2 (95914) Engine: Version: 20.10.22 API version: 1.41 (minimum version 1.12) Go version: go1.18.9 Git commit: 42c8b31 Built: Thu Dec 15 22:25:43 2022 OS/Arch: linux/arm64 Experimental: false containerd: Version: 1.6.14 GitCommit: 9ba4b250366a5ddde94bb7c9d1def331423aa323 runc: Version: 1.1.4 GitCommit: v1.1.4-0-g5fd4c4d docker-init: Version: 0.19.0 GitCommit: de40ad0 ``` -- https://bugs.ruby-lang.org/