Bug 1132275 - ghc-rpm-macros should run ghc-deps.sh using a fileattrs file
Summary: ghc-rpm-macros should run ghc-deps.sh using a fileattrs file
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: ghc-rpm-macros
Version: 21
Hardware: All
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Jens Petersen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 1131892
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-08-21 03:49 UTC by Jens Petersen
Modified: 2014-12-12 03:59 UTC (History)
9 users (show)

Fixed In Version: ghc-rpm-macros-1.2.16-1.fc21
Clone Of: 1131892
Environment:
Last Closed: 2014-11-13 18:13:19 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Jens Petersen 2014-08-21 03:49:17 UTC
+++ This bug was initially created as a clone of Bug #1131892 +++

In the Fedora 21 and 22 build slaves, `rpmdeps --provides` crashes when building bustle-0.4.7:

http://koji.fedoraproject.org/koji/taskinfo?taskID=7407823
http://koji.fedoraproject.org/koji/taskinfo?taskID=7407826

Here’s the relevant bit of the log:

Finding  Provides: /usr/lib/rpm/find-provides
/usr/lib/rpm/find-provides: line 3: 15767 Segmentation fault      /usr/lib/rpm/rpmdeps --provides
error: /usr/lib/rpm/find-provides failed: 8b00
error: Failed to find Provides:
Requires(interp): /bin/sh /bin/sh /bin/sh
Requires(post): /bin/sh
Requires(postun): /bin/sh
Requires(posttrans): /bin/sh
RPM build errors:
    /usr/lib/rpm/find-provides failed: 8b00
    Failed to find Provides:
Child return code was: 1

I can’t reproduce this locally (but I’m on F19 and can’t upgrade at the moment) so I can’t get a backtrace. Is there a sensible way of getting one?

bustle.spec is here: http://pkgs.fedoraproject.org/cgit/bustle.git/tree/bustle.spec (from bug #1129484).

--- Additional comment from Panu Matilainen on 2014-08-20 18:05:17 JST ---

Fix is being built.

However any package tripping up on this should reviewed as to why the external dependency generator is being used. Its possible there are some real usecases for that still, but 99% the cases are filtering hacks that are either no longer needed or would be better of using native filtering (http://rpm.org/wiki/PackagerDocs/DependencyGenerator)

--- Additional comment from Panu Matilainen on 2014-08-20 18:11:58 JST ---

Oh and as for bustle, its not guilty of anything in itself. The problem (of using the deprecated external dependency generator) comes from ghc-rpm-macros.

--- Additional comment from Panu Matilainen on 2014-08-20 18:17:01 JST ---

Fixed in rpm-4.12.0-0.beta1.4.fc22 (and fc21 once it finishes building):

http://koji.fedoraproject.org/koji/taskinfo?taskID=7429952
http://koji.fedoraproject.org/koji/taskinfo?taskID=7429979

--- Additional comment from Jens Petersen on 2014-08-21 00:29:26 JST ---

Thanks! - I ran into this earlier today when doing a ghc scratch build.

I will see what changes should be made to ghc-rpm-macros.

Comment 2 Jens Petersen 2014-08-22 10:15:45 UTC
Built for F22 rawhide today - will backport to F21 soon.

Comment 3 Jens Petersen 2014-09-05 09:56:20 UTC
Note that ghc.spec also overrides the internal dep generator.

Comment 4 Fedora Update System 2014-09-10 08:37:35 UTC
ghc-rpm-macros-1.2.15-1.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/ghc-rpm-macros-1.2.15-1.fc21

Comment 5 Fedora Update System 2014-09-10 16:42:18 UTC
Package ghc-rpm-macros-1.2.15-1.fc21:
* should fix your issue,
* was pushed to the Fedora 21 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing ghc-rpm-macros-1.2.15-1.fc21'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-10614/ghc-rpm-macros-1.2.15-1.fc21
then log in and leave karma (feedback).

Comment 6 Fedora Update System 2014-10-16 08:25:46 UTC
ghc-rpm-macros-1.2.16-1.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/ghc-rpm-macros-1.2.16-1.fc21

Comment 7 Fedora Update System 2014-11-13 18:13:19 UTC
ghc-rpm-macros-1.2.16-1.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 8 Jens Petersen 2014-12-10 09:37:29 UTC
One thing I notice though with fileattrs is that they apply to all package builds
so they do add a small overhead locally at least.

Eg previously ghc-deps.sh would only run when building Haskell packages
but now it is run on all dynlinked executables if ghc-rpm-macros is installed.

Comment 9 Panu Matilainen 2014-12-10 10:05:30 UTC
The scripts should only ever be executed if there are files that match the rules specified by the fileattr, so it sounds like either the rule is too broad/buggy and/or rpm is buggy. And indeed, on freshly upgraded-to-F21, every single file appears to be classified as ghc (try rpmbuild with --rpmfcdebug to see the classification spew at end of %install).

Okay, the matching rule is indeed the problem:
%__ghc_path     ^%{ghclibdir}/.*/libHS.*\\.(so|a)$ || ^%{_bindir}/.*

I assume '||' is intended as "or" operator there, but regexes doesn't support such a syntax. You need to cram it all into a single regex, something like (but untested so dont apply blindly):

%__ghc_path     ^(%{ghclibdir}/.*/libHS.*\\.(so|a)|%{_bindir}/.*)$

Comment 10 Jens Petersen 2014-12-11 01:34:57 UTC
(In reply to Panu Matilainen from comment #9)
> Okay, the matching rule is indeed the problem:
> %__ghc_path     ^%{ghclibdir}/.*/libHS.*\\.(so|a)$ || ^%{_bindir}/.*

Ah well I think I already fixed that in Rawhide and f21 updates-testing,
which I plan to push to stable real soon. :)

My question was really about:
http://pkgs.fedoraproject.org/cgit/ghc-rpm-macros.git/tree/ghc_bin.attr

Comment 11 Jens Petersen 2014-12-11 03:36:17 UTC
(In reply to Panu Matilainen from comment #9)
> Okay, the matching rule is indeed the problem:
> %__ghc_path     ^%{ghclibdir}/.*/libHS.*\\.(so|a)$ || ^%{_bindir}/.*

I stole this from /usr/lib/rpm/fileattrs/scl.attr BTW
so maybe we should open a bug report against scl-utils then.

(It seemed to work though, though as I remarked in the previous
comment I split it up anyway since executables only need to generate
requires here.)

Comment 12 Jens Petersen 2014-12-11 05:29:20 UTC
(In reply to Jens Petersen from comment #11)
> (It seemed to work though

Well anyway I believe you - so presumably it just worked
since it ran on everything then...

Comment 13 Jens Petersen 2014-12-12 03:59:50 UTC
Anyway if you have any suggestions to improve ghc_bin.attr (comment 10),
do let me know. :-)


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