ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: "hsbt (Hiroshi SHIBATA) via ruby-core" <ruby-core@ml.ruby-lang.org>
To: ruby-core@ml.ruby-lang.org
Cc: "hsbt (Hiroshi SHIBATA)" <noreply@ruby-lang.org>
Subject: [ruby-core:119447] [Ruby master Bug#20783] --enable-shared and the rpath/runpath are broken on Linux on CRuby master
Date: Fri, 04 Oct 2024 10:08:53 +0000 (UTC)	[thread overview]
Message-ID: <redmine.journal-110066.20241004100852.772@ruby-lang.org> (raw)
In-Reply-To: <redmine.issue-20783.20241004092045.772@ruby-lang.org>

Issue #20783 has been updated by hsbt (Hiroshi SHIBATA).

Status changed from Open to Assigned
Assignee set to nobu (Nobuyoshi Nakada)

----------------------------------------
Bug #20783: --enable-shared and the rpath/runpath are broken on Linux on CRuby master
https://bugs.ruby-lang.org/issues/20783#change-110066

* Author: Eregon (Benoit Daloze)
* Status: Assigned
* Assignee: nobu (Nobuyoshi Nakada)
* Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN
----------------------------------------
https://github.com/ruby/ruby-dev-builder/actions/runs/11095200420
```
$ ruby test_files/cli_test.rb
ruby: error while loading shared libraries: libruby.so.3.4: cannot open shared object file: No such file or directory
```

And indeed locally I can confirm it's broken (I use ruby-build for convenience, as you can see it just does a bunch of regular build commands):
```
$ RUBY_CONFIGURE_OPTS=--enable-shared ruby-build ruby-dev -d ~/.rubies   
==> Cloning https://github.com/ruby/ruby.git...
-> git clone --depth 1 --branch master https://github.com/ruby/ruby.git ruby-master
...
==> Installing ruby-master...
-> autoreconf -i
-> ./configure "--prefix=$HOME/.rubies/ruby-dev" --enable-shared
-> make -j 16
-> make update-gems extract-gems install
==> Installed ruby-master to /home/eregon/.rubies/ruby-dev
```

And that build with `--enable-shared` is not working, same as on GitHub Actions:
```
$ /home/eregon/.rubies/ruby-dev/bin/ruby -v
/home/eregon/.rubies/ruby-dev/bin/ruby: error while loading shared libraries: libruby.so.3.4: cannot open shared object file: No such file or directory

$ ldd /home/eregon/.rubies/ruby-dev/bin/ruby
	linux-vdso.so.1 (0x00007fff9018c000)
	libruby.so.3.4 => not found
	libz.so.1 => /lib64/libz.so.1 (0x00007f4c8d928000)
	libcrypt.so.2 => /lib64/libcrypt.so.2 (0x00007f4c8d8ef000)
	libm.so.6 => /lib64/libm.so.6 (0x00007f4c8d80e000)
	libc.so.6 => /lib64/libc.so.6 (0x00007f4c8d62c000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f4c8d95e000)

$ readelf -d /home/eregon/.rubies/ruby-dev/bin/ruby

Dynamic section at offset 0x2db8 contains 29 entries:
  Tag        Type                         Name/Value
 0x0000000000000001 (NEEDED)             Shared library: [libruby.so.3.4]
 0x0000000000000001 (NEEDED)             Shared library: [libz.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libcrypt.so.2]
 0x0000000000000001 (NEEDED)             Shared library: [libm.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 0x000000000000001d (RUNPATH)            Library runpath: [/home/eregon/.rubies/ruby-dev/lib-L/home/eregon/.rubies/ruby-dev/lib]
...
```

@hsbt said he remembers https://github.com/ruby/ruby/commit/1f6d2e77d9be9a5a829e60908d21d621f4e1ceb0 changed something in this area which might be the cause.

Once this is fixed we should also revert https://github.com/ruby/docker-images/pull/107.



-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/

  parent reply	other threads:[~2024-10-04 10:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-04  9:20 [ruby-core:119444] " Eregon (Benoit Daloze) via ruby-core
2024-10-04  9:40 ` [ruby-core:119445] " Eregon (Benoit Daloze) via ruby-core
2024-10-04  9:57 ` [ruby-core:119446] " nobu (Nobuyoshi Nakada) via ruby-core
2024-10-04 10:08 ` hsbt (Hiroshi SHIBATA) via ruby-core [this message]
2024-10-08  6:50 ` [ruby-core:119480] " hsbt (Hiroshi SHIBATA) via ruby-core

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=redmine.journal-110066.20241004100852.772@ruby-lang.org \
    --to=ruby-core@ml.ruby-lang.org \
    --cc=noreply@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).