Bug 1476434 - Review Request: bstrlib - Better String Library
Review Request: bstrlib - Better String Library
Status: ASSIGNED
Product: Fedora
Classification: Fedora
Component: Package Review (Show other bugs)
rawhide
All Linux
unspecified Severity medium
: ---
: ---
Assigned To: Robin Lee
Fedora Extras Quality Assurance
:
Depends On:
Blocks: FE-NEEDSPONSOR
  Show dependency treegraph
 
Reported: 2017-07-28 22:10 EDT by Ye Cheng
Modified: 2017-10-01 20:54 EDT (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
robinlee.sysu: fedora‑review+


Attachments (Terms of Use)

  None (edit)
Description Ye Cheng 2017-07-28 22:10:56 EDT
Spec URL: 
https://copr-be.cloud.fedoraproject.org/results/yecheng/bstrlib/fedora-26-i386/00584634-bstrlib/bstrlib.spec

SRPM URL: 
https://copr-be.cloud.fedoraproject.org/results/yecheng/bstrlib/fedora-26-i386/00584634-bstrlib/bstrlib-1.0.0-0.fc26.src.rpm

Description: A string data type abstraction superior to that of C standard library.

Fedora Account System Username: yecheng

A makefile is supplied by packager to build this shared library.
Comment 1 Artur Iwicki 2017-07-29 06:10:33 EDT
>Release: 0%{?dist}
The Release: tag should start at 1.
https://fedoraproject.org/wiki/Packaging:Versioning#Simple_versioning

>Group: System Environment/Libraries
>Group: Development/Libraries
The Group: tag should not be used. 
https://fedoraproject.org/wiki/Packaging:Guidelines#Tags_and_Sections

>Source0: https://github.com/websnarf/bstrlib/archive/master.zip
This will always fetch the latest snapshot of the master branch, which introduces a risk of the RPM version not matching the software version. Refer to a git tag or commit instead.
https://fedoraproject.org/wiki/Packaging:SourceURL#Git_Hosting_Services

>%{_libdir}/bstrlib/
>%{_includedir}/bstrlib/
These directories are unowned. You may want to use the %dir macro to mark a directory as owned, without auto-owning all the files inside.

Also, I believe that the use of both %{buildroot} and ${RPM_BUILD_ROOT} is discouraged; it should be one or the other.
Comment 2 Ye Cheng 2017-07-29 09:41:28 EDT
(In reply to Iwicki Artur from comment #1)
> >Release: 0%{?dist}
> The Release: tag should start at 1.
Fixed as Release: 1%{?dist} in release tag nd changelog

> The Group: tag should not be used. 
Group tags are removed
> >Source0: https://github.com/websnarf/bstrlib/archive/master.zip
> Refer to a git tag or commit instead.
Fixed as Source0: https://github.com/websnarf/bstrlib/archive/v%{updatever}.zip

> >%{_libdir}/bstrlib/
> >%{_includedir}/bstrlib/
Fixed by adding %dir %{_libdir}/bstrlib/, %dir %{_includedir}/bstrlib/

> Also, I believe that the use of both %{buildroot} and ${RPM_BUILD_ROOT} is
> discouraged; it should be one or the other.

Fixed mix use of %{buildroot} and ${RPM_BUILD_ROOT} 
(described in https://fedoraproject.org/wiki/Packaging:Guidelines#Using_.25.7Bbuildroot.7D_and_.25.7Boptflags.7D_vs_.24RPM_BUILD_ROOT_and_.24RPM_OPT_FLAGS)
by replacing %{buildroot} with ${RPM_BUILD_ROOT}

Built in copr rawhide, sorry for the inconvenience of changing URLs.
New srpm URL: https://copr-be.cloud.fedoraproject.org/results/yecheng/bstrlib/fedora-rawhide-i386/00584721-bstrlib/bstrlib-1.0.0-1.fc27.src.rpm

New spec URL: https://copr-be.cloud.fedoraproject.org/results/yecheng/bstrlib/fedora-rawhide-i386/00584721-bstrlib/bstrlib.spec
Comment 3 Ye Cheng 2017-07-29 09:44:35 EDT
(In reply to Ye Cheng from comment #0)
Sorry for the inconvenience of switching URLs
> Spec URL: 
No longer valid 
New Spec URL: https://copr-be.cloud.fedoraproject.org/results/yecheng/bstrlib/fedora-rawhide-i386/00584721-bstrlib/bstrlib.spec
> SRPM URL: 
No longer valid
New spec URL: https://copr-be.cloud.fedoraproject.org/results/yecheng/bstrlib/fedora-rawhide-i386/00584721-bstrlib/bstrlib.spec
Comment 4 Ye Cheng 2017-07-31 23:17:59 EDT
(In reply to Ye Cheng from comment #0)
Sorry for changing URLs again

Spec URL:
https://copr-be.cloud.fedoraproject.org/results/yecheng/bstrlib/fedora-rawhide-i386/00585332-bstrlib/bstrlib.spec

SRPM URL:
https://copr-be.cloud.fedoraproject.org/results/yecheng/bstrlib/fedora-rawhide-i386/00585332-bstrlib/bstrlib-1.0.0-1.fc27.src.rpm

Rpmlint may complain about "shared-lib-calls-exit /usr/lib64/libbstrsafe.so.1.0.0 exit@GLIBC_2.2.5" The exit call is necessary for the safe moduli to function as it can terminate execution while returning an error code -1 when the standard string library was accidentally called.
Comment 7 Robin Lee 2017-08-03 03:29:58 EDT
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]: Header files in -devel subpackage, if present.
[x]: ldconfig called in %post and %postun if required.
[x]: Package does not contain any libtool archives (.la)
[x]: Rpath absent or only used for internal libs.
[x]: Development (unversioned) .so files in -devel subpackage, if present.

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: "BSD (3 clause)", "Unknown or generated", "*No copyright* BSD
     (unspecified)". 20 files have unknown license. Detailed output of
     licensecheck in /home/cheese/Public/1476434-bstrlib/licensecheck.txt
[x]: License file installed when any subpackage combination is installed.
[x]: If the package is under multiple licenses, the licensing breakdown
     must be documented in the spec.
[x]: Package must own all directories that it creates.
     Note: Directories without known owners: /usr/include/bstrlib
[!]: %build honors applicable compiler flags or justifies otherwise.
     Note: Test programs should also honor global flags.
[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.
[x]: 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 215040 bytes in 4 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 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 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).
[x]: Fully versioned dependency in subpackages if applicable.
[x]: Package functions as described.
[x]: Latest version is packaged.
[x]: Package does not include license text files separate from upstream.
[x]: Scriptlets must be sane, if used.
[x]: 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.
     https://koji.fedoraproject.org/koji/taskinfo?taskID=21003722
[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]: 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.
[x]: Spec use %global instead of %define unless justified.

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

Generic:
[x]: Rpmlint is run on debuginfo package(s).
     Note: There are rpmlint messages (see attachment).
[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.
[?]: Why separating packages for bstrlib-safe? Since the library is small in
     size.
[?]: Where does SOURCE1 come from? You should add a comment at least.
[!]: Use tar.gz format instead of zip. Since tar.gz file usually has better
     compression radio.
[?]: Cleaning test directory is not necessary.


Rpmlint
-------
Checking: bstrlib-1.0.0-1.fc27.x86_64.rpm
          bstrlib-devel-1.0.0-1.fc27.x86_64.rpm
          bstrlib-safe-1.0.0-1.fc27.x86_64.rpm
          bstrlib-safe-devel-1.0.0-1.fc27.x86_64.rpm
          bstrlib-debuginfo-1.0.0-1.fc27.x86_64.rpm
          bstrlib-1.0.0-1.fc27.src.rpm
bstrlib.x86_64: W: hidden-file-or-dir /usr/lib/.build-id
bstrlib.x86_64: W: hidden-file-or-dir /usr/lib/.build-id
bstrlib-devel.x86_64: W: only-non-binary-in-usr-lib
bstrlib-safe.x86_64: W: shared-lib-calls-exit /usr/lib64/libbstrsafe.so.1.0.0 exit@GLIBC_2.2.5
bstrlib-safe.x86_64: W: hidden-file-or-dir /usr/lib/.build-id
bstrlib-safe.x86_64: W: hidden-file-or-dir /usr/lib/.build-id
bstrlib-safe-devel.x86_64: W: only-non-binary-in-usr-lib
bstrlib-safe-devel.x86_64: W: no-documentation
bstrlib-debuginfo.x86_64: E: useless-provides debuginfo(build-id)
6 packages and 0 specfiles checked; 1 errors, 8 warnings.




Rpmlint (debuginfo)
-------------------
Checking: bstrlib-debuginfo-1.0.0-1.fc27.x86_64.rpm
          bstrlib-safe-debuginfo-1.0.0-1.fc27.x86_64.rpm
bstrlib-debuginfo.x86_64: E: useless-provides debuginfo(build-id)
bstrlib-safe-debuginfo.x86_64: E: debuginfo-without-sources
2 packages and 0 specfiles checked; 2 errors, 0 warnings.





Rpmlint (installed packages)
----------------------------
sh: /usr/bin/python: No such file or directory
bstrlib-safe-debuginfo.x86_64: E: debuginfo-without-sources
bstrlib-debuginfo.x86_64: E: useless-provides debuginfo(build-id)
bstrlib-devel.x86_64: W: only-non-binary-in-usr-lib
bstrlib-safe.x86_64: W: shared-lib-calls-exit /usr/lib64/libbstrsafe.so.1.0.0 exit@GLIBC_2.2.5
bstrlib-safe-devel.x86_64: W: only-non-binary-in-usr-lib
bstrlib-safe-devel.x86_64: W: no-documentation
6 packages and 0 specfiles checked; 2 errors, 4 warnings.



Requires
--------
bstrlib-devel (rpmlib, GLIBC filtered):
    bstrlib(x86-64)
    libbstr.so.1.0.0()(64bit)
    libbstrc++.so.1.0.0()(64bit)

bstrlib-safe (rpmlib, GLIBC filtered):
    /sbin/ldconfig
    bstrlib(x86-64)
    libc.so.6()(64bit)
    rtld(GNU_HASH)

bstrlib-debuginfo (rpmlib, GLIBC filtered):

bstrlib-safe-devel (rpmlib, GLIBC filtered):
    bstrlib(x86-64)
    bstrlib-safe(x86-64)
    libbstrsafe.so.1.0.0()(64bit)

bstrlib (rpmlib, GLIBC filtered):
    /sbin/ldconfig
    libbstr.so.1.0.0()(64bit)
    libc.so.6()(64bit)
    libstdc++.so.6()(64bit)
    libstdc++.so.6(CXXABI_1.3)(64bit)
    rtld(GNU_HASH)



Provides
--------
bstrlib-devel:
    bstrlib-devel
    bstrlib-devel(x86-64)

bstrlib-safe:
    bstrlib-safe
    bstrlib-safe(x86-64)
    libbstrsafe.so.1.0.0()(64bit)

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

bstrlib-safe-devel:
    bstrlib-safe-devel
    bstrlib-safe-devel(x86-64)

bstrlib:
    bstrlib
    bstrlib(x86-64)
    libbstr.so.1.0.0()(64bit)
    libbstrc++.so.1.0.0()(64bit)



Source checksums
----------------
https://github.com/websnarf/bstrlib/archive/v1.0.0.zip :
  CHECKSUM(SHA256) this package     : 299f8762cdc8eca321581ded59ee0e26ff4a3a8ed07c0d7d468c17ef8aa76d5c
  CHECKSUM(SHA256) upstream package : 299f8762cdc8eca321581ded59ee0e26ff4a3a8ed07c0d7d468c17ef8aa76d5c


Generated by fedora-review 0.6.1 (f03e4e7) last change: 2016-05-02
Command line :/usr/bin/fedora-review -b 1476434
Buildroot used: fedora-rawhide-x86_64
Active plugins: Generic, Shell-api, C/C++
Disabled plugins: Java, Python, fonts, SugarActivity, Ocaml, Perl, Haskell, R, PHP
Disabled flags: EXARCH, DISTTAG, EPEL5, BATCH, EPEL6
Comment 8 Ye Cheng 2017-08-04 03:01:55 EDT
(In reply to Robin Lee from comment #7)
Thank you very much for the review. 
New spec URL:https://copr-be.cloud.fedoraproject.org/results/yecheng/bstrlib/fedora-rawhide-i386/00586525-bstrlib/bstrlib.spec

New srpm URL: https://copr-be.cloud.fedoraproject.org/results/yecheng/bstrlib/fedora-rawhide-i386/00586525-bstrlib/bstrlib-1.0.0-1.fc27.src.rpm

> [!]: %build honors applicable compiler flags or justifies otherwise.
>      Note: Test programs should also honor global flags
Tests is now built and executed with make with global flags. Compiler complains about various harmless type mismatches and there is already one pull request (https://github.com/websnarf/bstrlib/pull/16/files) that could fix them but it was not merged into the newest release.

> [?]: Cleaning test directory is not necessary.
Tests are now built in place and not removed.

> [?]: Why separating packages for bstrlib-safe? Since the library is small in
>      size.
Bstrlib-safe package is no longer separated as user can still decide whether to use the safe moduli by simply deciding whether to include its header and link the separately built bstrsafe library.

> [?]: Where does SOURCE1 come from? You should add a comment at least.
A comment indicating the makefile is packager supplied is added.

> [!]: Use tar.gz format instead of zip. Since tar.gz file usually has better
>      compression radio.
Changed to tar.gz file.
Comment 9 Robin Lee 2017-08-04 03:24:15 EDT
This package is approved by cheeselee.

Though you may still have to find a sponsor to support you before you can import this package.
Comment 10 Ye Cheng 2017-08-25 10:54:16 EDT
I added pkg-config file, so it could be easier for user to link the file.
This should be in devel file list, I will fix this in the next build.

spec:https://copr-be.cloud.fedoraproject.org/results/yecheng/bstrlib/fedora-rawhide-i386/00594093-bstrlib/bstrlib.spec

srpm:https://copr-be.cloud.fedoraproject.org/results/yecheng/bstrlib/fedora-rawhide-i386/00594093-bstrlib/bstrlib-1.0.0-1.fc28.src.rpm
Comment 11 Jason Tibbitts 2017-09-15 14:20:32 EDT
If you are still waiting for a sponsor, please open a ticket at https://pagure.io/packager-sponsors and let someone know.  Be sure to link back to this review.
Comment 12 Michael Schwendt 2017-09-28 08:21:22 EDT
Once again, if people approve packages prior to sponsorship and also change bugzilla status, that hides these tickets from the tracker:
http://fedoraproject.org/PackageReviewStatus/NEEDSPONSOR.html

Jason, is that something you could fix in the tracker?
Comment 14 Michael Schwendt 2017-09-28 14:01:33 EDT
> %install
> ...
> make clean

Superfluous and potentially dangerous to clean the build results during %install.


> cd ${RPM_BUILD_ROOT}%{_libdir}
> ln -sf libbstr.so.%{version} libbstr.so
> ln -sf libbstr.so.%{version} libbstr.so.%{majorver}
> ln -sf libbstr.so.%{version} libbstr.so.%{minorver}
> ln -sf libbstrsafe.so.%{version} libbstrsafe.so
> ln -sf libbstrsafe.so.%{version} libbstrsafe.so.%{majorver}
> ln -sf libbstrsafe.so.%{version} libbstrsafe.so.%{minorver}
> ln -sf libbstrc++.so.%{version} libbstrc++.so
> ln -sf libbstrc++.so.%{version} libbstrc++.so.%{majorver}
> ln -sf libbstrc++.so.%{version} libbstrc++.so.%{minorver}

The cleaner and more convenient solution to that is to run ldconfig on the buildroot libdir with the right options to make it create the symlinks without updating runtime linker's cache.


> %check  #rpath is necessay for the compiled tests (which will not appear
> in the built package) to run here because ldconfig haven't run yet.

Not really. Without RPATH you would simply point $LD_LIBRARY_PATH at the buildroot libdir when running the testsuite.
Comment 15 Ye Cheng 2017-09-29 09:01:49 EDT
(In reply to Michael Schwendt from comment #14)
Thanks.

New srpm URL:https://copr-be.cloud.fedoraproject.org/results/yecheng/bstrlib/fedora-rawhide-x86_64/00609529-bstrlib/bstrlib-1.0.0-1.fc28.src.rpm

New spec file:$git clone http://copr-dist-git.fedorainfracloud.org/git/yecheng/bstrlib/bstrlib.git
Sorry, I haven't yet figure out how to access the spec file in new copr.

> Superfluous and potentially dangerous to clean the build results during
> %install.
Thanks, this is removed.  

> The cleaner and more convenient solution to that is to run ldconfig on the
> buildroot libdir with the right options to make it create the symlinks
> without updating runtime linker's cache.
Sorry, I don't know how to let ldconfig create unversioned symbolic links for linker. 
I tried ldconfig -n ${RPM_BUILD_ROOT}%{_libdir} -v
and it returns:
/builddir/build/BUILDROOT/bstrlib-1.0.0-1.fc26.x86_64/usr/lib64:
	libbstrsafe.so.1.0.0 -> libbstrsafe.so.1.0.0
	libbstr.so.1.0.0 -> libbstr.so.1.0.0
	libbstrc++.so.1.0.0 -> libbstrc++.so.1.0.0
Ldconfig probably only make symbolic link with the name of the soname, when the soname and the filename are different.

> Not really. Without RPATH you would simply point $LD_LIBRARY_PATH at the
> buildroot libdir when running the testsuite.
Sorry, export LD_LIBRARY_PATH=%{buildroot}%{_libdir} worked for rpmbuild, but doesn't work in mock,but LD_PRELOAD is used  when running the tests in makefile instead of -rpath.
Comment 16 Michael Schwendt 2017-10-01 03:35:51 EDT
> libbstrsafe.so.1.0.0 -> libbstrsafe.so.1.0.0

That is evidence of a wrong and highly problematic SONAME. Let's see:

 eu-readelf -d libbstrsafe.so.1.0.0 |grep SONAME
  SONAME            Library soname: [libbstrsafe.so.1.0.0]

Indeed. It contains the full version, and the symlinks you create are superfluous and will be useless, because nothing will use them. Programs linked with bstrlib will depend on the exact SONAME.

You can query the automatic RPM SONAME Provides by examining the built packages, too:

  $ rpm -qp --provides bstrlib-1.0.0-1.fc27.2.x86_64.rpm |grep ^lib
  libbstr.so.1.0.0()(64bit)
  libbstrc++.so.1.0.0()(64bit)
  libbstrsafe.so.1.0.0()(64bit)

Any time there would be a minor version upgrade, all programs would need to be rebuilt to relink them. That is bad for a lib that is declared as "stable". The SONAMEs ought to end with just the major version.

This is an example of a package, which seems to be simple, but even a library package can be full of pitfalls.
Comment 17 Ye Cheng 2017-10-01 20:54:29 EDT
(In reply to Michael Schwendt from comment #16)
Thanks.
SONAME changed to 
    libbstr.so.1()(64bit)
    libbstrc++.so.1()(64bit)
    libbstrsafe.so.1()(64bit)


New spec file:http://copr-dist-git.fedorainfracloud.org/cgit/yecheng/bstrlib/bstrlib.git/tree/bstrlib.spec

New srpm file: https://copr-be.cloud.fedoraproject.org/results/yecheng/bstrlib/fedora-rawhide-x86_64/00610322-bstrlib/bstrlib-1.0.0-2.fc28.src.rpm

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