Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 728424 - dev-lang/ruby:2.5 does not install all files with MAKEOPTS="-Oline"
Summary: dev-lang/ruby:2.5 does not install all files with MAKEOPTS="-Oline"
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: Gentoo Ruby Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-15 22:13 UTC by G.Wolfe Woodbury
Modified: 2023-04-10 08:21 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build log for ruby-2.5.8 (ruby-2.5.8:20200615-212222.log,391.17 KB, text/plain)
2020-06-15 22:16 UTC, G.Wolfe Woodbury
Details
emerge --info (einfo.txt,16.84 KB, text/plain)
2020-06-15 22:17 UTC, G.Wolfe Woodbury
Details
build log for dev-ruby/rubygems-2.7.10 (rubygems-2.7.10:20200615-212339.log,2.52 KB, text/plain)
2020-06-15 22:21 UTC, G.Wolfe Woodbury
Details

Note You need to log in before you can comment on or make changes to this bug.
Description G.Wolfe Woodbury 2020-06-15 22:13:33 UTC
My long pending problems with ruby are continuing.  Now that ruby24 is going EOL, ruby25 is failing to install more than the documents into the image/ build dir, and thus failing to build the other dependencies (e.g. rubygems) when doing an "emerge dev-lang/ruby:2.5"

I attach all the evidence I have: emerge --info; build logs

Reproducible: Always

Steps to Reproduce:
1. fresh Gentoo stage3 install
2. emerge dev-lang/ruby-2.5.8

Actual Results:  
fails after installing dev-lang/ruby on the dev-ruby/rubygems step

Expected Results:  
should have continued with rubygems normally
Comment 1 G.Wolfe Woodbury 2020-06-15 22:16:57 UTC
Created attachment 644938 [details]
build log for ruby-2.5.8
Comment 2 G.Wolfe Woodbury 2020-06-15 22:17:52 UTC
Created attachment 644940 [details]
emerge --info
Comment 3 G.Wolfe Woodbury 2020-06-15 22:21:21 UTC
Created attachment 644942 [details]
build log for dev-ruby/rubygems-2.7.10
Comment 4 G.Wolfe Woodbury 2020-06-15 22:23:38 UTC
I looked at the jemalloc flag, and the build is '--without-jemalloc'
Comment 5 Hans de Graaff gentoo-dev Security 2020-07-05 07:40:14 UTC
It looks to me that the real issue here is that dev-lang/ruby does not install properly. In the build log for dev-lang/ruby:2.5 that you removed it does show that only a few doc files are installed and consequently eselect-ruby cannot set the ruby interpreter. This also causes $RUBY to be unset.

It's not clear to me why dev-lang/ruby does not install more files, and I cannot reproduce it.
Comment 6 MT 2021-10-12 18:20:27 UTC
I was hit by this bug when upgrading to dev-lang/ruby-2.7.4, and after a few days of testing I have pinned down a way to easily reproduce the behaviour:

Steps to reproduce:

1. Install the Gentoo base system¹ in a dedicated chroot (or systemd-nspawn's machine);
2. upgrade the world (emerge -auUDN @world)
3. MAKEOPTS="-Oline" emerge -1av --quiet-build=n --fail-clean=n dev-lang/ruby:2.7

Ruby's build system is tripping on the 'make' flag "-Oline". Apparently, Ruby's build system passes the content of MAKEOPTS to its internal sub-processes (--mflag) and that influences what is going to be compiled/installed. Some 'make' flags can drastically alter that specific output, leading to a non deterministic compilation/installation, hence the bizarre behaviour.

What I could not determine is if this behaviour is a bug within the Ruby's build system, or if it is the consequence of some helper function from Portage that somehow wrongly parses/invokes 'make' during the ebuild phases (there is an invokation of "make -f" in src_install which is suspicious), or a mix of the two. I suppose I can leave that as an exercise to the ebuild maintainers.

Removing any flags from MAKEOPTS, except for -j and -l, fixed the issue and the compilation proceeded as expected.

[1]: https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Base
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-04-10 04:58:37 UTC
Thanks for the analysis. CCing xxc3ncoredxx as they're interested in this topic (Make output synchronisation).

There's two bugs here:
1. The misbehaviour with -Oline
2. Not detecting when dev-lang/ruby installs insufficient files immediately in its ebuild
Comment 8 Larry the Git Cow gentoo-dev 2023-04-10 08:21:27 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e86df55fc08f6fb8ececc9001e9f25187b8d3eff

commit e86df55fc08f6fb8ececc9001e9f25187b8d3eff
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-04-10 08:16:19 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-04-10 08:20:29 +0000

    dev-lang/ruby: filter out -Oline from MAKEOPTS, GNUMAKEFLAGS
    
    Sorry for another revbump in such a short period (although maybe it's not so
    bad given very few people will have upgraded yet).
    
    Newer Portage sets GNUMAKEFLAGS="--output-sync=line" if MAKEOPTS is unset. It looks
    like this sometimes leads to Ruby installing no files (or just docs). Filter it out
    and just parse out --jobs and --load-average from MAKEOPTS.
    
    This is behind at least two reports on Bugzilla and possibly another on the
    forums.
    
    Closes: https://bugs.gentoo.org/728424
    Closes: https://bugs.gentoo.org/900929
    Signed-off-by: Sam James <sam@gentoo.org>

 dev-lang/ruby/{ruby-2.7.8-r2.ebuild => ruby-2.7.8-r3.ebuild} | 11 ++++++++++-
 dev-lang/ruby/{ruby-3.0.6-r1.ebuild => ruby-3.0.6-r2.ebuild} | 11 ++++++++++-
 dev-lang/ruby/{ruby-3.1.4-r1.ebuild => ruby-3.1.4-r2.ebuild} | 11 ++++++++++-
 dev-lang/ruby/{ruby-3.2.2-r1.ebuild => ruby-3.2.2-r2.ebuild} | 11 ++++++++++-
 4 files changed, 40 insertions(+), 4 deletions(-)