You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Attempting to use ruby-build as an alternative to the terminal Arch Linux Ruby packaging (2y out of date on a rolling distro); and denting my desk and my forehead pretty badly trying to get the options set up correctly. Targeting 3.2.2 - saw in a previous issue/PR relating to DESTDIR= that the Ruby version apparently matters here (at least 1.9/2.x behaved differently). There was a comment about replacing shebang strings in there, but there's ABI linkage as well and i'm a bit concerned that might get broken/left inconsistent if i start messing with paths post-process.
Arch PKGBUILDs generally build in a source tree and then install to a target subtree which is then compressed for decompression (installation) under /. Building Ruby using the package path target results in the full path of the build environment's package path target being written to the resulting files and breaking when run after installation under / (vs /var/abs/packagename/pkg/packagename/). Trying to build with the various RUBY_* env vars set results in a failure to build the gems because that part already expects Ruby to be in the / prefix:
produces the following when built in its own Arch chroot:
Inspect or clean up the working tree at /build/packagename/src/build
Results logged to /tmp/ruby-build.20230819230130.806.log
Last 10 log lines:
net-imap 0.3.4
net-pop 0.1.2
net-smtp 0.3.3
matrix 0.4.2
prime 0.1.2
rbs 2.8.2
typeprof 0.21.3
debug 1.7.1
installing bundled gem cache: /build/packagename/src/ruby-3.2.2/usr/local/lib/ruby/gems/3.2.0/cache
/usr/bin/ruby-build: line 1230: /usr/local/bin/ruby: No such file or directory
==> ERROR: A failure occurred inbuild().
Aborting...
==> Removing chroot copy [/var/abs/chroot/packagename]...done
==> ERROR: Build failed
What is the correct way to use ruby-build by unprivileged builder-users in CI's/containers/chroots/etc to create packages which are to be installed by privileged users on target systems (with the same ABI) later?
The text was updated successfully, but these errors were encountered:
Hi, sorry for the late reply, and thanks for the detailed question.
What is the correct way to use ruby-build by unprivileged builder-users in CI's/containers/chroots/etc to create packages which are to be installed by privileged users on target systems (with the same ABI) later?
So far you were doing everything correctly, but I'm afraid that ruby-build isn't aware of potential DESTDIR use (especially because it was injected via environment variables), and a subsequent step to invoke the just-compiled ruby interpreter step fails because ruby-build wasn't aware that make install placed ruby in a different location. Duplicate of #1415 (comment)
Notice the verify_openssl step. This activates a function where ruby is invoked to verify that openssl and other native extensions were successfully linked:
Then, invoke ruby-build and supply it with a path to your custom definition: ruby-build /path/to/custom-3.2.2 /prefix/path.
I'm open to making ruby-build DESTDIR-compatible, but so far there wasn't a straightforward approach. If you can suggest a better approach, contribution welcome!
Attempting to use
ruby-build
as an alternative to the terminal Arch Linux Ruby packaging (2y out of date on a rolling distro); and denting my desk and my forehead pretty badly trying to get the options set up correctly. Targeting 3.2.2 - saw in a previous issue/PR relating toDESTDIR=
that the Ruby version apparently matters here (at least 1.9/2.x behaved differently). There was a comment about replacing shebang strings in there, but there's ABI linkage as well and i'm a bit concerned that might get broken/left inconsistent if i start messing with paths post-process.Arch PKGBUILDs generally
build
in a source tree and theninstall
to a target subtree which is then compressed for decompression (installation) under/
. Building Ruby using the package path target results in the full path of the build environment's package path target being written to the resulting files and breaking when run after installation under/
(vs/var/abs/packagename/pkg/packagename/
). Trying to build with the variousRUBY_*
env vars set results in a failure to build the gems because that part already expects Ruby to be in the/
prefix:produces the following when built in its own Arch chroot:
What is the correct way to use
ruby-build
by unprivileged builder-users in CI's/containers/chroots/etc to create packages which are to be installed by privileged users on target systems (with the same ABI) later?The text was updated successfully, but these errors were encountered: