Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1901306 - Review Request: tlpi - Utilities to display namespaces and control groups
Summary: Review Request: tlpi - Utilities to display namespaces and control groups
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Petr Menšík
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-11-24 19:49 UTC by Göran Uddeborg
Modified: 2023-01-31 20:42 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-01-31 20:42:15 UTC
Type: ---
Embargoed:
pemensik: fedora-review+


Attachments (Terms of Use)

Description Göran Uddeborg 2020-11-24 19:49:55 UTC
Spec URL: ftp://ftp.uddeborg.se/pub/tlpi/tlpi.spec
SRPM URL: ftp://ftp.uddeborg.se/pub/tlpi/tlpi-201025-1.fc33.src.rpm
Description:
The book The Linux Programming Interface and training courses given by
man7.org are accompanied with a set of code examples. Some of these
examples are useful in their own right. This package includes the
following utilities.
- pid_namespaces  Show the PID namespace hierarchy.
- namespace_of	  Show the namespace memberships of one or more processes
		  in the context of the user or PID namespace
		  hierarchy. See the bundled source code for further
		  documentation.
- userns_overview Display a hierarchical view of the user namespaces
		  on the system along with the member processes for
		  each namespace.
- view_v2_cgroups Display one or more subtrees in the cgroups v2
		  hierarchy. The following info is displayed for each
		  cgroup: the cgroup type, the controllers enabled in
		  the cgroup, and the process and thread members of
		  the cgroup.


Fedora Account System Username: goeran

Comment 1 Sheng Mao 2020-12-07 03:46:45 UTC
> %doc namespaces/namespaces_of.go

Why not also pack the source code of the other three go files?

Comment 2 Göran Uddeborg 2020-12-07 16:41:28 UTC
As indicated in the %description, in the beginning of namespaces_of.go there is a comment which could be useful for the end user. For the other programs the corresponding explanations are much shorter, short enough I could include it in extenso in the package description.

Comment 3 Göran Uddeborg 2021-03-25 21:56:43 UTC
Updated version for Fedora 34, now including an explicit build requirement on gcc-go.
SPEC: ftp://ftp.uddeborg.se/pub/tlpi/tlpi-2.spec
SRPM: ftp://ftp.uddeborg.se/pub/tlpi/tlpi-201025-2.fc34.src.rpm

Comment 4 Package Review 2022-03-26 00:45:17 UTC
This is an automatic check from review-stats script.

This review request ticket hasn't been updated for some time. We're sorry
it is taking so long. If you're still interested in packaging this software
into Fedora repositories, please respond to this comment clearing the
NEEDINFO flag.

You may want to update the specfile and the src.rpm to the latest version
available and to propose a review swap on Fedora devel mailing list to increase
chances to have your package reviewed. If this is your first package and you
need a sponsor, you may want to post some informal reviews. Read more at
https://fedoraproject.org/wiki/How_to_get_sponsored_into_the_packager_group.

Without any reply, this request will shortly be considered abandoned
and will be closed.
Thank you for your patience.

Comment 5 Göran Uddeborg 2022-03-28 16:09:22 UTC
Updated versions with the most recent upstreams sources:

Spec: ftp://ftp.uddeborg.se/pub/tlpi/tlpi-3.spec
SRPM: ftp://ftp.uddeborg.se/pub/tlpi/tlpi-220211-1.fc36.src.rpm

Only some minor modifications were made in the update to the programs included in this Fedora package.

Comment 6 Göran Uddeborg 2022-07-28 21:05:34 UTC
In case anyone would like to use these programs, I've made the package available via copr: https://copr.fedorainfracloud.org/coprs/goeran/tlpi/

Comment 7 Petr Menšík 2023-01-18 21:28:40 UTC
It would help if you used http:// for pointing to those URL. It seems fedora-review tool is not able to download those files from FTP anymore.

Comment 8 Petr Menšík 2023-01-18 22:17:06 UTC
Package Review
==============

Legend:
[x] = Pass, [!] = Fail, [-] = Not applicable, [?] = Not evaluated
[ ] = Manual review needed


Issues:
=======
- If your application is a C or C++ application you must list a
  BuildRequires against gcc, gcc-c++ or clang.
  Note: No gcc, gcc-c++ or clang found in BuildRequires
  See: https://docs.fedoraproject.org/en-US/packaging-guidelines/C_and_C++/


===== MUST items =====

C/C++:
[x]: Package does not contain kernel modules.
[x]: Package contains no static executables.
[x]: Package does not contain any libtool archives (.la)
[x]: Rpath absent or only used for internal libs.

Generic:
[x]: Package is licensed with an open-source compatible license and meets
     other legal requirements as defined in the legal section of Packaging
     Guidelines.
[x]: License field in the package spec file matches the actual license.
     Note: Checking patched sources after %prep for licenses. Licenses
     found: "Unknown or generated", "GNU Affero General Public License
     v3.0", "GNU Lesser General Public License, Version 3", "*No copyright*
     GNU Lesser General Public License, Version 3 GNU General Public
     License, Version 3", "GNU General Public License v3.0 or later", "GNU
     Lesser General Public License v3.0 or later", "GNU General Public
     License v2.0 or later", "GNU General Public License v3.0 or later GNU
     General Public License v2.0 or later". 75 files have unknown license.
     Detailed output of licensecheck in
     /home/pemensik/fedora/rawhide/review-tlpi/licensecheck.txt
[x]: License file installed when any subpackage combination is installed.
[x]: %build honors applicable compiler flags or justifies otherwise.
[x]: Package contains no bundled libraries without FPC exception.
[x]: Changelog in prescribed format.
[x]: Sources contain only permissible code or content.
[-]: Package contains desktop file if it is a GUI application.
[-]: Development files must be in a -devel package
[x]: Package uses nothing in %doc for runtime.
[x]: Package consistently uses macros (instead of hard-coded directory
     names).
[x]: Package is named according to the Package Naming Guidelines.
[x]: Package does not generate any conflict.
[x]: Package obeys FHS, except libexecdir and /usr/target.
[-]: If the package is a rename of another package, proper Obsoletes and
     Provides are present.
[x]: Requires correct, justified where necessary.
[x]: Spec file is legible and written in American English.
[x]: Package contains systemd file(s) if in need.
[x]: Useful -debuginfo package or justification otherwise.
[x]: Package is not known to require an ExcludeArch tag.
[x]: Large documentation must go in a -doc subpackage. Large could be size
     (~1MB) or number of files.
     Note: Documentation size is 40960 bytes in 1 files.
[x]: Package complies to the Packaging Guidelines
[x]: Package successfully compiles and builds into binary rpms on at least
     one supported primary architecture.
[x]: Package installs properly.
[x]: Rpmlint is run on all rpms the build produces.
     Note: There are rpmlint messages (see attachment).
[x]: If (and only if) the source package includes the text of the
     license(s) in its own file, then that file, containing the text of the
     license(s) for the package is included in %license.
[x]: Package requires other packages for directories it uses.
[x]: Package must own all directories that it creates.
[x]: Package does not own files or directories owned by other packages.
[x]: Package uses either %{buildroot} or $RPM_BUILD_ROOT
[x]: Package does not run rm -rf %{buildroot} (or $RPM_BUILD_ROOT) at the
     beginning of %install.
[x]: Macros in Summary, %description expandable at SRPM build time.
[x]: Dist tag is present.
[x]: Package does not contain duplicates in %files.
[x]: Permissions on files are set properly.
[x]: Package must not depend on deprecated() packages.
[x]: Package use %makeinstall only when make install DESTDIR=... doesn't
     work.
[x]: Package is named using only allowed ASCII characters.
[x]: Package does not use a name that already exists.
[x]: Package is not relocatable.
[x]: Sources used to build the package match the upstream source, as
     provided in the spec URL.
[x]: Spec file name must match the spec package %{name}, in the format
     %{name}.spec.
[x]: File names are valid UTF-8.
[x]: Packages must not store files under /srv, /opt or /usr/local

===== SHOULD items =====

Generic:
[-]: If the source package does not include license text(s) as a separate
     file from upstream, the packager SHOULD query upstream to include it.
[x]: Final provides and requires are sane (see attachments).
[?]: Package functions as described.
[!]: Latest version is packaged.
[x]: Package does not include license text files separate from upstream.
[-]: Sources are verified with gpgverify first in %prep if upstream
     publishes signatures.
     Note: gpgverify is not used.
[x]: Package should compile and build into binary rpms on all supported
     architectures.
[-]: %check is present and all tests pass.
[x]: Packages should try to preserve timestamps of original installed
     files.
[x]: Reviewer should test that the package builds in mock.
[x]: Buildroot is not present
[x]: Package has no %clean section with rm -rf %{buildroot} (or
     $RPM_BUILD_ROOT)
[x]: No file requires outside of /etc, /bin, /sbin, /usr/bin, /usr/sbin.
[x]: Fully versioned dependency in subpackages if applicable.
[x]: Packager, Vendor, PreReq, Copyright tags should not be in spec file
[x]: Sources can be downloaded from URI in Source: tag
[x]: SourceX is a working URL.
[x]: Spec use %global instead of %define unless justified.

===== EXTRA items =====

Generic:
[x]: Rpmlint is run on debuginfo package(s).
     Note: No rpmlint messages.
[x]: Rpmlint is run on all installed packages.
     Note: There are rpmlint messages (see attachment).
[x]: Large data in /usr/share should live in a noarch subpackage if package
     is arched.
[x]: Spec file according to URL is the same as in SRPM.


Rpmlint
-------
Checking: tlpi-220211-1.fc38.x86_64.rpm
          tlpi-debuginfo-220211-1.fc38.x86_64.rpm
          tlpi-debugsource-220211-1.fc38.x86_64.rpm
          tlpi-220211-1.fc38.src.rpm
============================================================= rpmlint session starts =============================================================
rpmlint: 2.4.0
configuration:
    /usr/lib/python3.10/site-packages/rpmlint/configdefaults.toml
    /etc/xdg/rpmlint/fedora-legacy-licenses.toml
    /etc/xdg/rpmlint/fedora-spdx-licenses.toml
    /etc/xdg/rpmlint/fedora.toml
    /etc/xdg/rpmlint/scoring.toml
    /etc/xdg/rpmlint/users-groups.toml
    /etc/xdg/rpmlint/warn-on-functions.toml
rpmlintrc: [PosixPath('/tmp/tmpdk2o1jmo')]
checks: 31, packages: 4

tlpi.x86_64: W: position-independent-executable-suggested /usr/bin/namespaces_of
tlpi.x86_64: W: position-independent-executable-suggested /usr/bin/pid_namespaces
tlpi.x86_64: W: position-independent-executable-suggested /usr/bin/userns_overview
tlpi.x86_64: W: position-independent-executable-suggested /usr/bin/view_v2_cgroups
tlpi.x86_64: W: no-manual-page-for-binary namespaces_of
tlpi.x86_64: W: no-manual-page-for-binary pid_namespaces
tlpi.x86_64: W: no-manual-page-for-binary userns_overview
tlpi.x86_64: W: no-manual-page-for-binary view_v2_cgroups
============================== 4 packages and 0 specfiles checked; 0 errors, 8 warnings, 0 badness; has taken 0.7 s ==============================




Rpmlint (debuginfo)
-------------------
Checking: tlpi-debuginfo-220211-1.fc38.x86_64.rpm
============================================================= rpmlint session starts =============================================================
rpmlint: 2.4.0
configuration:
    /usr/lib/python3.10/site-packages/rpmlint/configdefaults.toml
    /etc/xdg/rpmlint/fedora-legacy-licenses.toml
    /etc/xdg/rpmlint/fedora-spdx-licenses.toml
    /etc/xdg/rpmlint/fedora.toml
    /etc/xdg/rpmlint/scoring.toml
    /etc/xdg/rpmlint/users-groups.toml
    /etc/xdg/rpmlint/warn-on-functions.toml
rpmlintrc: [PosixPath('/tmp/tmp1yth827b')]
checks: 31, packages: 1

============================== 1 packages and 0 specfiles checked; 0 errors, 0 warnings, 0 badness; has taken 0.2 s ==============================





Rpmlint (installed packages)
----------------------------
============================ rpmlint session starts ============================
rpmlint: 2.4.0
configuration:
    /usr/lib/python3.11/site-packages/rpmlint/configdefaults.toml
    /etc/xdg/rpmlint/fedora-legacy-licenses.toml
    /etc/xdg/rpmlint/fedora-spdx-licenses.toml
    /etc/xdg/rpmlint/fedora.toml
    /etc/xdg/rpmlint/scoring.toml
    /etc/xdg/rpmlint/users-groups.toml
    /etc/xdg/rpmlint/warn-on-functions.toml
checks: 31, packages: 3

tlpi.x86_64: W: unused-direct-shlib-dependency /usr/bin/namespaces_of /lib64/libm.so.6
tlpi.x86_64: W: unused-direct-shlib-dependency /usr/bin/pid_namespaces /lib64/libm.so.6
tlpi.x86_64: W: unused-direct-shlib-dependency /usr/bin/userns_overview /lib64/libm.so.6
tlpi.x86_64: W: unused-direct-shlib-dependency /usr/bin/view_v2_cgroups /lib64/libm.so.6
tlpi.x86_64: W: position-independent-executable-suggested /usr/bin/namespaces_of
tlpi.x86_64: W: position-independent-executable-suggested /usr/bin/pid_namespaces
tlpi.x86_64: W: position-independent-executable-suggested /usr/bin/userns_overview
tlpi.x86_64: W: position-independent-executable-suggested /usr/bin/view_v2_cgroups
tlpi.x86_64: W: no-manual-page-for-binary namespaces_of
tlpi.x86_64: W: no-manual-page-for-binary pid_namespaces
tlpi.x86_64: W: no-manual-page-for-binary userns_overview
tlpi.x86_64: W: no-manual-page-for-binary view_v2_cgroups
 3 packages and 0 specfiles checked; 0 errors, 12 warnings, 0 badness; has taken 1.4 s 



Source checksums
----------------
https://man7.org/tlpi/code/download/tlpi-220211-dist.tar.gz :
  CHECKSUM(SHA256) this package     : f57f0b1c759319411a656410c7abb92d104daf3e1c23793fc606f922eb9dab7d
  CHECKSUM(SHA256) upstream package : f57f0b1c759319411a656410c7abb92d104daf3e1c23793fc606f922eb9dab7d


Requires
--------
tlpi (rpmlib, GLIBC filtered):
    ld-linux-x86-64.so.2()(64bit)
    libc.so.6()(64bit)
    libgcc_s.so.1()(64bit)
    libgcc_s.so.1(GCC_3.0)(64bit)
    libgcc_s.so.1(GCC_3.3.1)(64bit)
    libgo.so.22()(64bit)
    libm.so.6()(64bit)
    rtld(GNU_HASH)

tlpi-debuginfo (rpmlib, GLIBC filtered):

tlpi-debugsource (rpmlib, GLIBC filtered):



Provides
--------
tlpi:
    tlpi
    tlpi(x86-64)

tlpi-debuginfo:
    debuginfo(build-id)
    tlpi-debuginfo
    tlpi-debuginfo(x86-64)

tlpi-debugsource:
    tlpi-debugsource
    tlpi-debugsource(x86-64)



Generated by fedora-review 0.9.0 (6761b6c) last change: 2022-08-23
Command line :/usr/bin/fedora-review --name tlpi
Buildroot used: fedora-rawhide-x86_64
Active plugins: Generic, C/C++, Shell-api
Disabled plugins: Haskell, Python, Ocaml, Perl, Java, SugarActivity, fonts, R, PHP
Disabled flags: EPEL6, EPEL7, DISTTAG, BATCH, EXARCH

Comment 9 Petr Menšík 2023-01-18 22:52:50 UTC
I have passed the review.

Since the core of tlpi distribution is large collection of code examples, I think it would make sense to export also BuildArch: noarch subpackage containing the code as documentation (%doc), perhaps in %_datadir/%{name}/examples directory. Easy way to install and read those examples by package manager would be nice I think. It would be possible to downloading them from srpm, but that is not so user friendly.

I might be at least compiled in %check phase. There are some examples not compiling on my system, but most of them can be compiled. Would it make sense to make those examples installable as a package too?

For example installing ./cap/show_secbits binary to /usr/bin/tlpi-cap-show_secbits executable. Of course those should be in separate subpackage, because most people would not need them. But since they are included, why not building them?

I have made useful list with simple command:
make all
find * -type f -executable | while read F; do DN=$(dirname -- "$F"); BN=$(basename -- "$F"); echo install $F %{_bindir}/tlpi-$DN-$BN; done

It might be part of tlpi-examples-bin or something similar. Would that make sense?

Comment 10 Petr Menšík 2023-01-18 23:05:38 UTC
Now I see they just need some dependencies. Even better reason to have it as package, which would Recommends: required devel packages, gcc and make.
Explained on https://man7.org/tlpi/code/faq.html

Used following diff to skip broken examples:

diff --git a/acl/Makefile b/acl/Makefile
index ef35fae..68748c3 100644
--- a/acl/Makefile
+++ b/acl/Makefile
@@ -2,7 +2,8 @@ include ../Makefile.inc
 
 GEN_EXE = 
 
-LINUX_EXE = acl_update acl_view
+# Both are broken
+LINUX_EXE = #acl_update acl_view
 
 EXE = ${GEN_EXE} ${LINUX_EXE}
 
diff --git a/signals/Makefile b/signals/Makefile
index 8b70f0e..3568525 100644
--- a/signals/Makefile
+++ b/signals/Makefile
@@ -1,10 +1,11 @@
 include ../Makefile.inc
 
 GEN_EXE = catch_rtsigs demo_SIGFPE ignore_pending_sig intquit \
-       nonreentrant nonatomic_uint64 \
+       nonreentrant  \
        ouch sig_receiver sig_sender sig_speed_sigsuspend \
        sigmask_longjmp sigmask_siglongjmp \
        t_kill t_sigaltstack t_sigsuspend t_sigqueue t_sigwaitinfo
+# Broken: nonatomic_uint64
 
 LINUX_EXE = signalfd_sigval

Comment 11 Göran Uddeborg 2023-01-19 21:45:29 UTC
Thank you for your review and suggestions. I will consider it all and be back with an updated version as soon as I get some time.

Comment 12 Göran Uddeborg 2023-01-24 22:10:58 UTC
Ok, here is my next try. I have followed your suggestion and made two subpackages "examples" and "examples-bin". I also made a separate package "licenses" for the license files which is required by the other packages.

In addition, all binaries are built position independent now, something which required a bit of patching of some of the Makefiles.

Finally I have upgraded to the most recent upstreams version.

Since this is a significant update since the previous review, not just a few corrections, I welcome you to take a closer look than with most review updates if you wish and have the time. I'll wait asking for a distgit repository until you reply one way or the other.

Updated files can be found under these (https ☺) links:

https://www.uddeborg.se/tlpi/tlpi-4.spec
https://www.uddeborg.se/tlpi/tlpi-221220-1.fc38.src.rpm

Comment 13 Jakub Kadlčík 2023-01-24 22:22:45 UTC
Copr build:
https://copr.fedorainfracloud.org/coprs/build/5288902
(succeeded)

Review template:
https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-1901306-tlpi/fedora-rawhide-x86_64/05288902-tlpi/fedora-review/review.txt

Please take a look if any issues were found.

---
This comment was created by the fedora-review-service
https://github.com/FrostyX/fedora-review-service

Comment 14 Petr Menšík 2023-01-31 10:17:51 UTC
please use %make_build CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" instead of just make to pass default rpm hardening flags to the build. Otherwise it looks good.

and use install -p where possible, it should make unmodified files keep their last modified time.

Otherwise yes, that is how I thought about it. Thanks, looks good to me!

Comment 15 Göran Uddeborg 2023-01-31 16:44:52 UTC
Thank you for the review! I'll do the last changes you suggested and request a repo now.

Comment 16 Fedora Admin user for bugzilla script actions 2023-01-31 16:56:24 UTC
The Pagure repository was created at https://src.fedoraproject.org/rpms/tlpi

Comment 17 Fedora Update System 2023-01-31 20:41:20 UTC
FEDORA-2023-902128f1c5 has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2023-902128f1c5

Comment 18 Fedora Update System 2023-01-31 20:42:15 UTC
FEDORA-2023-902128f1c5 has been pushed to the Fedora 38 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.