Bug 1801533 - Review Request: memstrack - a memory allocation analyzer
Summary: Review Request: memstrack - a memory allocation analyzer
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Attila Lakatos
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-02-11 05:46 UTC by Kairui Song
Modified: 2020-03-16 05:54 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2020-03-16 05:54:24 UTC
Type: ---
Embargoed:
alakatos: fedora-review+


Attachments (Terms of Use)

Description Kairui Song 2020-02-11 05:46:02 UTC
Spec URL: https://gist.github.com/ryncsn/ed41a2d265ce6c897b1d87212a7a1754

SRPM URL: https://download.copr.fedorainfracloud.org/results/kasong/nmxwv-software-collection/srpm-builds/01235706/memstrack-0-1.20200211git2b57bec.fc32.src.rpm

Description: memstrack is a tool to analyze memory usage, it's very helpful to track down which component is using most memory during a period of time. I developed this tool during debugging some kdump OOM issues, and it has been very helpful for debugging OOM issues.

I also maintain kexc-tools and kdump-anaconda-addon in Fedora. It's planed to integrate this tool with kexec-tools/kdump and provide an automatic OOM analyzing method, and any users could use it to analyze memory usage issue.

Thanks for you attention.

rpmlint info:
# rpmlint memstrack-0-1.20200211git2b57bec.fc32.src.rpm
# 1 packages and 0 specfiles checked; 0 errors, 0 warnings.

COPR build:
https://copr.fedorainfracloud.org/coprs/kasong/nmxwv-software-collection/build/1235706/

Fedora Account System Username: kasong

Comment 1 Artur Frenszek-Iwicki 2020-02-16 02:25:42 UTC
>Spec URL: https://gist.github.com/ryncsn/ed41a2d265ce6c897b1d87212a7a1754
This points to an HTML web-view of the file; please use "raw file" links.

>Group:          Applications/System
The Group: tag is not used in Fedora.
https://docs.fedoraproject.org/en-US/packaging-guidelines/#_tags_and_sections

>%package dracut-memstrack
This will create a "memstack-dracut-memstack" package. Is this what you wanted? If you want just "dracut-memstack", you should use "%package -n".

>%build
>make
You should use %set_build_flags before the make invocation in order to use Fedora's CFLAGS.

>%files
>%{_bindir}/memstrack
>%files dracut-memstrack
>%{dracutmoduledir}/module-setup.sh
>%{dracutmoduledir}/start-tracing.sh
>%{dracutmoduledir}/stop-tracing.sh
>%doc
1. Please put an empty line between the main package's %files and the subpackages' list.
2. You must include the licence text. https://docs.fedoraproject.org/en-US/packaging-guidelines/LicensingGuidelines/#_license_text
3. The list does not include the module directory itself - RPM will complain that the directory is unowned.
4. If %doc is going to be empty, you can just remove it.

Comment 2 Kairui Song 2020-02-18 09:16:37 UTC
(In reply to Artur Iwicki from comment #1)

Thank you very much for the review.

> >Spec URL: https://gist.github.com/ryncsn/ed41a2d265ce6c897b1d87212a7a1754
> This points to an HTML web-view of the file; please use "raw file" links.

OK, will fix that.

> 
> >Group:          Applications/System
> The Group: tag is not used in Fedora.
> https://docs.fedoraproject.org/en-US/packaging-guidelines/#_tags_and_sections
> 
> >%package dracut-memstrack
> This will create a "memstack-dracut-memstack" package. Is this what you
> wanted? If you want just "dracut-memstack", you should use "%package -n".

It should be a memstrack-dracut sub package, so I'll change it to "%package dracut"

> 
> >%build
> >make
> You should use %set_build_flags before the make invocation in order to use
> Fedora's CFLAGS.
> 
> >%files
> >%{_bindir}/memstrack
> >%files dracut-memstrack
> >%{dracutmoduledir}/module-setup.sh
> >%{dracutmoduledir}/start-tracing.sh
> >%{dracutmoduledir}/stop-tracing.sh
> >%doc
> 1. Please put an empty line between the main package's %files and the
> subpackages' list.
> 2. You must include the licence text.
> https://docs.fedoraproject.org/en-US/packaging-guidelines/
> LicensingGuidelines/#_license_text
> 3. The list does not include the module directory itself - RPM will complain
> that the directory is unowned.
> 4. If %doc is going to be empty, you can just remove it.

Good suggestions, will fix it.

Comment 3 Kairui Song 2020-02-18 15:45:49 UTC
Hi, I've updated the spec and srpm:

Spec URL: https://gist.githubusercontent.com/ryncsn/ed41a2d265ce6c897b1d87212a7a1754/raw/ca1bdfed3a7f771eb2e4239afb464ee23997d5db/memstrack.spec

SRPM URL: https://kojipkgs.fedoraproject.org//work/tasks/3457/41613457/memstrack-0-1.20200218git9aefb50.fc33.src.rpm

Koji Build: https://koji.fedoraproject.org/koji/taskinfo?taskID=41613456

rpmlint result:
memstrack.src:44: E: hardcoded-library-path in %{_prefix}/lib/dracut
1 packages and 0 specfiles checked; 1 errors, 0 warnings.

The hardcoded-library-path is to keep the macro definition consistent with the one in dracut.spec (dracut package), and also avoids noarch build error.

Comment 4 Attila Lakatos 2020-02-26 17:13:51 UTC
1. It is not a MUST thing but you should consider to add a man page for memstrack binary file. If you do not have one, work with upstream to add one where it makes sense. However, it's only up to you.

> install -p -m 644 misc/99memstrack/module-setup.sh %{buildroot}/%{dracutmoduledir}/module-setup.sh
2. memstrack.spec:49: Are you sure that you want to set the file permissions to 644? In that case it creates a non-executable script.

3. No owner of /usr/lib/dracut/module.d
Your package should own all of the files that are installed as part of the %install process.

Comment 5 Kairui Song 2020-02-28 09:25:07 UTC
(In reply to Attila Lakatos from comment #4)
> 1. It is not a MUST thing but you should consider to add a man page for
> memstrack binary file. If you do not have one, work with upstream to add one
> where it makes sense. However, it's only up to you.

Thanks, I'll consider it in the furture, and there is a README should have a brief introduction to the tool and the TUI is already inteactive and provide basic usage info.

> 
> > install -p -m 644 misc/99memstrack/module-setup.sh %{buildroot}/%{dracutmoduledir}/module-setup.sh
> 2. memstrack.spec:49: Are you sure that you want to set the file permissions
> to 644? In that case it creates a non-executable script.

That's right, that's a dracut module which don't need execution permission.

> 
> 3. No owner of /usr/lib/dracut/module.d
> Your package should own all of the files that are installed as part of the
> %install process.

Good catch, will fix it. That's a malformed dracut module path, this package don't own it, so I should just install files under it and dont touch the dir itself, and add dependency on dracut to ensure it exists.

Comment 6 Attila Lakatos 2020-03-02 14:43:46 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]: 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: "GPL (v3 or later)", "Unknown or generated". 28 files have
     unknown license. Detailed output of licensecheck in
     /home/alakatos/Desktop/memstrack-review/review-
     memstrack/licensecheck.txt
[x]: License file installed when any subpackage combination is installed.
[x]: Package requires other packages for directories it uses.
     Note: No known owner of /usr/lib/dracut/module.d
[!]: Package must own all directories that it creates.
     Note: Directories without known owners: /usr/lib/dracut/module.d
[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.
[-]: 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 10240 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 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:
[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).
[?]: Fully versioned dependency in subpackages if applicable.
     Note: No Requires: %{name}%{?_isa} = %{version}-%{release} in
     memstrack-dracut
Would it be benefitial to specify the base package?
https://docs.fedoraproject.org/en-US/packaging-guidelines/#_requiring_base_package

[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.
[-]: Description and summary sections in the package spec file contains
     translations for supported Non-English languages, if available.
[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.
[!]: Spec use %global instead of %define unless justified.
     Note: %define requiring justification: %define dracutlibdir
     %{_prefix}/lib/dracut, %define dracutmoduledir
     %{dracutlibdir}/module.d/99memstrack
Could you please fix it or give an explanation?

[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]: Packager, Vendor, PreReq, Copyright tags should not be in spec file
[x]: Uses parallel make %{?_smp_mflags} macro.
[x]: Sources can be downloaded from URI in Source: tag
[x]: SourceX is a working URL.

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

Generic:
[!]: Spec file according to URL is the same as in SRPM.
     Note: Spec file as given by url is not the same as in SRPM (see
     attached diff).
There is a new line character difference. Could you please correct it?

[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: memstrack-0-1.20200218git9aefb50.fc33.x86_64.rpm
          memstrack-dracut-0-1.20200218git9aefb50.fc33.noarch.rpm
          memstrack-debuginfo-0-1.20200218git9aefb50.fc33.x86_64.rpm
          memstrack-debugsource-0-1.20200218git9aefb50.fc33.x86_64.rpm
          memstrack-0-1.20200218git9aefb50.fc33.src.rpm
memstrack.x86_64: W: no-manual-page-for-binary memstrack
memstrack-dracut.noarch: W: spelling-error Summary(en_US) memstract -> abstract
memstrack-dracut.noarch: W: spelling-error %description -l en_US memstract -> abstract
memstrack-dracut.noarch: W: only-non-binary-in-usr-lib
memstrack-dracut.noarch: W: no-documentation
memstrack-dracut.noarch: E: non-executable-script /usr/lib/dracut/module.d/99memstrack/module-setup.sh 644 /usr/bin/bash 
memstrack.src:45: E: hardcoded-library-path in %{_prefix}/lib/dracut
5 packages and 0 specfiles checked; 2 errors, 5 warnings.



Rpmlint (debuginfo)
-------------------
Checking: memstrack-debuginfo-0-1.20200218git9aefb50.fc33.x86_64.rpm
1 packages and 0 specfiles checked; 0 errors, 0 warnings.





Rpmlint (installed packages)
----------------------------
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LC_CTYPE = "C.UTF-8",
	LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LC_CTYPE = "C.UTF-8",
	LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
memstrack.x86_64: W: invalid-url URL: https://github.com/ryncsn/memstrack <urlopen error [Errno -2] Name or service not known>
memstrack.x86_64: W: no-manual-page-for-binary memstrack
memstrack-dracut.noarch: W: spelling-error Summary(en_US) memstract -> abstract
memstrack-dracut.noarch: W: spelling-error %description -l en_US memstract -> abstract
memstrack-dracut.noarch: W: invalid-url URL: https://github.com/ryncsn/memstrack <urlopen error [Errno -2] Name or service not known>
memstrack-dracut.noarch: W: only-non-binary-in-usr-lib
memstrack-dracut.noarch: W: no-documentation
memstrack-dracut.noarch: E: non-executable-script /usr/lib/dracut/module.d/99memstrack/module-setup.sh 644 /usr/bin/bash 
memstrack-debugsource.x86_64: W: invalid-url URL: https://github.com/ryncsn/memstrack <urlopen error [Errno -2] Name or service not known>
memstrack-debuginfo.x86_64: W: invalid-url URL: https://github.com/ryncsn/memstrack <urlopen error [Errno -2] Name or service not known>
4 packages and 0 specfiles checked; 1 errors, 9 warnings.

You do not have to take into consideration W: invalid-url URL warnings produced by rpmlint.


Source checksums
----------------
https://github.com/ryncsn/memstrack/archive/9aefb50f4eeb3bee60e5984b6e12cddd898cc8d8/memstrack-9aefb50.tar.gz :
  CHECKSUM(SHA256) this package     : 5ffd102853fb234150cc776d98b9dee4e3be458ef99bec8bd39da5f697ab863d
  CHECKSUM(SHA256) upstream package : 5ffd102853fb234150cc776d98b9dee4e3be458ef99bec8bd39da5f697ab863d


Requires
--------
memstrack (rpmlib, GLIBC filtered):
    libc.so.6()(64bit)
    libncurses.so.6()(64bit)
    libtinfo.so.6()(64bit)
    rtld(GNU_HASH)

memstrack-dracut (rpmlib, GLIBC filtered):
    /usr/bin/bash
    /usr/bin/sh
    dracut
    memstrack

memstrack-debuginfo (rpmlib, GLIBC filtered):

memstrack-debugsource (rpmlib, GLIBC filtered):



Provides
--------
memstrack:
    memstrack
    memstrack(x86-64)

memstrack-dracut:
    memstrack-dracut

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

memstrack-debugsource:
    memstrack-debugsource
    memstrack-debugsource(x86-64)



Diff spec file in url and in SRPM
---------------------------------
--- /home/alakatos/Desktop/memstrack-review/memstrack.spec	2020-03-02 14:40:30.789988802 +0100
+++ /home/alakatos/Desktop/memstrack-review/review-memstrack/srpm-unpacked/memstrack.spec	2020-02-18 16:37:39.000000000 +0100
@@ -64,3 +64,3 @@
 %changelog
 * Tue Feb 18 2020 Kairui Song <ryncsn> - 0-1.20200218git9aefb50
-- First release
\ No newline at end of file
+- First release

Comment 8 Gwyn Ciesla 2020-03-08 17:43:09 UTC
(fedscm-admin):  The Pagure repository was created at https://src.fedoraproject.org/rpms/memstrack


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