Bug 2180989 - Review Request: uftrace - A function (graph) tracer for C/C++/Rust programs
Summary: Review Request: uftrace - A function (graph) tracer for C/C++/Rust programs
Keywords:
Status: ASSIGNED
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Benson Muite
QA Contact: Fedora Extras Quality Assurance
URL: https://github.com/bernhardkaindl/uft...
Whiteboard:
Depends On:
Blocks: FE-NEEDSPONSOR
TreeView+ depends on / blocked
 
Reported: 2023-03-22 19:15 UTC by Bernhard Kaindl
Modified: 2024-04-13 05:18 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: ---
Embargoed:
benson_muite: fedora-review?


Attachments (Terms of Use)
The .spec file difference from Copr build 5695859 to 5701981 (1.15 KB, patch)
2023-03-24 00:23 UTC, Jakub Kadlčík
no flags Details | Diff
The .spec file difference from Copr build 5701981 to 5703173 (464 bytes, patch)
2023-03-24 12:53 UTC, Jakub Kadlčík
no flags Details | Diff
The .spec file difference from Copr build 5703173 to 5705652 (674 bytes, patch)
2023-03-24 16:30 UTC, Jakub Kadlčík
no flags Details | Diff
The .spec file difference from Copr build 5705652 to 5707317 (6.83 KB, patch)
2023-03-25 04:06 UTC, Jakub Kadlčík
no flags Details | Diff
The .spec file difference from Copr build 5707317 to 5708913 (7.13 KB, patch)
2023-03-26 01:59 UTC, Jakub Kadlčík
no flags Details | Diff
The .spec file difference from Copr build 5708913 to 5716091 (3.90 KB, patch)
2023-03-28 10:09 UTC, Jakub Kadlčík
no flags Details | Diff
The .spec file difference from Copr build 5716091 to 5749104 (2.78 KB, patch)
2023-04-05 23:42 UTC, Jakub Kadlčík
no flags Details | Diff

Description Bernhard Kaindl 2023-03-22 19:15:25 UTC
Spec URL: https://github.com/bernhardkaindl/uftrace/blob/branch-0.13.2-9/uftrace.spec
SRPM URL: https://download.copr.fedorainfracloud.org/results/bkaindl/uftrace/fedora-rawhide-x86_64/05695653-uftrace/uftrace-0.13.2-9.fc39.src.rpm
Description:

uftrace traces, records and analyzes the execution of programs written in
C, C++ and Rust. It was heavily inspired by the ftrace framework of the
Linux kernel (especially the function graph tracer) and supports userspace
programs, and with elevated privileges, also kernel function call graphs.

It supports many commands and filters for analysis of program execution
and performance. Recorded data can be visualized as flame graphs in Chrome:
https://youtu.be/LNav5qvyK7I

Fedora Account System Username: bkaindl

Comment 1 Jakub Kadlčík 2023-03-22 19:24:15 UTC
Copr build:
https://copr.fedorainfracloud.org/coprs/build/5695859
(succeeded)

Review template:
https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-2180989-uftrace/fedora-rawhide-x86_64/05695859-uftrace/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

If you want to trigger a new Copr build, add a comment containing new
Spec and SRPM URLs or [fedora-review-service-build] string.

Comment 3 Benson Muite 2023-03-23 12:27:28 UTC
Is it possible to use upstream url:
https://github.com/namhyung/uftrace

In the source spec file use:

Source:          https://github.com/bernhardkaindl/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz

not:

Source:          https://github.com/bernhardkaindl/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz
if there are reasons to package the fork. If upstream can be used, use

Source:          https://github.com/namhyung/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz

Comment 5 Jakub Kadlčík 2023-03-24 00:23:38 UTC
Created attachment 1953285 [details]
The .spec file difference from Copr build 5695859 to 5701981

Comment 6 Jakub Kadlčík 2023-03-24 00:23:40 UTC
Copr build:
https://copr.fedorainfracloud.org/coprs/build/5701981
(succeeded)

Review template:
https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-2180989-uftrace/fedora-rawhide-x86_64/05701981-uftrace/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

If you want to trigger a new Copr build, add a comment containing new
Spec and SRPM URLs or [fedora-review-service-build] string.

Comment 7 Benson Muite 2023-03-24 05:55:10 UTC
Source URL in spec file still has a dollar sign which should be a percent sign:
https://github.com/namhyung/%{name}/archive/v${version}/%{name}-%{version}.tar.gz
should be
https://github.com/namhyung/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz

This prevents fedora-review from running correctly

Comment 9 Jakub Kadlčík 2023-03-24 12:53:43 UTC
Created attachment 1953373 [details]
The .spec file difference from Copr build 5701981 to 5703173

Comment 10 Jakub Kadlčík 2023-03-24 12:53:46 UTC
Copr build:
https://copr.fedorainfracloud.org/coprs/build/5703173
(failed)

Build log:
https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-2180989-uftrace/fedora-rawhide-x86_64/05703173-uftrace/builder-live.log.gz

Please make sure the package builds successfully at least for Fedora Rawhide.

- If the build failed for unrelated reasons (e.g. temporary network
  unavailability), please ignore it.
- If the build failed because of missing BuildRequires, please make sure they
  are listed in the "Depends On" field


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

If you want to trigger a new Copr build, add a comment containing new
Spec and SRPM URLs or [fedora-review-service-build] string.

Comment 12 Jakub Kadlčík 2023-03-24 16:30:48 UTC
Created attachment 1953409 [details]
The .spec file difference from Copr build 5703173 to 5705652

Comment 13 Jakub Kadlčík 2023-03-24 16:30:50 UTC
Copr build:
https://copr.fedorainfracloud.org/coprs/build/5705652
(succeeded)

Review template:
https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-2180989-uftrace/fedora-rawhide-x86_64/05705652-uftrace/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

If you want to trigger a new Copr build, add a comment containing new
Spec and SRPM URLs or [fedora-review-service-build] string.

Comment 15 Jakub Kadlčík 2023-03-25 04:06:12 UTC
Created attachment 1953521 [details]
The .spec file difference from Copr build 5705652 to 5707317

Comment 16 Jakub Kadlčík 2023-03-25 04:06:14 UTC
Copr build:
https://copr.fedorainfracloud.org/coprs/build/5707317
(succeeded)

Review template:
https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-2180989-uftrace/fedora-rawhide-x86_64/05707317-uftrace/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

If you want to trigger a new Copr build, add a comment containing new
Spec and SRPM URLs or [fedora-review-service-build] string.

Comment 17 Bernhard Kaindl 2023-03-26 01:44:47 UTC
@Benson Muite: Automatic Package review is finished, asking for human review! Pew!

Spec URL: https://download.copr.fedorainfracloud.org/results/bkaindl/uftrace/fedora-rawhide-aarch64/05708877-uftrace/uftrace.spec
SRPM URL: https://download.copr.fedorainfracloud.org/results/bkaindl/uftrace/fedora-rawhide-aarch64/05708877-uftrace/uftrace-0.13-14.fc39.src.rpm

Fixed the rpmlint messages.

Remarks on the non applicable rpmlint messages:

uftrace.x86_64: E: shared-library-without-dependency-information /usr/lib64/uftrace/libmcount-nop.so
-> uftrace does not build classic shared librares: They are special loadable modules especially for tracing.

uftrace.x86_64: W: position-independent-executable-suggested /usr/bin/uftrace
-> ftrace uses advanced methods for tracing and does not support getting compiled as PIE. When forced, the test suite shows regressions.

uftrace.x86_64: W: binary-or-shlib-calls-gethostbyname /usr/bin/uftrace
-> false positive: uftrace as a tracing tool, it contains the function signature of gethostbyname in
   order to trace it's arguments when a traced program calls it but it does not have call gethostbyname().

Likewise, rpmlint's report on unversioned so-files does not apply because these are not classic shared libs.

Here is the submission of the filled-out review:

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

C/C++:
[x]: Package does not contain kernel modules.
[x]: Package contains no static executables.
[ ]: Development (unversioned) .so files in -devel subpackage, if present.
     Note: Unversioned so-files in private %_libdir subdirectory (see
     attachment). Verify they are not in ld path.

-> uftrace does not have development files, the .so files are special tracing plugins,
   internally to uftrace, not shared libraries.

[x]: If your application is a C or C++ application you must list a
     BuildRequires against gcc, gcc-c++ or clang.
[x]: Header files in -devel subpackage, if present.
[x]: Package does not contain any libtool archives (.la)
[x]: Rpath absent or only used for internal libs.

Generic:
[x]: Package successfully compiles and builds into binary rpms on at least
     one supported primary architecture.
     Note: Using prebuilt packages
[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.
[x]: License file installed when any subpackage combination is installed.
[ ]: Package requires other packages for directories it uses.
     Note: No known owner of /usr/share/bash_completion, /usr/share/bash_completion/completions

-> In Fedora, no package owns these.

[ ]: Package must own all directories that it creates.
     Note: Directories without known owners: /usr/share/bash_completion,
     /usr/share/bash_completion/completions

-> In Fedora, no package owns these.

[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.

-> Package is not a GUI application.

[ ]: Development files must be in a -devel package

-> No development files, The .so files are internal tracing plugins, not shared libraries.

[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.
[x]: 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 30720 bytes in 2 files.
[x]: Package complies to the Packaging Guidelines
[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 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]: 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:
[x]: Reviewer should test that the package builds in mock.
[x]: 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).
[x]: Package functions as described.
[x]: 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.
[x]: %check is present and all tests pass.
[x]: Packages should try to preserve timestamps of original installed
     files.
[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.


Rpmlint
-------
Checking: uftrace-0.13-14.fc39.aarch64.rpm
          uftrace-debuginfo-0.13-14.fc39.aarch64.rpm
          uftrace-debugsource-0.13-14.fc39.aarch64.rpm
          uftrace-0.13-14.fc39.src.rpm
============================ 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
rpmlintrc: [PosixPath('/tmp/tmpg6h6la18')]
checks: 31, packages: 4

uftrace.aarch64: E: shared-library-without-dependency-information /usr/lib64/uftrace/libmcount-nop.so
uftrace.aarch64: W: position-independent-executable-suggested /usr/bin/uftrace
uftrace.aarch64: W: binary-or-shlib-calls-gethostbyname /usr/bin/uftrace
 4 packages and 0 specfiles checked; 1 errors, 2 warnings, 1 badness; has taken 0.8 s 




Rpmlint (debuginfo)
-------------------
Checking: uftrace-debuginfo-0.13-14.fc39.aarch64.rpm
============================ 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
rpmlintrc: [PosixPath('/tmp/tmpq9g3h_0o')]
checks: 31, packages: 1

 1 packages and 0 specfiles checked; 0 errors, 0 warnings, 0 badness; has taken 0.4 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

uftrace.aarch64: E: shared-library-without-dependency-information /usr/lib64/uftrace/libmcount-nop.so
uftrace.aarch64: W: position-independent-executable-suggested /usr/bin/uftrace
uftrace.aarch64: W: binary-or-shlib-calls-gethostbyname /usr/bin/uftrace
 3 packages and 0 specfiles checked; 1 errors, 2 warnings, 1 badness; has taken 1.9 s 

Review Remarks:

uftrace.x86_64: E: shared-library-without-dependency-information /usr/lib64/uftrace/libmcount-nop.so
-> uftrace does not build classic shared librares: They are special loadable modules especially for tracing.

uftrace.x86_64: W: position-independent-executable-suggested /usr/bin/uftrace
-> ftrace uses advanced methods for tracing and does not support getting compiled as PIE. When forced, the test suite shows regressions.

uftrace.x86_64: W: binary-or-shlib-calls-gethostbyname /usr/bin/uftrace
-> false positive: uftrace as a tracing tool, it contains the function signature of gethostbyname in
   order to trace it's arguments when a traced program calls it but it does not have call gethostbyname().

Likewise, rpmlint's report on unversioned so-files does not apply because these are not classic shared libs.


Unversioned so-files
--------------------
uftrace: /usr/lib64/uftrace/libmcount-fast-single.so
uftrace: /usr/lib64/uftrace/libmcount-fast.so
uftrace: /usr/lib64/uftrace/libmcount-nop.so
uftrace: /usr/lib64/uftrace/libmcount-single.so
uftrace: /usr/lib64/uftrace/libmcount.so

Source checksums
----------------
https://github.com/namhyung/uftrace/archive/v0.13/uftrace-0.13.tar.gz :
  CHECKSUM(SHA256) this package     : 6852edbafc0bbde9400bc1a4617c34647c6fe3adabba3f760b10957e94eeec62
  CHECKSUM(SHA256) upstream package : cffae82c68446c20cc3c7e87e71e57498805767a0d4085b4846f3c49f9e472d9
diff -r also reports differences


Requires
--------
uftrace (rpmlib, GLIBC filtered):
    glibc
    libc.so.6()(64bit)
    libcapstone.so.4()(64bit)
    libdw.so.1()(64bit)
    libdw.so.1(ELFUTILS_0.122)(64bit)
    libdw.so.1(ELFUTILS_0.126)(64bit)
    libdw.so.1(ELFUTILS_0.143)(64bit)
    libdw.so.1(ELFUTILS_0.161)(64bit)
    libelf.so.1()(64bit)
    libelf.so.1(ELFUTILS_1.0)(64bit)
    libncursesw.so.6()(64bit)
    libstdc++.so.6()(64bit)
    libstdc++.so.6(CXXABI_1.3)(64bit)
    libtinfo.so.6()(64bit)
    rtld(GNU_HASH)

uftrace-debuginfo (rpmlib, GLIBC filtered):

uftrace-debugsource (rpmlib, GLIBC filtered):



Provides
--------
uftrace:
    libmcount-fast-single.so()(64bit)
    libmcount-fast.so()(64bit)
    libmcount-nop.so()(64bit)
    libmcount-single.so()(64bit)
    libmcount.so()(64bit)
    uftrace
    uftrace(aarch-64)

uftrace-debuginfo:
    debuginfo(build-id)
    libmcount-fast-single.so-0.13-14.fc39.aarch64.debug()(64bit)
    libmcount-fast.so-0.13-14.fc39.aarch64.debug()(64bit)
    libmcount-nop.so-0.13-14.fc39.aarch64.debug()(64bit)
    libmcount-single.so-0.13-14.fc39.aarch64.debug()(64bit)
    libmcount.so-0.13-14.fc39.aarch64.debug()(64bit)
    uftrace-debuginfo
    uftrace-debuginfo(aarch-64)

uftrace-debugsource:
    uftrace-debugsource
    uftrace-debugsource(aarch-64)

Comment 18 Jakub Kadlčík 2023-03-26 01:59:04 UTC
Created attachment 1953661 [details]
The .spec file difference from Copr build 5707317 to 5708913

Comment 19 Jakub Kadlčík 2023-03-26 01:59:06 UTC
Copr build:
https://copr.fedorainfracloud.org/coprs/build/5708913
(succeeded)

Review template:
https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-2180989-uftrace/fedora-rawhide-x86_64/05708913-uftrace/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

If you want to trigger a new Copr build, add a comment containing new
Spec and SRPM URLs or [fedora-review-service-build] string.

Comment 20 Benson Muite 2023-03-27 10:21:49 UTC
Thanks for the updates.  Output from fedora-review:

uftrace.x86_64: E: shared-library-without-dependency-information /usr/lib64/uftrace/libmcount-nop.so
$ rpmlint -e shared-library-without-dependency-information
shared-library-without-dependency-information:
The listed shared library doesn't include information about which other
libraries the library was linked against.

Not sure why getting this.

uftrace.x86_64: W: position-independent-executable-suggested /usr/bin/uftrace
$ rpmlint -e position-independent-executable-suggested
position-independent-executable-suggested:
This executable should be position independent (all binaries should).  Check
that it is built with -fPIE/-fpie in compiler flags and -pie in linker flags.

-fPIE should be in compiler flags, but consider adding
LDFLAGS=$(LDFLAGS) -pie
to the spec file

uftrace.x86_64: W: binary-or-shlib-calls-gethostbyname /usr/bin/uftrace
$ rpmlint -e binary-or-shlib-calls-gethostbyname
binary-or-shlib-calls-gethostbyname:
The binary calls gethostbyname. Please port the code to use getaddrinfo.

Maybe upstream will update or accept a patch?

Comment 21 Bernhard Kaindl 2023-03-27 15:10:59 UTC
Thanks for the review.  About the output from fedora-review:

> uftrace.x86_64: E: shared-library-without-dependency-information /usr/lib64/uftrace/libmcount-nop.so
> $ rpmlint -e shared-library-without-dependency-information
> shared-library-without-dependency-information:
> The listed shared library doesn't include information about which other
> libraries the library was linked against.
> 
> Not sure why getting this.

rpmlint issues this error because this isn't regular library:

It is shared object is preloaded using LD_PRELOAD as one of the data points for benchmarching the individual tracing mechanism.

This specific shared object only contains dummy functions to for benchmarking the nearly perfect case, which is that functions are instrumented for tracing, but the tracing itself has zero impact. This is why this shared has only dumy functions which don't call into other code has no other depencies which could affect the performance of the benchmark.

While it would usually be a strange sign when a *.so file has no dependencies, this this case, this check is expected to be raised.

You can roughly compare files like these with the *.so files of the valgrind package:
It is a tracing tool as well and also in valgrind, these files are special.

Other example *.so files which are preloaded and do not fall into the category of regular libaries are for example:
- libfakeroot.so from the fakeroot package: https://src.fedoraproject.org/rpms/fakeroot
- libpseudo.so from the pseudo package: https://packages.fedoraproject.org/pkgs/pseudo/pseudo/
- libmtrace.so for memory allocation tracing https://github.com/sergey-senozhatsky/libmtrace
- gprofng: https://blogs.oracle.com/linux/post/gprofng-the-next-generation-gnu-profiling-tool

In test suites, this situation is usually be summarized as an XFAIL: As fail which is expected and correct in such cases.
---

> uftrace.x86_64: W: position-independent-executable-suggested /usr/bin/uftrace
> $ rpmlint -e position-independent-executable-suggested
> position-independent-executable-suggested:
> This executable should be position independent (all binaries should).  Check
> that it is built with -fPIE/-fpie in compiler flags and -pie in linker flags.
>
> -fPIE should be in compiler flags, but consider adding
> LDFLAGS=$(LDFLAGS) -pie
> to the spec file

Here is the part of the FPG about PIE: https://docs.fedoraproject.org/en-US/packaging-guidelines/#_pie, it says:

> In Fedora, PIE is enabled by default. To disable it in your spec, add:
> %undefine _hardened_build
>
> If your package meets any of the following criteria you MUST NOT disable the PIE compiler flags:
> - Your package is long running. This means it’s likely to be started and keep running until the machine is rebooted, not start on demand and quit on idle.
> - Your package has suid binaries, or binaries with capabilities.
> - Your package runs as root.

Because I've seend and verified that using -fPIE causes regressions in the test suite, I am invoking this exception as described above.
- Using it leads to regressions because of the low-level nature of tracing on the assembly and register level:
  (even patching instructions at dynamically at runtime)
- It is not long-running (as defined in the FPG), does not run as root and has no suid binaries or binaries with capabilities.

Thus, like gcc, which also disables _hardened_build, the FPC allowes them be built without PIE in order to have no regressions:
https://src.fedoraproject.org/rpms/gcc/blob/rawhide/f/gcc.spec

> uftrace.x86_64: W: binary-or-shlib-calls-gethostbyname /usr/bin/uftrace
> $ rpmlint -e binary-or-shlib-calls-gethostbyname
> binary-or-shlib-calls-gethostbyname:
> The binary calls gethostbyname. Please port the code to use getaddrinfo.
> 
> Maybe upstream will update or accept a patch?

Patch submitted upstream, will likely be merged, I hope: https://github.com/namhyung/uftrace/pull/1661

Thanks for your review.

Comment 22 Bernhard Kaindl 2023-03-27 15:18:07 UTC
@ Benson Muite: Sorry for the grammar errors in my long comment: My web browser started to misbehave and I didn't want to risk losing the full comment, which is why I sumbmitted the comment in an unfinished state.

I've given many examples for similar cases which I hope help to explain why these rpmlint messages are expected, normal for uftrace and are acceptable under the Fedora Packaging Guidelines.

Thanks again,
Bernhard

Comment 23 Felix Wang 2023-03-28 01:49:32 UTC
> %{_datadir}/bash_completion/completions/%{name}

bash-completion file normally installed into /etc/bash_completion.d or /usr/share/bash-completion/completions/. The upstream chooses to install the bash-completion file in /etc/bash_completion.d/, so it seems no need to modify here.

Comment 24 Felix Wang 2023-03-28 01:56:53 UTC
(In reply to Felix Wang from comment #23)
> > %{_datadir}/bash_completion/completions/%{name}
> 
> bash-completion file normally installed into /etc/bash_completion.d or
> /usr/share/bash-completion/completions/. The upstream chooses to install the
> bash-completion file in /etc/bash_completion.d/, so it seems no need to
> modify here.

I mean no need to modify the following lines to change bash-completion file location.

cd %{buildroot}
mkdir -p                             .%{_datadir}/bash_completion
mv .%{_sysconfdir}/bash_completion.d .%{_datadir}/bash_completion/completions

Comment 25 Felix Wang 2023-03-28 04:38:41 UTC
Update: I suggest put the bash-completion file into /usr/share/bash-completion/completions and most packages put them into here, though I find fzf package put it into /etc/bash_completion.d directory.

ref: https://bugzilla.redhat.com/show_bug.cgi?id=1504616
https://src.fedoraproject.org/rpms/fzf/blob/rawhide/f/fzf.spec#_97

Comment 26 Bernhard Kaindl 2023-03-28 09:57:34 UTC
Yep, thanks! Switched to use %{bash_completions_dir} (defined by redhat-rpm-config of Fedora(and define it if not)):

Spec URL: https://download.copr.fedorainfracloud.org/results/bkaindl/uftrace/fedora-rawhide-x86_64/05715968-uftrace/uftrace.spec
SRPM URL: https://download.copr.fedorainfracloud.org/results/bkaindl/uftrace/fedora-rawhide-x86_64/05715968-uftrace/uftrace-0.13-15.fc39.src.rpm

The fix of the bash-completions dir is the only relevant change in this update (see my previous comment for any findings)

Comment 27 Jakub Kadlčík 2023-03-28 10:09:35 UTC
Created attachment 1954122 [details]
The .spec file difference from Copr build 5708913 to 5716091

Comment 28 Jakub Kadlčík 2023-03-28 10:09:37 UTC
Copr build:
https://copr.fedorainfracloud.org/coprs/build/5716091
(succeeded)

Review template:
https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-2180989-uftrace/fedora-rawhide-x86_64/05716091-uftrace/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

If you want to trigger a new Copr build, add a comment containing new
Spec and SRPM URLs or [fedora-review-service-build] string.

Comment 29 Bernhard Kaindl 2023-03-28 12:03:34 UTC
The Package is ready for review again!

For the error and the two warnings from rpmlint please see my remarks in this comment and for the justifications for them:

https://bugzilla.redhat.com/show_bug.cgi?id=2180989#c21

Comment 30 Bernhard Kaindl 2023-04-02 01:29:38 UTC
@felix.a.wang and @benson_muite Thanks for the review, @anyone: Would you please sponsor me to bring this into Fedora? Thanks!

Comment 31 Felix Wang 2023-04-02 10:29:05 UTC
(In reply to Bernhard Kaindl from comment #30)
> @felix.a.wang and @benson_muite Thanks for the
> review, @anyone: Would you please sponsor me to bring this into Fedora?
> Thanks!

I think when the review request of the package is approved, and you can find a sponsor at the website of https://docs.pagure.org/fedora-sponsors/ and email to one of them, or asked at #devel-list of https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/ to bring you into the packager group.

ref: https://docs.fedoraproject.org/en-US/package-maintainers/How_to_Get_Sponsored_into_the_Packager_Group/

Comment 32 Benson Muite 2023-04-04 08:02:13 UTC
Still checking on:
uftrace.x86_64: W: position-independent-executable-suggested /usr/bin/uftrace
uftrace.x86_64: W: binary-or-shlib-calls-gethostbyname /usr/bin/uftrace


Have had to manually add the flag
LDFLAGS=$(LDFLAGS) -pie 
to other packages, do try and see if this error will be removed.

For sponsorship, it is helpful to also do a few informal package reviews.

Comment 33 Bernhard Kaindl 2023-04-05 23:29:40 UTC
Spec URL: https://download.copr.fedorainfracloud.org/results/bkaindl/uftrace/fedora-rawhide-x86_64/05749047-uftrace/uftrace.spec
SRPM URL: https://download.copr.fedorainfracloud.org/results/bkaindl/uftrace/fedora-rawhide-x86_64/05749047-uftrace/uftrace-0.13-16.fc39.src.rpm

Fixed:
> Still checking on:
> uftrace.x86_64: W: position-independent-executable-suggested /usr/bin/uftrace
> uftrace.x86_64: W: binary-or-shlib-calls-gethostbyname /usr/bin/uftrace

@benson_muite:

Checks: https://download.copr.fedorainfracloud.org/results/bkaindl/uftrace/fedora-rawhide-x86_64/05749047-uftrace/fedora-review/review.txt

For others: Like explained before on the top of https://bugzilla.redhat.com/show_bug.cgi?id=2180989#c21,
the .so files in /usr/lib64/uftrace are LD_PRELOAD libraries, not regular libraries,
thus the warnings generated by them are a given and expected.

Comment 34 Jakub Kadlčík 2023-04-05 23:42:13 UTC
Created attachment 1956016 [details]
The .spec file difference from Copr build 5716091 to 5749104

Comment 35 Jakub Kadlčík 2023-04-05 23:42:15 UTC
Copr build:
https://copr.fedorainfracloud.org/coprs/build/5749104
(succeeded)

Review template:
https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-2180989-uftrace/fedora-rawhide-x86_64/05749104-uftrace/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

If you want to trigger a new Copr build, add a comment containing new
Spec and SRPM URLs or [fedora-review-service-build] string.

Comment 36 Benson Muite 2023-04-07 07:46:17 UTC
Get a new warning:
uftrace.spec: W: patch-not-applied Patch1: gethostbyname.patch
but no warning:
uftrace.x86_64: W: binary-or-shlib-calls-gethostbyname /usr/bin/uftrace
Maybe uploaded a different srpm?

In the spec file, may be able to replace
sed -i 's|python$|python3|' runtest.py
by
%py3_shebang_fix runtest.py
see
https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_shebangs

Other than, that seems ok to me.

Comment 37 Bernhard Kaindl 2023-04-08 23:07:52 UTC
Spec URL: https://download.copr.fedorainfracloud.org/results/bkaindl/uftrace/fedora-rawhide-aarch64/05759491-uftrace/uftrace.spec
SRPM URL: https://download.copr.fedorainfracloud.org/results/bkaindl/uftrace/fedora-rawhide-aarch64/05759491-uftrace/uftrace-0.13-18.fc39.src.rpm

@benson_muite:
- Uses %py3_shebang_fix runtest.py as suggested (runtest.py is not installed yet, so it does not play a role yet)
- "W: patch-not-applied" is a bug in pylint. I reported it upstream and now work around it by adding a space after "%patch -P".

Repeated, general disclaimer for reviewers:
Like explained before on the top of https://bugzilla.redhat.com/show_bug.cgi?id=2180989#c21,
the .so files in /usr/lib64/uftrace are LD_PRELOAD libraries, not regular libraries,
thus the warnings generated by them are a given and expected.

Comment 38 Benson Muite 2023-04-13 09:48:40 UTC
Package Review
==============

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



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

C/C++:
[x]: Package does not contain kernel modules.
[x]: Package contains no static executables.
[x]: Development (unversioned) .so files in -devel subpackage, if present.
     Note: Unversioned so-files in private %_libdir subdirectory (see
     attachment). Verify they are not in ld path.
[x]: If your application is a C or C++ application you must list a
     BuildRequires against gcc, gcc-c++ or clang.
[x]: Header files in -devel subpackage, if present.
[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.
[ ]: License field in the package spec file matches the actual license.
     Note: Checking patched sources after %prep for licenses. Licenses
     found: "*No copyright* GNU General Public License, Version 2",
     "Unknown or generated", "GNU General Public License, Version 2", "GNU
     General Public License, Version 2 [obsolete FSF postal address (Temple
     Place)]", "*No copyright* [generated file]", "GNU Lesser General
     Public License, Version 2.1", "GNU General Public License, Version 2
     [generated file]", "MIT License GNU General Public License, Version
     2", "Apache License 2.0", "GNU General Public License v2.0 or later
     [obsolete FSF postal address (Temple Place)]", "*No copyright* GNU
     General Public License v2.0 or later [obsolete FSF postal address
     (Temple Place)]". 573 files have unknown license. Detailed output of
     licensecheck in
     /home/FedoraPackaging/reviews/uftrace/2180989-uftrace/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.
[ ]: 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.
[ ]: Requires correct, justified where necessary.
[x]: Spec file is legible and written in American English.
[-]: Package contains systemd file(s) if in need.
[x]: Useful -debuginfo package or justification otherwise.
[ ]: Package is not known to require an ExcludeArch tag.
[-]: Large documentation must go in a -doc subpackage. Large could be size
     (~1MB) or number of files.
     Note: Documentation size is 30720 bytes in 2 files.
[ ]: 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.
[x]: Latest version is packaged.
[ ]: Package does not include license text files separate from upstream.
[x]: Patches link to upstream bugs/comments/lists or are otherwise
     justified.
[-]: Sources are verified with gpgverify first in %prep if upstream
     publishes signatures.
     Note: gpgverify is not used.
[x]: %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]: Package should compile and build into binary rpms on all supported
     architectures.
[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: uftrace-0.13-18.fc39.x86_64.rpm
          uftrace-debuginfo-0.13-18.fc39.x86_64.rpm
          uftrace-debugsource-0.13-18.fc39.x86_64.rpm
          uftrace-0.13-18.fc39.src.rpm
=================================================================== 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
rpmlintrc: [PosixPath('/tmp/tmpa497ltnu')]
checks: 31, packages: 4

uftrace.x86_64: E: shared-library-without-dependency-information /usr/lib64/uftrace/libmcount-nop.so
==================================== 4 packages and 0 specfiles checked; 1 errors, 0 warnings, 1 badness; has taken 6.3 s ====================================




Rpmlint (debuginfo)
-------------------
Checking: uftrace-debuginfo-0.13-18.fc39.x86_64.rpm
=================================================================== 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
rpmlintrc: [PosixPath('/tmp/tmp6nbly95h')]
checks: 31, packages: 1

==================================== 1 packages and 0 specfiles checked; 0 errors, 0 warnings, 0 badness; has taken 1.5 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

uftrace.x86_64: E: shared-library-without-dependency-information /usr/lib64/uftrace/libmcount-nop.so
 3 packages and 0 specfiles checked; 1 errors, 0 warnings, 1 badness; has taken 5.5 s 



Unversioned so-files
--------------------
uftrace: /usr/lib64/uftrace/libmcount-fast-single.so
uftrace: /usr/lib64/uftrace/libmcount-fast.so
uftrace: /usr/lib64/uftrace/libmcount-nop.so
uftrace: /usr/lib64/uftrace/libmcount-single.so
uftrace: /usr/lib64/uftrace/libmcount.so

Source checksums
----------------
https://github.com/namhyung/uftrace/archive/v0.13/uftrace-0.13.tar.gz :
  CHECKSUM(SHA256) this package     : cffae82c68446c20cc3c7e87e71e57498805767a0d4085b4846f3c49f9e472d9
  CHECKSUM(SHA256) upstream package : cffae82c68446c20cc3c7e87e71e57498805767a0d4085b4846f3c49f9e472d9


Requires
--------
uftrace (rpmlib, GLIBC filtered):
    glibc
    ld-linux-x86-64.so.2()(64bit)
    libc.so.6()(64bit)
    libcapstone.so.4()(64bit)
    libdw.so.1()(64bit)
    libdw.so.1(ELFUTILS_0.122)(64bit)
    libdw.so.1(ELFUTILS_0.126)(64bit)
    libdw.so.1(ELFUTILS_0.143)(64bit)
    libdw.so.1(ELFUTILS_0.161)(64bit)
    libelf.so.1()(64bit)
    libelf.so.1(ELFUTILS_1.0)(64bit)
    libelf.so.1(ELFUTILS_1.3)(64bit)
    libelf.so.1(ELFUTILS_1.5)(64bit)
    libncursesw.so.6()(64bit)
    libstdc++.so.6()(64bit)
    libstdc++.so.6(CXXABI_1.3)(64bit)
    libtinfo.so.6()(64bit)
    rtld(GNU_HASH)

uftrace-debuginfo (rpmlib, GLIBC filtered):

uftrace-debugsource (rpmlib, GLIBC filtered):



Provides
--------
uftrace:
    libmcount-fast-single.so()(64bit)
    libmcount-fast.so()(64bit)
    libmcount-nop.so()(64bit)
    libmcount-single.so()(64bit)
    libmcount.so()(64bit)
    uftrace
    uftrace(x86-64)

uftrace-debuginfo:
    debuginfo(build-id)
    libmcount-fast-single.so-0.13-18.fc39.x86_64.debug()(64bit)
    libmcount-fast.so-0.13-18.fc39.x86_64.debug()(64bit)
    libmcount-nop.so-0.13-18.fc39.x86_64.debug()(64bit)
    libmcount-single.so-0.13-18.fc39.x86_64.debug()(64bit)
    libmcount.so-0.13-18.fc39.x86_64.debug()(64bit)
    uftrace-debuginfo
    uftrace-debuginfo(x86-64)

uftrace-debugsource:
    uftrace-debugsource
    uftrace-debugsource(x86-64)



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

Comments:
a) Thanks for adding this.
b) License check indicates:
*No copyright* GNU General Public License v2.0 or later [obsolete FSF postal address (Temple Place)]
----------------------------------------------------------------------------------------------------
uftrace-0.13/utils/rbtree.h
uftrace-0.13/utils/rbtree.c

Apache License 2.0
------------------
uftrace-0.13/utils/hashmap.c
uftrace-0.13/utils/hashmap.h

GNU Lesser General Public License, Version 2.1
----------------------------------------------
uftrace-0.13/libtraceevent/event-parse.c
uftrace-0.13/libtraceevent/event-parse.h
uftrace-0.13/libtraceevent/event-plugin.c
uftrace-0.13/libtraceevent/event-utils.h
uftrace-0.13/libtraceevent/kbuffer-parse.c
uftrace-0.13/libtraceevent/kbuffer.h
uftrace-0.13/libtraceevent/parse-filter.c
uftrace-0.13/libtraceevent/parse-utils.c
uftrace-0.13/libtraceevent/trace-seq.c

MIT License GNU General Public License, Version 2
-------------------------------------------------
uftrace-0.13/utils/demangle.c

May wish to list these licenses as well even though entire work is released under GPLv2.

b) Should the test report be packaged with the documentation? This does not seem necessary to me, but 
does not need to be removed if you think it is helpful.
c) To avoid carrying merged patches, it is possible, but not necessary to use a commit url:
https://docs.fedoraproject.org/en-US/packaging-guidelines/SourceURL/
d) For the warning about no shared library information, maybe this already fixes it:
https://github.com/rpm-software-management/rpmlint/issues/969
but further comments there may help in future reviews.

Comment 39 Package Review 2024-04-13 00:45:25 UTC
This is an automatic check from review-stats script.

This review request ticket hasn't been updated for some time, but it seems
that the review is still being working out by you. If this is right, please
respond to this comment clearing the NEEDINFO flag and try to reach out the
submitter to proceed with the review.

If you're not interested in reviewing this ticket anymore, please clear the
fedora-review flag and reset the assignee, so that a new reviewer can take
this ticket.

Without any reply, this request will shortly be resetted.

Comment 40 Benson Muite 2024-04-13 05:18:38 UTC
Happy to continue the review.


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