Bug 241471

Summary: In OCaml, *.cmi files are not source files
Product: [Fedora] Fedora Reporter: Richard W.M. Jones <rjones>
Component: rpmlintAssignee: Ville Skyttä <ville.skytta>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 6   
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: 0.81-1.fc7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-09-07 17:21:41 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Candidate patch none

Description Richard W.M. Jones 2007-05-26 10:30:39 UTC
Description of problem:

When I run rpmlint on an OCaml package, I get lots of errors like this:

W: ocaml-ocamlnet devel-file-in-non-devel-package
/usr/lib64/ocaml/netcgi2/netcgi_test.cmi

In OCaml *.cmi files are not source files but compiled files which describe the
signature of a module.  An easy way to detect this is to look for "/ocaml"
(note: no trailing slash) in the path.  Or you can run 'file' on it, for example:

# file /usr/lib64/ocaml/calendar/calendar.cmi
/usr/lib64/ocaml/calendar/calendar.cmi: Objective caml interface file (.cmi)
(Version 010).

Version-Release number of selected component (if applicable):

# rpm -q rpmlint
rpmlint-0.80-1.fc6

Additional info:

OCaml draft packaging policy: http://fedoraproject.org/wiki/PackagingDrafts/OCaml

Comment 1 Ville Skyttä 2007-05-26 11:15:18 UTC
Note that rpmlint doesn't say that *.cmi are source files, it just treats them
as development related ones.

Not doing that is easy, just remove cmi from includefile_regex in FilesCheck.py,
but as I know next to nothing about ocaml, I'd like you to confirm that they are
indeed something that should generally be packaged in "main" rather than -devel
packages.

Related reading just for reference:

Mandriva bug report asking for *.cmi to be treated as devel files in rpmlint:
http://archives.mandrivalinux.com/cooker/2004-10/msg03607.php

Debian ocaml policy mentions *.cmi only in the "documentation" section and they
appear to package all *.cm* in devel packages:
http://pkg-ocaml-maint.alioth.debian.org/ocaml_packaging_policy.txt
http://packages.debian.org/cgi-bin/search_packages.pl?exact=0&searchon=names&suite=all&case=insensitive&section=all&keywords=ocaml&arch=any

PLD appears to package all *.cm* in devel packages too:
http://cvs.pld-linux.org/cgi-bin/cvsweb/SPECS/

Will also ask for comments from the Mandriva bug submitter.

Comment 2 Richard W.M. Jones 2007-05-26 13:30:05 UTC
I don't think those policies are correct because they stop OCaml scripts from
working.  For Fedora, this is the draft policy (note however that I wrote it):

http://fedoraproject.org/wiki/PackagingDrafts/OCaml#head-e9ace415008833d09b0eb93bc92d43f2e1ae2c3e

and the rationale behind it is in this thread (you have to read all the way
through):

https://www.redhat.com/archives/fedora-packaging/2007-May/thread.html#00117

Comment 3 Richard W.M. Jones 2007-05-26 22:20:05 UTC
Mandriva bug:

http://qa.mandriva.com/show_bug.cgi?id=31045

Comment 4 Ville Skyttä 2007-05-27 12:25:01 UTC
Created attachment 155520 [details]
Candidate patch

Thanks.  Just in case you didn't know, rpmlint's upstream is no longer
Mandriva, but http://rpmlint.zarb.org/.  But it's useful to gather opinions
from elsewhere too.

Here's a candidate patch I intend to apply in the next upstream rpmlint version
unless some flaws are found in it - it removes *.cmi from list of files being
treated as devel ones, and adds *.cmx, *.cmxa, *.ml, *.mli and *.o.

Comment 5 Richard W.M. Jones 2007-05-28 11:46:47 UTC
The patch looks OK to me.

Comment 6 Ville Skyttä 2007-06-02 20:13:32 UTC
Applied upstream in smaller chunks, will be in the next release:
http://rpmlint.zarb.org/cgi-bin/trac.cgi/changeset/1353

Comment 7 Fedora Update System 2007-09-07 17:21:36 UTC
rpmlint-0.81-1.fc7 has been pushed to the Fedora 7 stable repository.  If problems still persist, please make note of it in this bug report.