Giter Site home page Giter Site logo

Build fail on Alpine Linux about ruby-unf_ext HOT 7 OPEN

knu avatar knu commented on August 10, 2024
Build fail on Alpine Linux

from ruby-unf_ext.

Comments (7)

pdfrod avatar pdfrod commented on August 10, 2024 1

Never tried ruby-install, I'm using rbenv. I don't even get to the part where I can install gems, as the error happens when installing Ruby.

from ruby-unf_ext.

thenrio avatar thenrio commented on August 10, 2024

@Micka33

isinf and isnan are present in https://github.com/docker-library/ruby/blob/2d6449f03976ededa14be5cac1e9e070b74e4de4/2.3/alpine/Dockerfile

I have no issue installing unf_ext 0.0.7.2 out of alpine:3.4

/opt/smoke # ruby --version
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux-musl]
/opt/smoke # bundle show unf_ext 
/usr/lib/ruby/gems/2.3.0/gems/unf_ext-0.0.7.2

from ruby-unf_ext.

webattitude avatar webattitude commented on August 10, 2024

same pb here with alpine 3.5

from ruby-unf_ext.

pdfrod avatar pdfrod commented on August 10, 2024

I'm having the same issue with Alpine 3.6.

from ruby-unf_ext.

pdfrod avatar pdfrod commented on August 10, 2024

I was able to workaround the issue adding the environment variables ac_cv_func_isnan=yes ac_cv_func_isinf=yes as explained here: gliderlabs/docker-alpine#261 (comment)

from ruby-unf_ext.

rafaelmagu avatar rafaelmagu commented on August 10, 2024

Did any of you by any chance install Ruby with ruby-install? I'm seeing this on alpine:3.6 but on the eventmachine gem, using Ruby 2.2.9.

from ruby-unf_ext.

rafaelmagu avatar rafaelmagu commented on August 10, 2024

Managed to build a good version of Ruby 2.2.9 on Alpine 3.6 with the following Dockerfile:

FROM alpine:3.7

ENV TZ "Etc/UTC"
RUN echo "Etc/UTC" > /etc/timezone

RUN apk upgrade --update && \
    apk add --no-cache \
      bash \
      ca-certificates \
      curl \
      less \
      libstdc++ \
      libressl-dev \
      tzdata \
      zlib-dev && \
    rm -rf /var/cache/apk/*

# skip installing gem documentation
RUN mkdir -p /usr/local/etc \
  && { \
  echo 'install: --no-document'; \
  echo 'update: --no-document'; \
  } >> /usr/local/etc/gemrc

ENV RUBY_MAJOR 2.2
ENV RUBY_VERSION 2.2.9
ENV RUBY_DOWNLOAD_SHA256 2f47c77054fc40ccfde22501425256d32c4fa0ccaf9554f0d699ed436beca1a6
ENV RUBYGEMS_VERSION 2.6.6

# some of ruby's build scripts are written in ruby
# we purge this later to make sure our final image uses what we just built
RUN set -ex \
  && apk add --no-cache --virtual .ruby-builddeps \
  autoconf \
  bison \
  bzip2 \
  bzip2-dev \
  ca-certificates \
  coreutils \
  curl \
  gcc \
  gdbm-dev \
  glib-dev \
  libc-dev \
  libffi-dev \
  libxml2-dev \
  libxslt-dev \
  linux-headers \
  make \
  ncurses-dev \
  procps \
# https://bugs.ruby-lang.org/issues/11869 and https://github.com/docker-library/ruby/issues/75
  readline-dev \
  ruby \
  yaml-dev \
  zlib-dev \
  && curl -fSL -o ruby.tar.gz "http://cache.ruby-lang.org/pub/ruby/$RUBY_MAJOR/ruby-$RUBY_VERSION.tar.gz" \
  && echo "$RUBY_DOWNLOAD_SHA256 *ruby.tar.gz" | sha256sum -c - \
  && mkdir -p /usr/src \
  && tar -xzf ruby.tar.gz -C /usr/src \
  && mv "/usr/src/ruby-$RUBY_VERSION" /usr/src/ruby \
  && rm ruby.tar.gz \
  && cd /usr/src/ruby \
  && { echo '#define ENABLE_PATH_CHECK 0'; echo; cat file.c; } > file.c.new && mv file.c.new file.c \
  && autoconf \
  # the configure script does not detect isnan/isinf as macros
  && ac_cv_func_isnan=yes ac_cv_func_isinf=yes \
  ./configure --disable-install-doc \
  && make -j"$(getconf _NPROCESSORS_ONLN)" \
  && make install \
  && runDeps="$( \
  scanelf --needed --nobanner --recursive /usr/local \
  | awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
  | sort -u \
  | xargs -r apk info --installed \
  | sort -u \
  )" \
  && apk add --virtual .ruby-rundeps $runDeps \
  bzip2 \
  ca-certificates \
  curl \
  libffi-dev \
  libressl-dev \
  yaml-dev \
  procps \
  zlib-dev \
  && apk del .ruby-builddeps \
  && gem update --system $RUBYGEMS_VERSION \
  && rm -r /usr/src/ruby

ENV BUNDLER_VERSION 1.16.1

RUN gem install bundler --version "$BUNDLER_VERSION"

# install things globally, for great justice
# and don't create ".bundle" in all our apps
ENV GEM_HOME /usr/local/bundle
ENV BUNDLE_PATH="$GEM_HOME" \
  BUNDLE_BIN="$GEM_HOME/bin" \
  BUNDLE_SILENCE_ROOT_WARNING=1 \
  BUNDLE_APP_CONFIG="$GEM_HOME"
ENV PATH $BUNDLE_BIN:$PATH
RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \
  && chmod 777 "$GEM_HOME" "$BUNDLE_BIN"

from ruby-unf_ext.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.