Project

General

Profile

Actions

Bug #19434

closed

Fix YJIT compilation for Alpine Linux 3.17.2

Added by bkuhlmann (Brooke Kuhlmann) over 1 year ago. Updated over 1 year ago.

Status:
Closed
Assignee:
Target version:
-
[ruby-core:112368]

Description

Overview

Hello. 👋 With the recent Alpine Linux 3.17.2 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
  2. Run: cd docker-alpine-ruby
  3. 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).
  4. Run docker build --platform linux/amd64 .
  5. 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
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0