Project

General

Profile

Actions

Bug #17129

closed

bundle install `eventmachine` and `sassc` fails since 914b2208ab3eddec478cdc3e079e6c30d0f0892c

Added by yahonda (Yasuo Honda) over 3 years ago. Updated over 3 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.8.0dev (2020-08-21T15:45:39Z master 914b2208ab) [x86_64-linux]
[ruby-core:99700]

Description

bundle install eventmachine and sassc fails since 914b2208ab3eddec478cdc3e079e6c30d0f0892c

Ruby on Rails CI against ruby 2.8.0dev using rubylang/ruby:master-nightly-bionic docker image has been failing since https://buildkite.com/rails/rails/builds/71164#29b1f158-9052-4c4b-a611-3aa3c7ca1e9d
Running git bisect and it says 914b2208ab3eddec478cdc3e079e6c30d0f0892c triggers this failure.

% git bisect good
914b2208ab3eddec478cdc3e079e6c30d0f0892c is the first bad commit
commit 914b2208ab3eddec478cdc3e079e6c30d0f0892c
Author: 卜部昌平 <shyouhei@ruby-lang.org>
Date:   Fri Aug 21 23:53:05 2020 +0900

    configure.ac: rule out old Sun C++

    CI failures observed for old Sun C++.  We don't want to hustle, as newer
    versions are okay.  Just check the sanity and rule out insane compilers.

 configure.ac | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
%

Steps to reproduce

  1. Install Docker
  2. Install Ruby 2.7.1
  3. Create Ruby docker image for 914b2208ab3eddec478cdc3e079e6c30d0f0892c
git clone https://github.com/yahonda/ruby-docker-images.git -b remove_depth_1
cd ruby-docker-images
rake docker:build ruby_version=master:914b2208ab3eddec478cdc3e079e6c30d0f0892c

The reason why I'm using forked ruby-docker-images repo is to work around "fatal: reference is not a tree"

+ git clone --depth 1 https://github.com/ruby/ruby.git /usr/src/ruby
Cloning into '/usr/src/ruby'...
+ cd /usr/src/ruby
+ git checkout 954afd1bc55b9b98e4e5099e3c49c3710514fdb8
fatal: reference is not a tree: 954afd1bc55b9b98e4e5099e3c49c3710514fdb8
  1. Run Rails CI using the Docker image created in step 3
cd ~
git clone https://github.com/rails/rails.git
cd rails
git clone https://github.com/rails/buildkite-config .buildkite/
RUBY_IMAGE=rubylang/ruby:master-914b2208ab3eddec478cdc3e079e6c30d0f0892c-bionic docker-compose -f .buildkite/docker-compose.yml build base && CI=1 docker-compose -f .buildkite/docker-compose.yml run default runner actionpack 'rake test'

Actual result

  • bundle install for eventmachine and sassc fails.
current directory:
/usr/local/lib/ruby/gems/2.8.0/gems/eventmachine-1.2.7/ext
/usr/local/bin/ruby -I /usr/local/lib/ruby/2.8.0 -r
./siteconf20200826-46-s8y650.rb extconf.rb
checking for -lcrypto... yes
checking for -lssl... yes
checking for openssl/ssl.h... yes
checking for openssl/err.h... yes
checking for rb_trap_immediate in ruby.h,rubysig.h... no
checking for rb_thread_blocking_region()... no
checking for rb_thread_call_without_gvl() in ruby/thread.h... yes
checking for rb_thread_fd_select()... yes
checking for rb_fdset_t in ruby/intern.h... yes
checking for rb_wait_for_single_fd()... yes
checking for rb_enable_interrupt()... no
checking for rb_time_new()... yes
checking for inotify_init() in sys/inotify.h... yes
checking for writev() in sys/uio.h... yes
checking for pipe2() in unistd.h... yes
checking for accept4() in sys/socket.h... yes
checking for SOCK_CLOEXEC in sys/socket.h... yes
checking for sys/event.h... no
checking for epoll_create() in sys/epoll.h... yes
checking for clock_gettime()... yes
checking for CLOCK_MONOTONIC_RAW in time.h... yes
checking for CLOCK_MONOTONIC in time.h... yes
CXXFLAGS=
creating Makefile

current directory: /usr/local/lib/ruby/gems/2.8.0/gems/eventmachine-1.2.7/ext
make "DESTDIR=" clean

current directory: /usr/local/lib/ruby/gems/2.8.0/gems/eventmachine-1.2.7/ext
make "DESTDIR="
compiling binder.cpp
Makefile:236: recipe for target 'binder.o' failed
make: *** [binder.o] Error 1

make failed, exit code 2

Gem files will remain installed in
/usr/local/lib/ruby/gems/2.8.0/gems/eventmachine-1.2.7 for inspection.
Results logged to
/usr/local/lib/ruby/gems/2.8.0/extensions/x86_64-linux/2.8.0/eventmachine-1.2.7/gem_make.out

An error occurred while installing eventmachine (1.2.7), and Bundler cannot
continue.
Make sure that `gem install eventmachine -v '1.2.7' --source
'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
  blade was resolved to 0.7.1, which depends on
    faye was resolved to 1.4.0, which depends on
      em-http-request was resolved to 1.1.6, which depends on
        em-socksify was resolved to 0.3.2, which depends on
          eventmachine


Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /usr/local/lib/ruby/gems/2.8.0/gems/sassc-2.4.0/ext
/usr/local/bin/ruby -I /usr/local/lib/ruby/2.8.0 -r
./siteconf20200826-46-hiwsm7.rb extconf.rb
creating Makefile

current directory: /usr/local/lib/ruby/gems/2.8.0/gems/sassc-2.4.0/ext
make "DESTDIR=" clean

current directory: /usr/local/lib/ruby/gems/2.8.0/gems/sassc-2.4.0/ext
make "DESTDIR="
compiling ./libsass/src/ast.cpp
Makefile:236: recipe for target 'ast.o' failed
make: *** [ast.o] Error 1

make failed, exit code 2

Gem files will remain installed in
/usr/local/lib/ruby/gems/2.8.0/gems/sassc-2.4.0 for inspection.
Results logged to
/usr/local/lib/ruby/gems/2.8.0/extensions/x86_64-linux/2.8.0/sassc-2.4.0/gem_make.out

An error occurred while installing sassc (2.4.0), and Bundler cannot continue.
Make sure that `gem install sassc -v '2.4.0' --source 'https://rubygems.org/'`
succeeds before bundling.

In Gemfile:
  sass-rails was resolved to 6.0.0, which depends on
    sassc-rails was resolved to 2.1.2, which depends on
      sassc
ERROR: Service 'base' failed to build: The command '/bin/sh -c rm -f railties/exe/.empty     && find railties/exe -maxdepth 0 -type d -empty -exec rmdir '{}' '+'     && echo "--- :bundler: Installing Ruby deps"     && (cd tmp && for f in *.gemspec; do d="$(basename -s.gemspec "$f")"; mkdir -p "../$d" && mv "$f" "../$d/"; done)     && rm Gemfile.lock && bundle install -j 8 && cp Gemfile.lock tmp/Gemfile.lock.updated     && rm -rf /usr/local/bundle/cache     && echo "--- :floppy_disk: Copying repository contents"' returned a non-zero code: 5
%

Expected result

It should finish like this as the previous commit 954afd1bc55b9b98e4e5099e3c49c3710514fdb8

3360 runs, 16339 assertions, 0 failures, 0 errors, 0 skips

Steps to reproduce with 954afd1bc55b9b98e4e5099e3c49c3710514fdb8

git clone https://github.com/yahonda/ruby-docker-images.git -b remove_depth_1
cd ruby-docker-images
rake docker:build ruby_version=master:954afd1bc55b9b98e4e5099e3c49c3710514fdb8

cd ~
git clone https://github.com/rails/rails.git
cd rails
git clone https://github.com/rails/buildkite-config .buildkite/
RUBY_IMAGE=rubylang/ruby:master-954afd1bc55b9b98e4e5099e3c49c3710514fdb8-bionic docker-compose -f .buildkite/docker-compose.yml build base && CI=1 docker-compose -f .buildkite/docker-compose.yml run default runner actionpack 'rake test'

Updated by shyouhei (Shyouhei Urabe) over 3 years ago

Is there a way for me to get the config.log which has to be created during compiling ruby itself? It must contain the reason why the C++ compiler was rejected.

Updated by yahonda (Yasuo Honda) over 3 years ago

It only reproduces with Ruby usingrubylang/ruby:master-nightly-bionic.
It does not reproduce ruby installed by rbenv install 2.8.0-dev at local Ubuntu 18.04.5 LTS, then I do not know how to provide config.log, yet.

Updated by mrkn (Kenta Murata) over 3 years ago

This is config.log produced by rake docker:build ruby_version=master:914b2208ab3eddec478cdc3e079e6c30d0f0892c.
https://gist.github.com/mrkn/1c2b8ad11810355ff916fd86af8317be

Updated by shyouhei (Shyouhei Urabe) over 3 years ago

Thank you!

https://gist.github.com/mrkn/1c2b8ad11810355ff916fd86af8317be#file-config-log-L1147-L1149

configure:11821: checking whether CXXFLAGS is valid
configure:11840: g++ -c   conftest.cpp >&5
/usr/src/ruby/configure: line 1911: g++: command not found

So it seems C++ compiler does not exist at all in the container.

This is not a problem by itself. But a next mystery arises: how was it possible to compile eventmachine before, given it is written in C++?

Updated by mrkn (Kenta Murata) over 3 years ago

I added g++ in the docker image. I confirmed this problem was fixed by the steps to reproduce described above. Thanks.

Updated by yahonda (Yasuo Honda) over 3 years ago

This is not a problem by itself. But a next mystery arises: how was it possible to compile eventmachine before, given it is written in C++?

Rails CI runs on Buildkite, whose Dockerfile also installs g++.

https://github.com/rails/buildkite-config/blob/65f6e2821657c85d17a9e0bc196f26040fabe3ec/Dockerfile#L42

I have created a branch called remove_g++ not to install g++ here.

https://github.com/yahonda/buildkite-config/commit/0ed9f0615cd34f3aa8e8f7f6a8bd843ed98938ab

Then it reproduces this issue with the previous commit 954afd1bc55b9b98e4e5099e3c49c3710514fdb8.

Steps to reproduce by not installing g++ at Buildkite container.

git clone https://github.com/yahonda/ruby-docker-images.git -b remove_depth_1
cd ruby-docker-images
rake docker:build ruby_version=master:954afd1bc55b9b98e4e5099e3c49c3710514fdb8
cd ~
git clone https://github.com/rails/rails.git
cd rails
git clone https://github.com/yahonda/buildkite-config .buildkite/ -b remove_g++
RUBY_IMAGE=rubylang/ruby:master-954afd1bc55b9b98e4e5099e3c49c3710514fdb8-bionic docker-compose -f .buildkite/docker-compose.yml build base && CI=1 docker-compose -f .buildkite/docker-compose.yml run default runner actionpack 'rake test'
Actions #9

Updated by jeremyevans0 (Jeremy Evans) over 3 years ago

  • Status changed from Open to Closed
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0