Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.

Bug 1066026

Summary: Review Request: cscppc - A compiler wrapper that runs cppcheck in background
Product: [Fedora] Fedora Reporter: Kamil Dudka <kdudka>
Component: Package ReviewAssignee: Mukundan Ragavan <nonamedotc>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: dan, nonamedotc, package-review, rc040203
Target Milestone: ---Flags: nonamedotc: fedora-review+
gwync: fedora-cvs+
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: cscppc-1.0.3-1.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-04-15 15:44:54 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1066029    

Description Kamil Dudka 2014-02-17 14:22:56 UTC
Spec URL: http://kdudka.fedorapeople.org/cscppc/cscppc.spec

SRPM URL: http://kdudka.fedorapeople.org/cscppc/cscppc-1.0.1-1.el6.src.rpm

Description: This package contains the cscppc compiler wrapper that runs cppcheck in background fully transparently.

Fedora Account System Username: kdudka

Comment 1 Ralf Corsepius 2014-02-18 04:38:02 UTC
This section from you spec longs for an explanation:
...
%if (0%{?fedora} >= 12 || 0%{?rhel} >= 6)
BuildRequires: glibc-static
%endif
...

I fail to see why this package would require static linking against libc.

Comment 2 Dan Horák 2014-02-18 07:53:16 UTC
You can modernize your specs unless you need to support EL-5
- drop BuildRoot tag
- drop %clean section
- remove the rm -rf "$RPM_BUILD_ROOT" command in %install
- drop %defattr in %files
rpm itself cares for this.

Comment 3 Kamil Dudka 2014-02-18 08:40:43 UTC
Thanks for your comments on this review request!

(In reply to Ralf Corsepius from comment #1)
> I fail to see why this package would require static linking against libc.

csmock copies the resulting (cscppc, cswrap) binaries into mock chroot, which may contain an older (e.g. RHEL-5) version of glibc, and they would not dynamically link against the old version of glibc if they were built against a newer one.  I will put there a comment to make it obvious.

(In reply to Dan Horák from comment #2)
> You can modernize your specs unless you need to support EL-5
> - drop BuildRoot tag
> - drop %clean section
> - remove the rm -rf "$RPM_BUILD_ROOT" command in %install
> - drop %defattr in %files
> rpm itself cares for this.

Those were added on purpose, as we do build the packages for RHEL-5.  We even patch Boost libraries to make the package compile and work properly on RHEL-5.

https://git.fedorahosted.org/cgit/codescan-diff.git/commit/?id=433e0507

But it should not be a big deal to maintain the RHEL-5 spec file separately...

Comment 4 Dan Horák 2014-02-18 11:43:49 UTC
(In reply to Kamil Dudka from comment #3)
> Thanks for your comments on this review request!
> 
> (In reply to Ralf Corsepius from comment #1)
> > I fail to see why this package would require static linking against libc.
> 
> csmock copies the resulting (cscppc, cswrap) binaries into mock chroot,
> which may contain an older (e.g. RHEL-5) version of glibc, and they would
> not dynamically link against the old version of glibc if they were built
> against a newer one.  I will put there a comment to make it obvious.
> 
> (In reply to Dan Horák from comment #2)
> > You can modernize your specs unless you need to support EL-5
> > - drop BuildRoot tag
> > - drop %clean section
> > - remove the rm -rf "$RPM_BUILD_ROOT" command in %install
> > - drop %defattr in %files
> > rpm itself cares for this.
> 
> Those were added on purpose, as we do build the packages for RHEL-5.  We
> even patch Boost libraries to make the package compile and work properly on
> RHEL-5.
> 
> https://git.fedorahosted.org/cgit/codescan-diff.git/commit/?id=433e0507
> 
> But it should not be a big deal to maintain the RHEL-5 spec file
> separately...

if RHEL-5 is supported by the tools then it's fine to have the now obsoleted stuff in the spec, definitely no need to create a RHEL-5 specific spec.

Comment 5 Ralf Corsepius 2014-02-18 16:07:36 UTC
(In reply to Kamil Dudka from comment #3)
> Thanks for your comments on this review request!
> 
> (In reply to Ralf Corsepius from comment #1)
> > I fail to see why this package would require static linking against libc.
> 
> csmock copies the resulting (cscppc, cswrap) binaries into mock chroot,
> which may contain an older (e.g. RHEL-5) version of glibc, and they would
> not dynamically link against the old version of glibc if they were built
> against a newer one.
Well, I still do not understand. Why would csmock do so?
What does csmock do, that it requires such an ugly step?

Comment 6 Kamil Dudka 2014-02-19 14:24:40 UTC
csmock is a mock-based tool for fully automated analysis of RPM packages.  User only specifies a mock profile and list of analyzers to use.  cscppc and cswrap are compiler wrappers that csmock uses internally.  They need to be available in the chroot.  In order to make it easy for the user, csmock copies the binaries from the host.  Otherwise we would need to install them using yum and it would be user's responsibility to put a yum repo with those packages into mock config.

You can find a high-level overview of how these tools work in this presentation:

http://kdudka.fedorapeople.org/static-analysis-devconf14.pdf

Comment 7 Kamil Dudka 2014-02-19 16:29:37 UTC
I have added an explanation why we link glibc statically.

Spec URL: http://kdudka.fedorapeople.org/cscppc/cscppc.spec
SRPM URL: http://kdudka.fedorapeople.org/cscppc/cscppc-1.0.2-1.el6.src.rpm

Comment 8 Kamil Dudka 2014-03-10 14:46:51 UTC
I have abandoned RHEL-5 compatibility and removed the obsolete for cppcheck-gcc, which has never been an official Fedora package:

Spec URL: http://kdudka.fedorapeople.org/cscppc/cscppc.spec
SRPM URL: http://kdudka.fedorapeople.org/cscppc/cscppc-1.0.2-2.el6.src.rpm

Comment 9 Mukundan Ragavan 2014-03-10 15:36:50 UTC
This looks fine to me. I am reading a bit on the static links - other than that, I do not think I have any issue. I will approve it soon ...


Package Review
==============

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



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

C/C++:
[x]: Package does not contain kernel modules.
[!]: Package contains no static executables.

---> Explanation for this is provided in the spec file. So, [x]

[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:
     "GPL". Detailed output of licensecheck in
     /home/mukundan/personal/pkgs/reviews/1066026-cscppc/licensecheck.txt
[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.
[x]: Each %files section contains %defattr if rpm < 4.4
     Note: %defattr present but not needed
[-]: 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.
[-]: Large documentation must go in a -doc subpackage. Large could be size
     (~1MB) or number of files.
     Note: Documentation size is 40960 bytes in 2 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 %doc.
[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]: All build dependencies are listed in BuildRequires, except for any that
     are listed in the exceptions section of Packaging Guidelines.
[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]: 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 do not use a name that already exist
[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).
[x]: Package functions as described.
[x]: Latest version is packaged.
[x]: Package does not include license text files separate from upstream.
[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.

---> koji scratch build.
http://koji.fedoraproject.org/koji/taskinfo?taskID=6618424

[x]: %check is present and all tests pass.
[x]: Packages should try to preserve timestamps of original installed files.
[x]: Packager, Vendor, PreReq, Copyright tags should not be in spec file
[x]: Sources can be downloaded from URI in Source: tag
[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]: Dist tag is present (not strictly required in GL).
[x]: No file requires outside of /etc, /bin, /sbin, /usr/bin, /usr/sbin.
[x]: Uses parallel make %{?_smp_mflags} macro.
[x]: SourceX is a working URL.
[x]: Spec use %global instead of %define unless justified.

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

Generic:
[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: cscppc-1.0.2-2.fc21.x86_64.rpm
          cscppc-1.0.2-2.fc21.src.rpm
cscppc.x86_64: E: statically-linked-binary /usr/bin/cscppc
cscppc.x86_64: W: only-non-binary-in-usr-lib
cscppc.x86_64: W: no-manual-page-for-binary cscppc
cscppc.src: W: spelling-error Summary(en_US) cppcheck -> checkup
cscppc.src: W: spelling-error %description -l en_US cppcheck -> checkup
2 packages and 0 specfiles checked; 1 errors, 4 warnings.




Rpmlint (installed packages)
----------------------------
# rpmlint cscppc
cscppc.x86_64: W: ldd-failed /usr/bin/cscppc
cscppc.x86_64: E: statically-linked-binary /usr/bin/cscppc
cscppc.x86_64: W: only-non-binary-in-usr-lib
cscppc.x86_64: W: no-manual-page-for-binary cscppc
1 packages and 0 specfiles checked; 1 errors, 3 warnings.
# echo 'rpmlint-done:'



Requires
--------
cscppc (rpmlib, GLIBC filtered):
    cppcheck



Provides
--------
cscppc:
    cscppc
    cscppc(x86-64)



Source checksums
----------------
http://git.fedorahosted.org/cgit/cscppc.git/snapshot/cscppc-1.0.2.tar.xz :
  CHECKSUM(SHA256) this package     : 7ab42ff57f958a76dd8a5163c7a421317952c238a95054b7457e7971f6346eef
  CHECKSUM(SHA256) upstream package : 7ab42ff57f958a76dd8a5163c7a421317952c238a95054b7457e7971f6346eef


Generated by fedora-review 0.5.1 (bb9bf27) last change: 2013-12-13
Command line :/usr/bin/fedora-review -m fedora-rawhide-x86_64 -b 1066026
Buildroot used: fedora-rawhide-x86_64
Active plugins: Generic, Shell-api, C/C++
Disabled plugins: Java, Python, fonts, SugarActivity, Ocaml, Perl, Haskell, R, PHP, Ruby
Disabled flags: EXARCH, EPEL5, BATCH, DISTTAG

Comment 10 Mukundan Ragavan 2014-03-10 16:55:22 UTC
According to the packaging guidelines, I think this needs FESCO approval since there is a statically linked executable.

https://fedoraproject.org/wiki/Packaging:Guidelines#Statically_Linking_Executables

Can you please take care of this?

Comment 11 Kamil Dudka 2014-03-11 20:39:54 UTC
Sure.  I have filed a FESCO ticket:

https://fedorahosted.org/fesco/ticket/1253

Comment 12 Kamil Dudka 2014-03-14 14:20:38 UTC
(In reply to Mukundan Ragavan from comment #9)
> Rpmlint
> -------
> Checking: cscppc-1.0.2-2.fc21.x86_64.rpm
>           cscppc-1.0.2-2.fc21.src.rpm
> cscppc.x86_64: E: statically-linked-binary /usr/bin/cscppc
> cscppc.x86_64: W: only-non-binary-in-usr-lib
> cscppc.x86_64: W: no-manual-page-for-binary cscppc

I have pushed a simple man page upstream:

https://git.fedorahosted.org/cgit/cscppc.git/commit/?id=19363a53

Comment 13 Mukundan Ragavan 2014-03-26 21:16:19 UTC
FESCO has granted static linking exception. Package APPROVED.

Comment 14 Kamil Dudka 2014-03-26 23:39:21 UTC
Thank you very much for the review, Mukundan!

Comment 15 Kamil Dudka 2014-03-26 23:44:20 UTC
New Package SCM Request
=======================
Package Name: cscppc
Short Description: A compiler wrapper that runs cppcheck in background
Owners: kdudka
Branches: f19 f20 el6 epel7
InitialCC:

Comment 16 Gwyn Ciesla 2014-03-27 12:16:49 UTC
Git done (by process-git-requests).

Comment 17 Kamil Dudka 2014-03-27 14:44:14 UTC
Thank you for setting up the git repo!

Comment 18 Fedora Update System 2014-03-27 15:38:24 UTC
cscppc-1.0.3-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/cscppc-1.0.3-1.fc20

Comment 19 Fedora Update System 2014-03-27 15:38:33 UTC
cscppc-1.0.3-1.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/cscppc-1.0.3-1.fc19

Comment 20 Fedora Update System 2014-03-27 15:38:52 UTC
cscppc-1.0.3-1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/cscppc-1.0.3-1.el6

Comment 21 Fedora Update System 2014-03-27 20:44:35 UTC
cscppc-1.0.3-1.el6 has been pushed to the Fedora EPEL 6 testing repository.

Comment 22 Fedora Update System 2014-04-15 15:44:54 UTC
cscppc-1.0.3-1.fc19 has been pushed to the Fedora 19 stable repository.

Comment 23 Fedora Update System 2014-04-15 15:46:09 UTC
cscppc-1.0.3-1.fc20 has been pushed to the Fedora 20 stable repository.

Comment 24 Fedora Update System 2014-04-15 23:28:31 UTC
cscppc-1.0.3-1.el6 has been pushed to the Fedora EPEL 6 stable repository.