On Mon, Mar 22, 2021 at 12:59 PM Jun Aruga <jaruga(a)redhat.com> wrote:
> >> This directory is certainly needed for other `io` libraries. There is
> >> more then just io-console.
> > Did you mean the "other `io` libraries" are the other libraries
> > requiring `io-soncole` gem?
>
>
>
https://src.fedoraproject.org/rpms/ruby/blob/rawhide/f/ruby.spec#_1097
>
>
> > Are you thinking about the case where ruby-libs is installed but
> > rubygem-io-console is not installed?
> > But the directories of the rubygem-bigdecimal (`%exclude
> > %{ruby_libdir}/bigdecimal*`), rubygem-irb (`%exclude
> > %{ruby_libdir}/irb*
> > `), and etc are already excluded in the ruby-libs. Why don't we do it
> > for rubygem-io-console too?
> >
> >> This directory could be in theory dropped from rubygem-io-console, but
> >> there is not any benefit IMO. I prefer the rubygem-io-console to be self
> >> contained.
> > I do not understand the "the rubygem-io-console to be self
contained.".
> > Could you explain more about it?
> >
>
> If the libraries I have referred above were e.g. removed or extracted
> into independent gems, then the `io` directory could become unowned.
> That is not good. It is much better if it is owned twice.
Ah OK. The other "io" libraries `io/nonblock.so` and `io/wait.so`
should not belong in the io-console.
```
%{ruby_libarchdir}/io/nonblock.so
%{ruby_libarchdir}/io/wait.so
```
```
%{ruby_libarchdir}/io/console.so
```
I see the source files are in the io directory.
```
$ find . -name nonblock.c
./ext/io/nonblock/nonblock.c
$ find . -name wait.c
./ext/io/wait/wait.c
$ find . -name console.c
./ext/io/console/console.c
```
How about just removing the `%{ruby_libdir}/io` in rubygem-io-console
like this with a comment?
The directory actually always exists because ruby-libs are required to
run rubygem-io-console.
```
$ git diff
diff --git a/ruby.spec b/ruby.spec
index c43fb0a..6949ea7 100644
--- a/ruby.spec
+++ b/ruby.spec
@@ -1261,7 +1261,7 @@ MSPECOPTS=""
%{gem_dir}/specifications/bigdecimal-%{bigdecimal_version}.gemspec
%files -n rubygem-io-console
-%{ruby_libdir}/io
+# The %%{ruby_libdir}/io exists in ruby-libs.
%{ruby_libarchdir}/io/console.so
%{_libdir}/gems/%{name}/io-console-%{io_console_version}
%{gem_dir}/gems/io-console-%{io_console_version}
```
--
Jun | He - His - Him