Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 932386 - dev-lang/ruby: hard-codes mkdir path in RbConfig
Summary: dev-lang/ruby: hard-codes mkdir path in RbConfig
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Gentoo Ruby Team
URL:
Whiteboard:
Keywords: PATCH
: 933224 934123 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-05-21 20:19 UTC by hoelbezier
Modified: 2024-06-16 09:06 UTC (History)
4 users (show)

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


Attachments
build.log (build.log,14.71 KB, text/x-log)
2024-05-21 20:19 UTC, hoelbezier
Details
emerge --info '=dev-ruby/msgpack-1.7.2::gentoo' (emerge.info,7.46 KB, text/plain)
2024-05-21 20:20 UTC, hoelbezier
Details
emerge -pqv '=dev-ruby/msgpack-1.7.2::gentoo' (emerge.pqv,96 bytes, text/plain)
2024-05-21 20:21 UTC, hoelbezier
Details

Note You need to log in before you can comment on or make changes to this bug.
Description hoelbezier 2024-05-21 20:19:29 UTC
Created attachment 893685 [details]
build.log

Hi,

on default/linux/amd64/23.0/split-usr profile, dev-ruby/msgpack fails during the install phase with the message:

  make: Entering directory '/tmp/portage/dev-ruby/msgpack-1.7.2/work/ruby31/msgpack-ruby-1.7.2/ext/msgpack'
  /usr/bin/mkdir -p . /tmp/portage/dev-ruby/msgpack-1.7.2/image/usr/lib64/ruby/gems/3.1.0/extensions/x86_64-linux/3.1.0/msgpack-1.7.2/msgpack
  make: /usr/bin/mkdir: No such file or directory

And indeed, mkdir is found at /bin/mkdir and not at /usr/bin/mkdir.

I had this same issue yesterday with other ruby packages but can’t remember which ones and since then some binary packages were released for them and they installed just fine that way.
Comment 1 hoelbezier 2024-05-21 20:20:17 UTC
Created attachment 893686 [details]
emerge --info '=dev-ruby/msgpack-1.7.2::gentoo'
Comment 2 hoelbezier 2024-05-21 20:21:33 UTC
Created attachment 893687 [details]
emerge -pqv '=dev-ruby/msgpack-1.7.2::gentoo'
Comment 3 Hans de Graaff gentoo-dev Security 2024-05-22 07:45:51 UTC
Did you move between merged-usr and split-usr profiles?

You mention binary packages, where they created on a system with /usr/bin/mkdir?

As far as I can tell this path is recorded in /usr/lib64/ruby/3.1.0/x86_64-linux/rbconfig.rb and it should match what is found during configuration.
Comment 4 hoelbezier 2024-05-22 19:57:38 UTC
I did not move between merged-usr and split-usr profiles.

I am using the binary packages advertised here[1]. I was using 17.1 profiles back then, and it may be possible that during the switch to 23.0 the process for building these packages switched from split-usr (the default for 17.1 profiles) to merged-usr (the default for 23.0 profiles).

[1]: https://www.gentoo.org/news/2023/12/29/Gentoo-binary.html
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-05-22 20:07:35 UTC
The binpkgs are built on a 23.0 merged-usr/default machine (by the official builder), but they should work on a split-usr 23.0 system.

We might have to fix some Ruby stuff to hardcode /bin/mkdir instead of relying on a discovered path. We had to do this in a handful of other places.
Comment 6 Hans de Graaff gentoo-dev Security 2024-06-01 08:17:50 UTC
Something like this seems to work (in line with the same mechanism for openbsd above it) but I'm sure this can be done more elegantly. :-) Suggestions welcome.

--- a/configure.ac	2024-05-30 02:23:11.000000000 +0200
+++ b/configure.ac	2024-06-01 10:10:07.602924940 +0200
@@ -519,6 +519,10 @@
     ac_cv_path_mkdir="mkdir"
 ])
 
+AS_CASE(["$target_os"],[*],[
+    ac_cv_path_mkdir="mkdir"
+])
+
 RUBY_PROG_MAKEDIRS
 
 AC_CHECK_PROG([DTRACE], [${ac_tool_prefix}dtrace], [${ac_tool_prefix}dtrace])
Comment 7 Mike Gilbert gentoo-dev 2024-06-02 18:48:39 UTC
*** Bug 933224 has been marked as a duplicate of this bug. ***
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-06-09 14:23:28 UTC
(In reply to Hans de Graaff from comment #6)

We could export it as a cache var in the ebuild instead (if it respects that). Otherwise, LGTM.
Comment 9 Mike Gilbert gentoo-dev 2024-06-12 16:19:10 UTC
*** Bug 934123 has been marked as a duplicate of this bug. ***
Comment 10 Larry the Git Cow gentoo-dev 2024-06-16 09:06:55 UTC
The bug has been referenced in the following commit(s):

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

commit b44b0fcafd19906606035ec71f4f7498e0140999
Author:     Hans de Graaff <graaff@gentoo.org>
AuthorDate: 2024-06-16 09:05:50 +0000
Commit:     Hans de Graaff <graaff@gentoo.org>
CommitDate: 2024-06-16 09:06:37 +0000

    dev-lang/ruby: add 3.3.3
    
    Also avoid a hard-coded path to mkdir in RbConfig.
    
    Bug: https://bugs.gentoo.org/932386
    Signed-off-by: Hans de Graaff <graaff@gentoo.org>

 dev-lang/ruby/Manifest                       |   1 +
 dev-lang/ruby/files/3.3/012-mkdir-path.patch |  13 ++
 dev-lang/ruby/ruby-3.3.3.ebuild              | 294 +++++++++++++++++++++++++++
 3 files changed, 308 insertions(+)