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
Created attachment 644938 [details] build log for ruby-2.5.8
Created attachment 644940 [details] emerge --info
Created attachment 644942 [details] build log for dev-ruby/rubygems-2.7.10
I looked at the jemalloc flag, and the build is '--without-jemalloc'
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.
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
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
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(-)