From: "Eregon (Benoit Daloze) via ruby-core" <ruby-core@...>
Date: 2025-01-29T10:37:20+00:00
Subject: [ruby-core:120822] [Ruby master Bug#21095] Prefer `uname -n` over `hostname` in tests.

Issue #21095 has been updated by Eregon (Benoit Daloze).


> did you read the background context and linked issues?

I have read the linked comment, there is not much else there. I don't have time to read other issues like https://gitlab.archlinux.org/archlinux/packaging/packages/filesystem/-/issues/7 which seem little related.

Correct me if I'm wrong, but my understanding is Arch doesn't want to ship inetutils in core/by default anymore.
But I assume that `inetutils` would still be possible to install (just not installed by default), right?
And I guess in their CI they noticed the CRuby tests (specifically ruby/spec) doesn't pass without `hostname`.
The only way to fix their CI fast and for existing CRuby releases is to add `inetutils` (or some other impl of `hostname`, if both Debian and Fedora probably there is a good reason to do it, I would think ruby/spec is hardly the only usage) as a test dependency of the Arch ruby package.
Have they done that?
If yes, why do they consider that not enough, are they planning to remove the possibility to install `hostname` on Arch?

In any case backporting here only solves the problem when there is a release of 3.3/3.4, which seems to have very little value if they need to keep `hostname` while running tests until then anyway.

----------------------------------------
Bug #21095: Prefer `uname -n` over `hostname` in tests.
https://bugs.ruby-lang.org/issues/21095#change-111689

* Author: ioquatix (Samuel Williams)
* Status: Closed
* Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: REQUIRED, 3.4: REQUIRED
----------------------------------------
It turns out that `hostname`, while a defacto standard, is not actually a standard in any official sense. On Linux, it's distributed as part of the `inettools` package, and while generally available on other platforms (BSD, Windows, MacOS), it isn't actually part of any standard.

The `uname(1)` system call and `uname(2)` command ARE standardised by POSIX and the Open Group, and are included in most base systems without the need to install extra packages (e.g. `inettools` on Linux).

As such, I was requested by the Arch Linux Ruby maintainer, to prefer using `uname -n` as they would like to drop the dependency on `inettools` which has various issues; see <https://gitlab.archlinux.org/archlinux/packaging/packages/inetutils/-/issues/2#note_211062> for more context and background.

I've been asked if this can be back ported to 3.3 and 3.4 and while it's not strictly a bug, it will reduce friction in the distribution channels, so I'd like to propose that we backport to 3.4 and if possible 3.3 too.



-- 
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/