Bug 1077812 - nqp bundles libtommath
nqp bundles libtommath
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: nqp (Show other bugs)
rawhide
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Gerd Pokorra
Fedora Extras Quality Assurance
: Reopened
Depends On:
Blocks: DuplicSysLibsTracker
  Show dependency treegraph
 
Reported: 2014-03-18 11:48 EDT by Ville Skyttä
Modified: 2014-04-04 04:21 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-04-04 04:21:40 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Ville Skyttä 2014-03-18 11:48:46 EDT
https://fedoraproject.org/wiki/Packaging:No_Bundled_Libraries
https://fedoraproject.org/wiki/Packaging:Treatment_Of_Bundled_Libraries

nqp appears to bundle libtommath which is available as a separate package in Fedora.

$ repoquery --repoid=rawhide-debuginfo -l nqp-debuginfo | grep libtommath
Comment 1 Gerd Pokorra 2014-04-03 08:42:17 EDT
At patched and newer version of NQP is built in rawhide that to not bundle libtommath.

NQP build URL:

https://koji.fedoraproject.org/koji/buildinfo?buildID=508781

A newer version of rakudo-star is built on top of it.
Comment 2 Ville Skyttä 2014-04-03 09:12:35 EDT
Seems to work, but please note from the link in initial comment,

https://fedoraproject.org/wiki/Packaging:Treatment_Of_Bundled_Libraries#Packages_with_Bundled_Libraries

"Bundled libraries (and/or their source code) must be explicitly deleted during %prep."
Comment 3 Gerd Pokorra 2014-04-03 09:29:31 EDT
The patch adds a flag has-libtommath to Configure.pl. So this solution is better then simple deleting files. The patch is also sent to upstream and I hope it will be applied.

I think this ticket could be closed.
Comment 4 Ville Skyttä 2014-04-03 09:36:51 EDT
Yes, I looked into how it's done in git. Deleting the bundled needs to be done *in addition* to your patch so that they won't be accidentally used for example if the patch stops working or if detecting/using system tommath fails.

Deleting sources of bundled libraries is a MUST; the packaging guidelines don't leave it up to the packager whether to do it or not.
Comment 5 Ville Skyttä 2014-04-03 09:37:38 EDT
(In reply to Ville Skyttä from comment #4)
> Deleting the bundled needs

s/the bundled/the bundled library sources/
Comment 6 Gerd Pokorra 2014-04-03 10:18:36 EDT
I have done a deeper look in the configuration. I think the patch that I have written is a good solution. It adds the link option -ltommoth and builds the two objects that are needed.

Deleting files without a patch would only break the build. My patch is simple to maintain and already send to upstream.

URL
https://fedoraproject.org/wiki/Packaging:Treatment_Of_Bundled_Libraries
says:
....
Whenever possible, the patching should be done in a way to conditionalize use of the bundled libraries, so that it can be sent upstream for consideration.
...
Comment 7 Ville Skyttä 2014-04-03 13:25:52 EDT
The part you quote says "should", and creating an upstream patch is indeed part of a good solution.

But the very same document you link to says very explicitly just before the part you quoted: "Bundled libraries (and/or their source code) must be explicitly deleted during %prep. Build scripts may need to be patched to deal with this situation"

Note that this is a "must", not "should", and I don't think that leaves anything open. If removing the sources breaks the build, you'll need to remove them anyway and make/patch the build succeed with them removed.
Comment 8 Gerd Pokorra 2014-04-03 17:35:57 EDT
Okay!

I add a 'rm' command in the %prep section that delete the libtommath source files that are not needed to build NQP.

The build is yust runnig:

http://koji.fedoraproject.org/koji/taskinfo?taskID=6705132

The result will be se same.
Comment 9 Ville Skyttä 2014-04-04 02:56:49 EDT
http://pkgs.fedoraproject.org/cgit/nqp.git/commit/?id=d2c98b2fa2af076b225c7da709e75f0b3fd7d473

This removes only a subset of the tommath sources, without an explanation why. If some of the files are still needed, I'd say this issue needs more work, or at the very least an explanation in the specfile why all of them cannot be removed.
Comment 10 Gerd Pokorra 2014-04-04 04:14:19 EDT
bn_mp_(get|set)_long.c files are extentions.

I added a comment in the spec file and a comment of the comment.

The commit log is at:

http://pkgs.fedoraproject.org/cgit/nqp.git/commit/?id=ed629e3024adf3daaf250da69c3b0ec30f9a98b1


Because it is only an explanation I do not start the rebuild yet.
Comment 11 Ville Skyttä 2014-04-04 04:21:40 EDT
Looks fine to me.

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