Ruby 2.2
by Vít Ondruch
Hi everybody,
Since Ruby 2.2 is going to be released during Christmas and -preview1
release is imminent (this Wednesday?), it is probably time to start
looking into its packaging. So here is the updated .spec file [1] and
scratch build [2], which can be finally build on all platforms. Sorry,
no Copr for you, since Ruby's build fails there due to old RHEL kernel :/.
What has changed from packaging point of view? Luckily, not much, but
here are a few bullets which comes to my mind:
* RPM 4.12 introduces new %load function, which is used to load RPM
macros during RPM build. This allowed to drop my custom RPM macro [3].
On the other hand, you'll be able to build the Ruby only on F21+
(luckily, you should be able to build SRPM everywhere).
* The RubyGems filesystem was not explicit enough, so there might be
something accidentally packages. This is now more explicit, so we should
be safer.
* Ruby now ships with MiniTest and Test::Unit. The very good news is
that they are installed so far as a regular gems. This means that you
have to always specify them in your Gemfile, if you are using Bundler,
but this is generally step in good direction. I hope that upstream will
not change their mind :) Due to this change, we have new subpackages
rubygem-test-unit (and rubygem-power_assert, which is now Test::Unit's
dependency). No more %{_bindir}/testrb (but nobody is using it these
days anyway, right? ;)
* Some prevailing test failures were resolved, some others introduced,
but hopefully they'll get resolved prior stable release.
Generally, I'd say that not much has changed since 2.1, which is good news.
Please test the packaging if you can and let me know about any issues
you encountered.
Also, if you have any other suggestions about Ruby packaging in general,
what we could improve etc, this is probably good time to share. It seems
that OpenSUSE guys are improving their packaging, so you might want to
get some inspiration there [4, 5, 6] ;)
Vít
[1] http://pkgs.fedoraproject.org/cgit/ruby.git/log/?h=private-ruby-2.2
[2] http://koji.fedoraproject.org/koji/taskinfo?taskID=7578843
[3]
http://pkgs.fedoraproject.org/cgit/ruby.git/commit/?h=private-ruby-2.2&id...
[4] https://build.opensuse.org/package/show/home:darix:ruby/ruby-common
[5] https://build.opensuse.org/package/show/home:darix:ruby/ruby2.2
[6] https://github.com/openSUSE/gem2rpm/commits/master
2 months, 1 week
Re: F35 Change proposal: RPM 4.17 (System-Wide Change proposal)
by Mamoru TASAKA
Hello:
Miro Hrončok wrote on 2021/04/01 6:45:
> On 31. 03. 21 21:52, Ben Cotton wrote:
>> * Strict checking for unpackaged content in builds
> > ...
>> * Many existing packages will fail to build due to the stricter
>> buildroot content checking. Fixing this in the packaging is always
>> backwards compatible. We could temporarily set
>> `%_unpackaged_files_terminate_build 0` in rawhide to alleviate initial
>> impact if necessary.
>
> This is my main concern with this update.
>
> tl;dr If you %exclude something and there is no other subpackage to own the files, the build fails:
>
>
> This fails:
>
> %install
> ...
> touch %{buildroot}/foo %{buildroot}/bar
>
> %files
> /
> %exclude /foo
As the files Miro has attached shows, this affects not a few rubygems related
packages. Many rubygems related packages has: %exclude %gem_cache .
Regards,
Mamoru
2 years, 8 months
Ruby errors/warnings by rpmlint
by Jun Aruga
Hi,
I checked the latest rawhide ruby ruby-3.0.0-146.fc35 by rpmlint, and
I found some errors and warnings to fix.
## Summary
I think the following 4 errors or warnings especially can be fixed.
```
ruby.spec:20: E: use-of-RPM_SOURCE_DIR
ruby-default-gems.noarch: W: summary-ended-with-dot C Default gems
which are part of Ruby StdLib.
ruby-libs.x86_64: E: missing-call-to-chdir-with-chroot
/usr/lib64/libruby.so.3.0.0
ruby-libs.x86_64: W: dangling-symlink /usr/share/ruby/io
/usr/share/gems/gems/io-console-0.5.6/lib/io
```
There are also other ones too.
## Steps to check by rpmlint
```
$ rpm -q rpmlint
rpmlint-1.11-15.fc33.noarch
$ rpmlint ruby.spec /path/to/result/*.rpm >& lint.log
$ rpmlint -i ruby.spec /path/to/result/*.rpm >& lint_detail.log
```
## Result
### 1.
ruby.spec:20: E: use-of-RPM_SOURCE_DIR
You use $RPM_SOURCE_DIR or %{_sourcedir} in your spec file. If you have to use
a directory for building, use $RPM_BUILD_ROOT instead.
=>
The `%{_sourcedir}/%{ruby_archive}.tar.xz` can be replaced to
`%{SOURCE0}`? I am not sure.
### 2.
ruby-default-gems.noarch: W: summary-ended-with-dot C Default gems
which are part of Ruby StdLib.
Summary ends with a dot.
=>
The summary ending dot needs to be removed.
### 3.
ruby-libs.x86_64: E: missing-call-to-chdir-with-chroot
/usr/lib64/libruby.so.3.0.0
This executable appears to call chroot without using chdir to change the
current directory. This is likely an error and permits an attacker to break
out of the chroot by using fchdir. While that's not always a security issue,
this has to be checked.
=>
Not sure when this error came.
### 4.
ruby-libs.x86_64: W: dangling-symlink /usr/share/ruby/io
/usr/share/gems/gems/io-console-0.5.6/lib/io
The target of the symbolic link does not exist within this package or its file
based dependencies. Verify spelling of the link target and that the target is
included in a package in this package's dependency chain.
=>
This warning was a hint to find "another issue" to fix.
The issue is the directory entry `%{ruby_libdir}/io` is duplicated
between ruby-libs and rubygem-io-console RPM in ruby.spec.
Maybe the directory entry in ruby-libs should be removed like this.
```
@@ -942,6 +942,7 @@ MSPECOPTS=""
# Platform independent libraries.
%dir %{ruby_libdir}
%exclude %{ruby_libdir}/bigdecimal*
+%exclude %{ruby_libdir}/io
%exclude %{ruby_libdir}/irb*
%exclude %{ruby_libdir}/json*
%exclude %{ruby_libdir}/psych*
@@ -964,7 +965,6 @@ MSPECOPTS=""
%{ruby_libdir}/find.rb
%{ruby_libdir}/forwardable*
%{ruby_libdir}/getoptlong*
-%{ruby_libdir}/io
%{ruby_libdir}/ipaddr.rb
%{ruby_libdir}/kconv.rb
%{ruby_libdir}/logger*
```
### 5.
```
ruby-default-gems.noarch: W: obsolete-not-provided rubygem-did_you_mean
If a package is obsoleted by a compatible replacement, the obsoleted package
should also be provided in order to not cause unnecessary dependency breakage.
If the obsoleting package is not a compatible replacement for the old one,
leave out the Provides.
ruby-default-gems.noarch: W: obsolete-not-provided rubygem-openssl
If a package is obsoleted by a compatible replacement, the obsoleted package
should also be provided in order to not cause unnecessary dependency breakage.
If the obsoleting package is not a compatible replacement for the old one,
leave out the Provides.
ruby-default-gems.noarch: W: obsolete-not-provided rubygem-racc
If a package is obsoleted by a compatible replacement, the obsoleted package
should also be provided in order to not cause unnecessary dependency breakage.
If the obsoleting package is not a compatible replacement for the old one,
leave out the Provides.
```
=>
The Provides line needs for the Obsolete line.
### 6.
```
rubygem-rbs.noarch: E: non-executable-script
/usr/share/gems/gems/rbs-1.0.0/bin/annotate-with-rdoc 644 /usr/bin/env
ruby
This text file contains a shebang or is located in a path dedicated for
executables, but lacks the executable bits and cannot thus be executed. If
the file is meant to be an executable script, add the executable bits,
otherwise remove the shebang or move the file elsewhere.
```
This is the same for other files (total 8 files) under
/usr/share/gems/gems/rbs-1.0.0/bin/.
### 7.
```
ruby-libs.x86_64: W: library-not-linked-against-libc
/usr/lib64/ruby/continuation.so
ruby-libs.x86_64: W: library-not-linked-against-libc /usr/lib64/ruby/enc/big5.so
...
```
=> I may remember this warning happened for 1 so file in Ruby 2.7 last
year. Now I see it for the many so files.
### 8.
non-executable-script errors.
=> Some parts are nice to fix.
## rpms/ruby CI to add rpmlint test.
Can we check the rpmlint issues on an early timing: pull-request and push?
I think adding the rpmlint check ro rpm/ruby CI is a possible way
related to this ticket.
https://src.fedoraproject.org/rpms/ruby/pull-request/67
Shall we add it after the PR #67 will be merged?
--
Jun | He - His - Him
2 years, 8 months