Skip to content
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

Failed to compile due to unsupported platform aarch64-alpine-linux-musl (on Apple M1 with docker) #17

Closed
ronaldtse opened this issue Mar 22, 2022 · 0 comments · Fixed by #19
Assignees
Labels
bug Something isn't working

Comments

@ronaldtse
Copy link
Contributor

ronaldtse commented Mar 22, 2022

I'm trying to install the emf2svg gem on a Alpine Linux container (on Apple M1 with docker) but ran into this problem:

Is it possible not to validate against a platform?

#19 145.2 Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
#19 145.2 
#19 145.2     current directory: /usr/local/bundle/gems/emf2svg-1.2.0/ext
#19 145.2 /usr/local/bin/ruby -I /usr/local/lib/ruby/3.1.0 -r
#19 145.2 ./siteconf20220322-7-c161ro.rb extconf.rb
Downloading libemf2svg.tar.gz (  0%) 
#19 145.2 Extracting libemf2svg.tar.gz into /tmp/d20220322-2173-5vxh37... DEBUG: env is {}
#19 145.2 DEBUG: command is ["tar", "zxf",
#19 145.2 "/usr/local/bundle/gems/emf2svg-1.2.0/ports/archives/libemf2svg.tar.gz", "-C",
#19 145.2 "/tmp/d20220322-2173-5vxh37"]
#19 145.2 DEBUG: options are {[:out, :err]=>["/tmp/d20220322-2173-5vxh37/extract.log",
#19 145.2 "a"]}
#19 145.2 OK
#19 145.2 /usr/local/bundle/gems/emf2svg-1.2.0/lib/emf2svg/recipe.rb:52:in
#19 145.2 `host_platform': CrossRuby.platform: unsupported host: aarch64-alpine-linux-musl
#19 145.2 (RuntimeError)
#19 145.2 from /usr/local/bundle/gems/emf2svg-1.2.0/lib/emf2svg/recipe.rb:63:in
#19 145.2 `cross_compiling?'
#19 145.2 from /usr/local/bundle/gems/emf2svg-1.2.0/lib/emf2svg/recipe.rb:75:in
#19 145.2 `configure_defaults'
#19 145.2 from
#19 145.2 /usr/local/bundle/gems/mini_portile2-2.6.1/lib/mini_portile2/mini_portile.rb:118:in
#19 145.2 `configure_options'
#19 145.2 from
#19 145.2 /usr/local/bundle/gems/mini_portile2-2.6.1/lib/mini_portile2/mini_portile.rb:257:in
#19 145.2 `computed_options'
#19 145.2 from
#19 145.2 /usr/local/bundle/gems/mini_portile2-2.6.1/lib/mini_portile2/mini_portile_cmake.rb:33:in
#19 145.2 `configured?'
#19 145.2 from
#19 145.2 /usr/local/bundle/gems/mini_portile2-2.6.1/lib/mini_portile2/mini_portile.rb:179:in
#19 145.2 `cook'
#19 145.2 	from /usr/local/bundle/gems/emf2svg-1.2.0/lib/emf2svg/recipe.rb:27:in `cook'
#19 145.2 	from extconf.rb:6:in `<main>'
#19 145.2 
#19 145.2 extconf failed, exit code 1

The Dockerfile:

FROM ruby:3.1.1-alpine
USER root
RUN apk update && apk upgrade
RUN apk add curl unzip bash make tzdata coreutils git coreutils \
  gcc g++ musl-dev cmake \
  libxml2 libxml2-dev libxslt libxslt-dev libsass libsass-dev sassc
RUN gem install bundler
RUN gem install emf2svg

Relevant code:

def host_platform
@host_platform ||=
case @host
when /\Ax86_64.*mingw32/
"x64-mingw32"
when /\Ai[3-6]86.*mingw32/
"x86-mingw32"
when /\Ax86_64.*linux/
"x86_64-linux"
when /\Aarm64.*linux/
"xarm64-linux"
when /\Ai[3-6]86.*linux/
"x86-linux"
when /\Ax86_64.*darwin/
"x86_64-darwin"
when /\Aarm64.*darwin/
"arm64-darwin"
else
raise "CrossRuby.platform: unsupported host: #{@host}"
end
end

@ronaldtse ronaldtse added the bug Something isn't working label Mar 22, 2022
@ronaldtse ronaldtse changed the title Failed to compile due to unsupported platform aarch64-alpine-linux-musl Failed to compile due to unsupported platform aarch64-alpine-linux-musl (on Apple M1 with docker) Mar 22, 2022
@maxirmx maxirmx linked a pull request Mar 22, 2022 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants